Branch: Tag:

1999-11-18

1999-11-18 02:46:04 by Martin Stjernholm <mast@lysator.liu.se>

Handle forward references to program constants.

Rev: src/language.yacc:1.134
Rev: src/las.c:1.111
Rev: src/program.c:1.173

183:   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.133 1999/11/14 23:05:31 mast Exp $"); + RCSID("$Id: language.yacc,v 1.134 1999/11/18 02:46:02 mast Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif
533:    {    if(compiler_pass==2)    yyerror("Constant definition is not constant."); - /* add_constant($1->u.sval.u.string,0, current_modifiers); * Prototype */ +  else +  add_constant($1->u.sval.u.string,0, current_modifiers);    } else {    if(!num_parse_error)    {
938:    {    push_type_int(p->id);    }else{ +  if (compiler_pass!=1) {    if ((sp[-2].type == T_STRING) && (sp[-2].u.string->len > 0) &&    (sp[-2].u.string->len < 256)) {    my_yyerror("Not a valid program specifier: '%s'",
945:    } else {    yyerror("Not a valid program specifier.");    } +  }    push_type_int(0);    }    pop_n_elems(2);