pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:771:    }    arguments close_paren_or_missing    {    int e;       /* Adjust opt_flags in case we've got an optional_constant. */    Pike_compiler->compiler_frame->opt_flags = $4;       /* 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);    Pike_compiler->compiler_frame->current_return_type = compiler_pop_type();       push_finished_type(Pike_compiler->compiler_frame->current_return_type);       e = $<number>9 + $10 - 1;    if(Pike_compiler->varargs &&    (!$<number>9 || (Pike_compiler->num_create_args >= 0)))
pike.git/src/language.yacc:1219:    }    | optional_attributes attribute    {    if ($2) {    Pike_compiler->current_attributes =    mknode(F_ARG_LIST, Pike_compiler->current_attributes, $2);    }    }    ;    - optional_stars: optional_stars '*' { $$=$1 + 1; } -  | /* empty */ { $$=0; } + optional_stars: /* empty */ { $$=0; }    ;      cast: open_paren_with_line_info type ')'    {    struct pike_type *s = compiler_pop_type();    $$ = mktypenode(s);    free_type(s);    COPY_LINE_NUMBER_INFO($$, $1);    free_node ($1);    }
pike.git/src/language.yacc:1244:    {    struct pike_type *s = compiler_pop_type();    $$ = mktypenode(s);    free_type(s);    COPY_LINE_NUMBER_INFO($$, $1);    free_node ($1);    }    ;      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    {    struct pike_type *s = compiler_pop_type();    $$ = mktypenode(s);   #ifdef PIKE_DEBUG    if ($$->u.sval.u.type != s) {    Pike_fatal("mktypenode(%p) created node with %p\n", s, $$->u.sval.u.type);    }
pike.git/src/language.yacc:1696:      name_list: new_name    | name_list ',' new_name    ;      new_name: optional_stars TOK_IDENTIFIER    {    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);    n = CAR(n);    }    type=compiler_pop_type();    define_variable($2->u.sval.u.string, type,    Pike_compiler->current_modifiers);    free_type(type);    free_node($2);    }    | optional_stars bad_identifier {}    | optional_stars TOK_IDENTIFIER '='    {    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);    n = CAR(n);    }    type=compiler_pop_type();    if ((Pike_compiler->current_modifiers & ID_EXTERN) &&    (Pike_compiler->compiler_pass == 1)) {    yywarning("Extern declared variable has initializer.");    }
pike.git/src/language.yacc:1785:    {    free_node($4);    }    ;         new_local_name: optional_stars TOK_IDENTIFIER    {    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). */    $$=mknode(F_ASSIGN,mkintnode(0),mklocalnode(id,0));    } else    $$ = 0;    free_node($2);    }    | 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)) { -  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)) {    /* Only warn about unused initialized variables in strict types mode. */    Pike_compiler->compiler_frame->variable[id].flags |= LOCAL_VAR_IS_USED;    }    $$=mknode(F_ASSIGN,$4,mklocalnode(id,0));    } else    $$ = 0;    free_node($2);
pike.git/src/language.yacc:2410:    struct pike_string *name;    struct pike_type *type;    int id,e;    node *n;    struct identifier *i=0;       /***/    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);    Pike_compiler->compiler_frame->current_return_type=compiler_pop_type();       /***/    push_finished_type(Pike_compiler->compiler_frame->current_return_type);       e=$4-1;    if(Pike_compiler->varargs)
pike.git/src/language.yacc:2559:   create_arg: modifiers type_or_error optional_stars optional_dot_dot_dot TOK_IDENTIFIER    {    struct pike_type *type;    int ref_no;       if (Pike_compiler->num_create_args < 0) {    yyerror("Can't define more variables after ...");    }       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);    }    type=compiler_pop_type();       /* Add the identifier globally.    * Note: Since these are the first identifiers (and references)    * to be added to the program, they will be numbered in    * sequence starting at 0 (zero). This means that the    * counter num_create_args is sufficient extra information