Branch: Tag:

2014-08-11

2014-08-11 15:57:09 by Per Hedbor <ph@opera.com>

Removed support for *-syntax without actually changing the grammar much

This is basically step 1 of the *==array syntax removal,
the easy part. Since there is no need to start renumbering things
in the rules.

778:       /* construct the function type */    push_finished_type(Pike_compiler->compiler_frame->current_type); -  if ($5 && (Pike_compiler->compiler_pass == 2)) { -  yywarning("The *-syntax in types is obsolete. Use array instead."); -  } -  while(--$5>=0) push_type(T_ARRAY); +        if(Pike_compiler->compiler_frame->current_return_type)    free_type(Pike_compiler->compiler_frame->current_return_type);
1226:    }    ;    - optional_stars: optional_stars '*' { $$=$1 + 1; } -  | /* empty */ { $$=0; } + optional_stars: /* empty */ { $$=0; }    ;      cast: open_paren_with_line_info type ')'
1251:    ;      full_type: type4 -  | full_type '*' -  { -  if (Pike_compiler->compiler_pass == 2) { -  yywarning("The *-syntax in types is obsolete. Use array instead."); -  } -  push_type(T_ARRAY); -  } +     ;      type6: type | identifier_type ;    - type: type '*' -  { -  if (Pike_compiler->compiler_pass == 2) { -  yywarning("The *-syntax in types is obsolete. Use array instead."); -  } -  push_type(T_ARRAY); -  } -  | type2 + type: type2    ;    - type7: type7 '*' -  { -  if (Pike_compiler->compiler_pass == 2) { -  yywarning("The *-syntax in types is obsolete. Use array instead."); -  } -  push_type(T_ARRAY); -  } -  | type4 + type7: type4    ;      simple_type: type4
1703:    struct pike_type *type;    node *n;    push_finished_type(Pike_compiler->compiler_frame->current_type); -  if ($1 && (Pike_compiler->compiler_pass == 2)) { -  yywarning("The *-syntax in types is obsolete. Use array instead."); -  } -  while($1--) push_type(T_ARRAY); +     n = Pike_compiler->current_attributes;    while(n) {    push_type_attribute(CDR(n)->u.sval.u.string);
1724:    struct pike_type *type;    node *n;    push_finished_type(Pike_compiler->compiler_frame->current_type); -  if ($1 && (Pike_compiler->compiler_pass == 2)) { -  yywarning("The *-syntax in types is obsolete. Use array instead."); -  } -  while($1--) push_type(T_ARRAY); +     n = Pike_compiler->current_attributes;    while(n) {    push_type_attribute(CDR(n)->u.sval.u.string);
1792:    {    int id;    push_finished_type($<n>0->u.sval.u.type); -  if ($1 && (Pike_compiler->compiler_pass == 2)) { -  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 (id >= 0) {    /* FIXME: Consider using mklocalnode(id, -1). */
1809:    {    int id;    push_finished_type($<n>0->u.sval.u.type); -  if ($1 && (Pike_compiler->compiler_pass == 2)) { -  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 (id >= 0) {    if (!(THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES)) {
2417:    debug_malloc_touch(Pike_compiler->compiler_frame->current_return_type);       push_finished_type($<n>0->u.sval.u.type); -  if ($1 && (Pike_compiler->compiler_pass == 2)) { -  yywarning("The *-syntax in types is obsolete. Use array instead."); -  } -  while($1--) push_type(T_ARRAY); +        if(Pike_compiler->compiler_frame->current_return_type)    free_type(Pike_compiler->compiler_frame->current_return_type);
2566:    }       push_finished_type(Pike_compiler->compiler_frame->current_type); -  if ($3 && (Pike_compiler->compiler_pass == 2)) { -  yywarning("The *-syntax in types is obsolete. Use array instead."); -  } -  while($3--) push_type(T_ARRAY); +     if ($4) {    push_type(T_ARRAY);    }