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.574 2004/10/30 15:57:19 nilsson Exp $ + || $Id: program.c,v 1.575 2004/11/05 16:21:23 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:1511:    if(!(SAFE_IS_ZERO(Pike_sp-1) && Pike_sp[-1].subtype==1))    {    ret=mkconstantsvaluenode(Pike_sp-1);    }    }    pop_stack();    }    else    if(Pike_compiler->compiler_pass==2) {    if (throw_value.type == T_STRING) { -  my_yyerror("%O", throw_value); +  my_yyerror("%S", throw_value.u.string);    free_svalue(&throw_value);    throw_value.type = T_INT;    }    else {    handle_compile_exception ("Error resolving %S.", ident);    }    }    }    END_CYCLIC();   
pike.git/src/program.c:1919:    funpb->inherit_offset = funp->inherit_offset;    funpb->identifier_offset = funp->identifier_offset;    }    }    }    if(found_better!=-1)    continue;    }    if ((fun->func.offset == -1) && (funp->id_flags & ID_INLINE) &&    IDENTIFIER_IS_PIKE_FUNCTION(fun->identifier_flags)) { -  if (fun->name->len < 900) { +     my_yyerror("Missing definition for local function %S.",    fun->name); -  } else { -  yyerror("Missing definition for local function."); +     } -  } +     add_to_identifier_index(i);    }    fsort_program_identifier_index(p->identifier_index,    p->identifier_index +    p->num_identifier_index - 1,    p);          p->flags |= PROGRAM_FIXED;   
pike.git/src/program.c:1957:    {    struct pike_string *name=ID_FROM_INT(p, i)->name;       e=find_shared_string_identifier(name,p);    if(e == -1)    e=really_low_find_shared_string_identifier(name, p,    SEE_STATIC|SEE_PRIVATE);       if((e != i) && (e != -1))    { -  if(name->len < 1024) +     my_yyerror("Illegal to redefine final identifier %S", name); -  else -  my_yyerror("Illegal to redefine final identifier (name too large to print)."); +     }    }    }    }      #ifdef DEBUG_MALLOC    {   #define DBSTR(X) ((X)?(X)->str:"")    int e,v;    INT32 line;
pike.git/src/program.c:4238:    } else {    yywarning("Redefining inherited variable %S "    "with different type.", name);    }    }          if(!IDENTIFIER_IS_VARIABLE(ID_FROM_INT(Pike_compiler->new_program, n)->    identifier_flags))    { -  my_yyerror("Illegal to redefine inherited variable " -  "with different type."); +  my_yyerror("Illegal to redefine inherited variable %S " +  "with different type.", name);    return n;    }       if ((ID_FROM_INT(Pike_compiler->new_program, n)->run_time_type !=    PIKE_T_MIXED) &&    (ID_FROM_INT(Pike_compiler->new_program, n)->run_time_type !=    compile_type_to_runtime_type(type))) { -  my_yyerror("Illegal to redefine inherited variable " -  "with different type."); +  my_yyerror("Illegal to redefine inherited variable %S " +  "with different type.", name);    return n;    }       /* Copy the variable reference, so that we can change the    * compile-time type. */    n2 = low_define_variable(name, type,    (flags | ID_ALIAS) & ~ID_EXTERN,    ID_FROM_INT(Pike_compiler->new_program, n)->    func.offset +    INHERIT_FROM_INT(Pike_compiler->new_program,
pike.git/src/program.c:5922:    struct program *p = PROG_FROM_PTR (o->prog, idref);    struct identifier *id = p->identifiers + idref->identifier_offset;    return low_get_line (p->program + id->func.offset, p, linep);    }    *linep = 0;    return NULL;   }      void va_yyerror(const char *fmt, va_list args)   { -  char buf[8192]; -  Pike_vsnprintf (buf, sizeof (buf), fmt, args); -  yyerror(buf); +  struct string_builder s; +  struct pike_string *tmp; +  init_string_builder(&s, 0); +  string_builder_vsprintf(&s, fmt, args); +  tmp = finish_string_builder(&s); +  low_yyerror(tmp); +  free_string(tmp);   }      void my_yyerror(const char *fmt,...)   {    va_list args;    va_start(args,fmt);    va_yyerror (fmt, args);    va_end(args);   }   
pike.git/src/program.c:5974:    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)) {    struct pike_string *s = format_exception_for_error_msg (&thrown);    if (s) { -  my_yyerror("%S", s); +  low_yyerror(s);    free_string (s);    }    }       pop_stack();    free_svalue(&thrown);   }      extern void yyparse(void);