pike.git / src / las.c

version» Context lines:

pike.git/src/las.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: las.c,v 1.431 2008/07/18 13:02:29 mast Exp $ + || $Id: las.c,v 1.432 2008/08/16 21:52:42 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"
pike.git/src/las.c:1414:    return;    }       else {    struct program_state *state = Pike_compiler;    while (state && (state->new_program->id != n->u.integer.a)) {    state = state->previous;    }    if(!state)    { -  yyerror("Failed to resolve external constant"); +  yyerror("Failed to resolve external constant.");    push_int(0);    return;    }    p = state->new_program;    numid=n->u.integer.b;    }    break;       case F_IDENTIFIER:    p=Pike_compiler->new_program;    numid=n->u.id.number;    break;       case F_LOCAL:    /* FIXME: Ought to have the name of the identifier in the message. */ -  yyerror("Expected constant, got local variable"); +  yyerror("Expected constant, got local variable.");    push_int(0);    return;       case F_GLOBAL:    /* FIXME: Ought to have the name of the identifier in the message. */ -  yyerror("Expected constant, got global variable"); +  yyerror("Expected constant, got global variable.");    push_int(0);    return;       case F_UNDEFINED:    if(Pike_compiler->compiler_pass==2) {    /* FIXME: Ought to have the name of the identifier in the message. */ -  yyerror("Expected constant, got undefined identifier"); +  yyerror("Expected constant, got undefined identifier.");    }    push_int(0);    return;       default:    {    if(is_const(n))    {    ptrdiff_t args=eval_low(n,1);    if(args==1) return;       if(args!=-1)    {    if(!args)    { -  yyerror("Expected constant, got void expression"); +  yyerror("Expected constant, got void expression.");    }else{    yyerror("Possible internal error!!!");    pop_n_elems(DO_NOT_WARN(args-1));    return;    } -  +  } else { +  yyerror("Failed to evaluate constant expression.");    } -  +  } else { +  yyerror("Expected constant expression.");    } -  -  my_yyerror("Expected constant, got something else (%d)",n->token); +     push_int(0);    return;    }    }       i=ID_FROM_INT(p, numid);       /* Warning:    * This code doesn't produce function pointers for class constants,    * which can be harmful...