pike.git / src / program.c

version» Context lines:

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.492 2004/09/27 15:12:03 grubba Exp $ + || $Id: program.c,v 1.493 2004/10/11 16:41:48 mast Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.492 2004/09/27 15:12:03 grubba Exp $"); + RCSID("$Id: program.c,v 1.493 2004/10/11 16:41:48 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_macros.h"   #include "fsort.h"
pike.git/src/program.c:939:    throw_value.type = T_INT;       if (!ident->size_shift) {    my_yyerror("Couldn't index module '%s'.", ident->str);    } else {    yyerror("Couldn't index module.");    }       push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown); +  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown, 0);    pop_stack();    free_svalue(&thrown);    } else {    int e = num_used_modules;    struct svalue *m = modules - num_used_modules;       while(--e>=0)    {    push_svalue(m+e);    ref_push_string(ident);
pike.git/src/program.c:1095:    struct svalue thrown = throw_value;    throw_value.type = T_INT;       if (!ident->size_shift)    my_yyerror("Error resolving '%s'.", ident->str);    else    yyerror("Error resolving identifier.");       push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown); +  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown, 0);    pop_stack();    free_svalue(&thrown);    }    }    }    END_CYCLIC();    if(ret) return ret;    }       return 0;
pike.git/src/program.c:3420:    my_yyerror("Couldn't find program: %s",s->str);    else    yyerror("Couldn't find program");    }    else {    struct svalue thrown = throw_value;    throw_value.type = T_INT;    my_yyerror("Error finding program");    push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown); +  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown, 0);    pop_stack();    free_svalue(&thrown);    }       return 0;   }      void simple_do_inherit(struct pike_string *s,    INT32 flags,    struct pike_string *name)
pike.git/src/program.c:4568:       if(SETJMP(tmp2))    {    struct svalue zero, thrown = throw_value;    throw_value.type = T_INT;       yyerror("Couldn't store constant.");       push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown); +  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown, 0);    pop_stack();    free_svalue(&thrown);       zero.type = T_INT;    zero.subtype = NUMBER_NUMBER;    zero.u.integer=0;       UNSETJMP(tmp2);    return store_constant(&zero, equal, constant_name);    }else{
pike.git/src/program.c:5215:    push_constant_text(" ");    f_replace(3);    return (--sp)->u.string;    }    else {    pop_stack();    return NULL;    }   }    - void yy_describe_exception(struct svalue *thrown) + void yy_describe_exception(struct svalue *thrown, int warning)   {    /* FIXME: Doesn't handle wide string error messages. */    struct pike_string *s = 0;       if ((thrown->type == T_ARRAY) && thrown->u.array->size &&    (thrown->u.array->item[0].type == T_STRING)) {    /* Old-style backtrace */    s = thrown->u.array->item[0].u.string;    } else if (thrown->type == T_OBJECT) {    struct generic_error_struct *ge;
pike.git/src/program.c:5238:    s = ge->desc;    }    }       if (s && !s->size_shift) {    ref_push_string(s);    f_string_trim_all_whites(1);    push_constant_text("\n");    push_constant_text(" ");    f_replace(3); -  my_yyerror(sp[-1].u.string->str); +  if (warning) +  yywarning (sp[-1].u.string->str); +  else +  yyerror(sp[-1].u.string->str);    pop_stack();    }   }      extern void yyparse(void);      #ifdef PIKE_DEBUG   #define do_yyparse() do { \    struct svalue *save_sp=Pike_sp; \    yyparse(); /* Parse da program */ \
pike.git/src/program.c:5853: Inside #if defined(PIKE_DEBUG)
   if (c->placeholder->prog != c->p)    Pike_fatal("Placeholder object got wrong program after second pass.\n");   #endif    if(SETJMP(rec))    {    struct svalue thrown = throw_value;    debug_malloc_touch(c->placeholder);    throw_value.type = T_INT;    push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown); +  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown, 0);    pop_stack();    free_svalue(&thrown);    zap_placeholder(c);    }else{    debug_malloc_touch(c->placeholder);    call_pike_initializers(c->placeholder,0);    }    UNSETJMP(rec);    }    else {