pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:359:   /*! @class CPP    *!    *! The state for an instance of the preprocessor.    *!    *! @seealso    *! @[predef::cpp()]    */   PIKECLASS CPP    program_flags PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT;   { -  /*! @decl inherit Reporter -  */ -  INHERIT reporter; -  +     PIKEVAR mapping(string:object(define)) defines flags ID_PRIVATE|ID_PROTECTED;    PIKEVAR int current_line;    PIKEVAR int compile_errors;    PIKEVAR string current_file;    PIKEVAR string charset;    CVAR struct string_builder buf;    PIKEVAR object handler;    PIKEVAR object compat_handler;    PIKEVAR int compat_major;    PIKEVAR int compat_minor;    PIKEVAR string prefix;    PIKEVAR int picky_cpp;    PIKEVAR int keep_comments;    PIKEVAR int dependencies_fail;    PIKEVAR int auto_convert;       PIKEVAR mapping(string:function(string:string)) directives flags ID_PROTECTED;    -  static int f_inherited_Reporter_report_fun_num = -1; -  +     INIT    {    init_string_builder(&THIS->buf, 0);    THIS->current_line = 1;    }       EXIT    {    /* NOTE: Most of the fields are mapped, and thus freed automatically. */       if (THIS->buf.s) {    free_string_builder(&THIS->buf);    }    }    -  EXTRA -  { -  int id = find_identifier("report", reporter_program); -  if (id < 0) { -  yyerror("Failed to find Reporter::report().\n"); -  } else { -  f_inherited_Reporter_report_fun_num = -  really_low_reference_inherited_identifier(NULL, 1, id); -  } -  } -  +     PIKEFUN string _sprintf(int c, mapping|void opts)    flags ID_PROTECTED;    {    struct CPP_struct *this = THIS;    ref_push_string(MK_STRING("CPP(%s:%d)"));    if (this->current_file) {    ref_push_string(this->current_file);    } else {    ref_push_string(MK_STRING("-"));    }