pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:1:   /* -*- c -*-   || 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.397 2008/01/03 21:13:38 grubba Exp $ + || $Id: language.yacc,v 1.398 2008/01/03 23:01:33 grubba Exp $   */      %pure_parser      %token TOK_ARROW      /*    * Basic value pushing    */   %token TOK_CONSTANT TOK_FLOAT TOK_STRING
pike.git/src/language.yacc:1707:    yywarning("The *-syntax in types is obsolete. Use array instead.");    }    while($1--) push_type(T_ARRAY);    type=compiler_pop_type();    if ((Pike_compiler->current_modifiers & ID_EXTERN) &&    (Pike_compiler->compiler_pass == 1)) {    yywarning("Extern declared variable has initializer.");    }    $<number>$=define_variable($2->u.sval.u.string, type,    Pike_compiler->current_modifiers & (~ID_EXTERN)); -  if (!(lex.pragmas & ID_STRICT_TYPES)) { -  /* Only warn about unused initialized variables in strict types mode. */ -  Pike_compiler->compiler_frame->variable[$<number>$].flags |= -  LOCAL_VAR_IS_USED; -  } +     free_type(type);    }    expr0    {    Pike_compiler->init_node=mknode(F_COMMA_EXPR,Pike_compiler->init_node,    mkcastnode(void_type_string,    mknode(F_ASSIGN,$5,    mkidentifiernode($<number>4))));    free_node($2);    }
pike.git/src/language.yacc:1764:    | optional_stars bad_identifier { $$=0; }    | optional_stars TOK_IDENTIFIER '=' expr0    {    int id;    push_finished_type($<n>0->u.sval.u.type);    if ($1 && (Pike_compiler->compiler_pass == 2) && !TEST_COMPAT (0, 6)) {    yywarning("The *-syntax in types is obsolete. Use array instead.");    }    while($1--) push_type(T_ARRAY);    id = add_local_name($2->u.sval.u.string, compiler_pop_type(),0); +  if (!(lex.pragmas & ID_STRICT_TYPES)) { +  /* Only warn about unused initialized variables in strict types mode. */ +  Pike_compiler->compiler_frame->variable[id].flags |= LOCAL_VAR_IS_USED; +  }    if (id >= 0)    $$=mknode(F_ASSIGN,$4,mklocalnode(id,0));    else    $$ = 0;    free_node($2);    }    | optional_stars bad_identifier '=' expr0    {    free_node($4);    $$=0;