pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:103:   %left TOK_LSH TOK_RSH   %left '+' '-'   %left '*' '%' '/'   %right TOK_NOT '~'   %nonassoc TOK_INC TOK_DEC      %{   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.206 2000/08/15 19:00:24 grubba Exp $"); + RCSID("$Id: language.yacc,v 1.207 2000/08/16 16:02:08 grubba 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:467:    | TOK_IMPORT error TOK_LEX_EOF    {    yyerror("Missing ';'.");    yyerror("Unexpected end of file.");    }    | TOK_IMPORT error '}' { yyerror("Missing ';'."); }    ;      constant_name: TOK_IDENTIFIER '=' safe_expr0    { -  int tmp; +  ptrdiff_t tmp;    /* This can be made more lenient in the future */       /* Ugly hack to make sure that $3 is optimized */    tmp=Pike_compiler->compiler_pass;    $3=mknode(F_COMMA_EXPR,$3,0);    Pike_compiler->compiler_pass=tmp;       if ((Pike_compiler->current_modifiers & ID_EXTERN) &&    (Pike_compiler->compiler_pass == 1)) {    yywarning("Extern declared constant.");
pike.git/src/language.yacc:495:    add_constant($1->u.sval.u.string, 0,    Pike_compiler->current_modifiers & ~ID_EXTERN);    } else {    if(!Pike_compiler->num_parse_error)    {    tmp=eval_low($3);    if(tmp < 1)    {    yyerror("Error in constant definition.");    }else{ -  pop_n_elems(tmp-1); +  pop_n_elems(DO_NOT_WARN((INT32)(tmp - 1)));    add_constant($1->u.sval.u.string, Pike_sp-1,    Pike_compiler->current_modifiers & ~ID_EXTERN);    pop_stack();    }    }    }    if($3) free_node($3);    free_node($1);    }    | bad_identifier '=' safe_expr0 { if ($3) free_node($3); }