Branch: Tag:

2016-01-12

2016-01-12 17:59:09 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Got rid of some duplicated code.

Now that optional_stars is gone, local_name_list and local_name_list2
are essentially identical. Now local_name_list2 is gone as well.

342:   %type <n> labeled_statement   %type <n> lambda   %type <n> local_name_list - %type <n> local_name_list2 +    %type <n> low_idents   %type <n> safe_lvalue   %type <n> lvalue
351:   %type <n> m_expr_list   %type <n> m_expr_list2   %type <n> new_local_name - %type <n> new_local_name2 +    %type <n> normal_label_statement   %type <n> optional_else_part   %type <n> optional_label
1887:    }    ;    - new_local_name2: TOK_IDENTIFIER -  { -  int id; -  add_ref($<n>0->u.sval.u.type); -  id = add_local_name($1->u.sval.u.string, $<n>0->u.sval.u.type, 0); -  if (id >= 0) { -  /* FIXME: Consider using mklocalnode(id, -1). */ -  $$=mknode(F_ASSIGN,mkintnode(0),mklocalnode(id,0)); -  } else -  $$ = 0; -  free_node($1); -  } -  | bad_identifier { $$=0; } -  | TOK_IDENTIFIER '=' safe_expr0 -  { -  int id; -  add_ref($<n>0->u.sval.u.type); -  id = add_local_name($1->u.sval.u.string, $<n>0->u.sval.u.type, 0); -  if (id >= 0) { -  if (!(THIS_COMPILATION->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; -  } -  $$=mknode(F_ASSIGN,$3, mklocalnode(id,0)); -  } else -  $$ = 0; -  free_node($1); -  } -  | bad_identifier '=' safe_expr0 { $$=$3; } -  ; -  +    line_number_info: /* empty */    {    /* Used to hold line-number info */
1982:    { $$ = mknode(F_COMMA_EXPR, mkcastnode(void_type_string, $1), $4); }    ;    - /* Type at $0 */ - local_name_list2: new_local_name2 -  | local_name_list2 ',' propagated_type new_local_name -  { $$ = mknode(F_COMMA_EXPR, mkcastnode(void_type_string, $1), $4); } -  ; +     -  +    local_constant_name: TOK_IDENTIFIER '=' safe_expr0    {    struct pike_type *type;
3388:      comma_expr: comma_expr2    | simple_type2 local_name_list { $$=$2; free_node($1); } -  | simple_identifier_type local_name_list2 { $$=$2; free_node($1); } +  | simple_identifier_type local_name_list { $$=$2; free_node($1); }    | simple_identifier_type local_function { $$=$2; free_node($1); }    | simple_type2 local_function2 { $$=$2; free_node($1); }    ;