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.486 2004/03/18 19:31:38 grubba Exp $ + || $Id: program.c,v 1.487 2004/03/23 13:41:56 grubba Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.486 2004/03/18 19:31:38 grubba Exp $"); + RCSID("$Id: program.c,v 1.487 2004/03/23 13:41:56 grubba 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:5179:    VSPRINTF(buf, fmt, args);   #endif /* HAVE_VSNPRINTF */       if((size_t)strlen(buf) >= (size_t)sizeof(buf))    Pike_fatal("Buffer overflow in my_yyerror.\n");       yyerror(buf);    va_end(args);   }    + struct pike_string *format_exception_for_error_msg (struct svalue *thrown) + { +  struct pike_string *s = NULL; +  +  push_svalue (thrown); +  SAFE_APPLY_MASTER ("describe_error", 1); +  +  if (sp[-1].type == T_STRING) { +  f_string_trim_all_whites(1); +  push_constant_text("\n"); +  push_constant_text(" "); +  f_replace(3); +  return (--sp)->u.string; +  } +  else { +  pop_stack(); +  return NULL; +  } + } +    void yy_describe_exception(struct svalue *thrown)   {    /* 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) {