pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.c:1:
/* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: program.c,v 1.
683
2008/05/03 15:
29
:
25
nilsson
Exp $
+
|| $Id: program.c,v 1.
684
2008/05/03 15:
51
:
50
grubba
Exp $
*/ #include "global.h" #include "program.h" #include "object.h" #include "dynamic_buffer.h" #include "pike_types.h" #include "stralloc.h" #include "las.h" #include "lex.h"
pike.git/src/program.c:1564:
for(n=0;n<=c->compilation_depth;n++,p=p->previous) { int i; if(see_inherit) { i=really_low_find_shared_string_identifier(ident, p->new_program, SEE_STATIC|SEE_PRIVATE); if(i!=-1) {
+
if ((p->flags & COMPILATION_FORCE_RESOLVE) &&
+
(p->compiler_pass == 2) &&
+
((p->num_inherits + 1) < p->new_program->num_inherits) &&
+
(PTR_FROM_INT(p->new_program, i)->inherit_offset >
+
p->num_inherits)) {
+
/* Don't look up symbols inherited later, when looking up
+
* inherits...
+
*/
+
continue;
+
}
return p == Pike_compiler ? mkidentifiernode(i) : mkexternalnode(p->new_program, i); } } if((ret=index_modules(ident, &p->module_index_cache, p->num_used_modules, modules))) return ret;
pike.git/src/program.c:4192:
#endif CDFPRINTF((stderr, "th(%ld) %p inherit %p\n", (long) th_self(), Pike_compiler->new_program, p)); if(!p) { yyerror("Illegal program pointer."); return; }
+
if (Pike_compiler->compiler_pass == 2) {
+
struct program *old_p =
+
Pike_compiler->new_program->inherits[Pike_compiler->num_inherits+1].prog;
+
Pike_compiler->num_inherits += old_p->num_inherits;
+
if (old_p != p) {
+
yyerror("Got different program for inherit in second pass.");
+
}
+
return;
+
}
+
#ifdef WITH_FACETS /* Check if inherit is a facet inherit. */ check_for_facet_inherit(p); #endif if (p == placeholder_program) { yyerror("Trying to inherit placeholder program (resolver problem)."); return; }
pike.git/src/program.c:6859:
mark_free_svalue (&throw_value); if (yyerror_fmt) { va_list args; va_start (args, yyerror_fmt); va_yyerror (yyerror_fmt, args); va_end (args); } push_svalue(&thrown);
+
/* safe_apply_current(PC_FILTER_EXCEPTION_FUN_NUM, 1); */
low_safe_apply_handler("compile_exception", c->handler, c->compat_handler, 1); if (SAFE_IS_ZERO(sp-1)) { struct pike_string *s = format_exception_for_error_msg (&thrown); if (s) { low_yyerror(s); free_string (s); } }
pike.git/src/program.c:7369:
{ if(get_master()) { APPLY_MASTER("handle_inherit", args); } else { pop_n_elems(args); push_undefined(); } }
+
/*! @decl int filter_exception(SeverityLevel level, mixed err)
+
*/
+
static void f_compilation_env_filter_exception(INT32 args)
+
{
+
int level;
+
struct svalue *err;
+
+
get_all_args("filter_exception", args, "%d%*", &level, &err);
+
if (args > 2) {
+
pop_n_elems(args-2);
+
args = 2;
+
}
+
+
if (level >= REPORT_WARNING) {
+
if (level >= REPORT_ERROR) {
+
APPLY_MASTER("compile_exception", 1);
+
} else {
+
push_int(level);
+
push_string(format_exception_for_error_msg(err));
+
}
+
}
+
}
+
/*! @class PikeCompiler *! *! The Pike compiler. *! *! An object of this class compiles a single string *! of Pike code. */ static void free_compilation(struct compilation *c) {