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.533 2003/11/14 00:11:44 mast Exp $ + || $Id: program.c,v 1.534 2003/11/14 04:45:05 mast Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.533 2003/11/14 00:11:44 mast Exp $"); + RCSID("$Id: program.c,v 1.534 2003/11/14 04:45:05 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:5788:    va_list args;    va_start(args,fmt);    va_yyerror (fmt, args);    va_end(args);   }      struct pike_string *format_exception_for_error_msg (struct svalue *thrown)   {    struct pike_string *s = NULL;    -  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; -  if ((ge = (struct generic_error_struct *) -  get_storage(thrown->u.object, generic_error_program))) { -  s = ge->desc; -  } -  } +  push_svalue (thrown); +  SAFE_APPLY_MASTER ("describe_error", 1);    -  if (s) { -  extern void f_string_trim_all_whites(INT32 args); -  ref_push_string(s); +  if (sp[-1].type == T_STRING) {    f_string_trim_all_whites(1);    push_constant_text("\n");    push_constant_text(" ");    f_replace(3); -  s = (--sp)->u.string; +  return (--sp)->u.string;    } -  -  return s; +  else { +  pop_stack(); +  return NULL;    } -  + }      void handle_compile_exception (const char *yyerror_fmt, ...)   {    struct svalue thrown;    move_svalue (&thrown, &throw_value);    throw_value.type = T_INT;       if (yyerror_fmt) {    va_list args;    va_start (args, yyerror_fmt);    va_yyerror (yyerror_fmt, args);    va_end (args);    }       push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1);       if (SAFE_IS_ZERO(sp-1)) {    /* FIXME: Doesn't handle wide string error messages. */    struct pike_string *s = format_exception_for_error_msg (&thrown); -  +  if (s) {    if (!s->size_shift) yyerror (s->str);    free_string (s);    } -  +  }       pop_stack();    free_svalue(&thrown);   }      extern void yyparse(void);      #ifdef PIKE_DEBUG   #define do_yyparse() do { \    struct svalue *save_sp=Pike_sp; \