pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:164:   %left F_LSH F_RSH   %left '+' '-'   %left '*' '%' '/'   %right F_NOT '~'   %nonassoc F_INC F_DEC      %{   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.84 1998/04/19 00:13:18 grubba Exp $"); + RCSID("$Id: language.yacc,v 1.85 1998/04/19 03:17:37 per Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif      #include "interpret.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "las.h"   #include "interpret.h"
pike.git/src/language.yacc:464:    tmp=compiler_pass;    $3=mknode(F_ARG_LIST,$3,0);    compiler_pass=tmp;       if(!is_const($3))    {    if(compiler_pass==2)    yyerror("Constant definition is not constant.");    add_constant($1->u.sval.u.string,0, current_modifiers); /* Prototype */    } else { +  if(!num_parse_error) +  {    tmp=eval_low($3);    if(tmp < 1)    {    yyerror("Error in constant definition.");    }else{    pop_n_elems(tmp-1);    add_constant($1->u.sval.u.string,sp-1,current_modifiers);    pop_stack();    }    } -  +  }    if($3) free_node($3);    free_node($1);    }    | bad_identifier '=' safe_expr0 { if ($3) free_node($3); }    | error '=' safe_expr0 { if ($3) free_node($3); }    ;      constant_list: constant_name    | constant_list ',' constant_name    ;