Branch: Tag:

2008-06-19

2008-06-19 07:35:58 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Partial revert.

Rev: src/language.yacc:1.433

2:   || 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: language.yacc,v 1.432 2008/06/18 17:10:32 grubba Exp $ + || $Id: language.yacc,v 1.433 2008/06/19 07:35:58 grubba Exp $   */      %pure_parser
608:       if(!is_const($3))    { +  /* FIXME: Adding symbols in the second pass is not a good idea. */ +  if(Pike_compiler->compiler_pass==2) {    int depth = 0;    struct program_state *state = Pike_compiler;    node *n = $3;
629:    define_alias($1->u.sval.u.string, n->type,    Pike_compiler->current_modifiers & ~ID_EXTERN,    depth, id); -  } else if (Pike_compiler->compiler_pass == 2) { -  yyerror("Constant definition is not constant."); +     } else { -  /* Place holder. */ -  push_undefined(); -  add_constant($1->u.sval.u.string, Pike_sp-1, -  Pike_compiler->current_modifiers & ~ID_EXTERN); -  pop_stack(); +  yyerror("Constant definition is not constant.");    } -  +  } else +  add_constant($1->u.sval.u.string, 0, +  Pike_compiler->current_modifiers & ~ID_EXTERN);    } else {    if(!Pike_compiler->num_parse_error)    {