V0.8 fix for shift/reduce warning

This patch fixes the oversight in the previous patch and eliminated
the shift/reduce warning. Apply it after the previous one.
This commit is contained in:
Cary R 2007-12-29 17:21:41 -08:00 committed by Stephen Williams
parent 83ee7e7988
commit 24b097ce89
1 changed files with 15 additions and 2 deletions

17
parse.y
View File

@ -195,7 +195,7 @@ const static struct str_pair_t str_strength = { PGate::STRONG, PGate::STRONG };
%type <expr> lavalue lpvalue %type <expr> lavalue lpvalue
%type <expr> delay_value delay_value_simple %type <expr> delay_value delay_value_simple
%type <exprs> delay1 delay3 delay3_opt %type <exprs> delay1 delay3 delay3_opt
%type <exprs> expression_list %type <exprs> expression_list expression_list_proper
%type <exprs> assign assign_list %type <exprs> assign assign_list
%type <exprs> range range_opt %type <exprs> range range_opt
@ -929,6 +929,19 @@ expression_list
} }
; ;
expression_list_proper
: expression_list_proper ',' expression
{ svector<PExpr*>*tmp = new svector<PExpr*>(*$1, $3);
delete $1;
$$ = tmp;
}
| expression
{ svector<PExpr*>*tmp = new svector<PExpr*>(1);
(*tmp)[0] = $1;
$$ = tmp;
}
;
expr_primary expr_primary
: number : number
@ -2859,7 +2872,7 @@ statement
delete $1; delete $1;
$$ = tmp; $$ = tmp;
} }
| identifier '(' expression_list ')' ';' | identifier '(' expression_list_proper ')' ';'
{ PCallTask*tmp = new PCallTask(*$1, *$3); { PCallTask*tmp = new PCallTask(*$1, *$3);
tmp->set_file(@1.text); tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line); tmp->set_lineno(@1.first_line);