fix the conflicts caused by -ve constants

This commit is contained in:
Bill Currie 2001-07-06 04:29:12 +00:00
parent 35f5118803
commit 4673d701c9

View file

@ -65,7 +65,7 @@ typedef struct {
%type <type> type maybe_func
%type <def> param param_list def_item def_list def_name
%type <expr> const expr arg_list
%type <expr> signed_const const expr arg_list
%type <expr> statement statements statement_block
%type <function> begin_function
@ -199,7 +199,7 @@ param
opt_initializer
: /*empty*/
| '=' const
| '=' signed_const
{
if (pr_scope) {
def_t *imm = PR_ReuseConstant ($2, 0);
@ -425,6 +425,14 @@ arg_list
}
;
signed_const
: const
| '-' const
{
$$ = unary_expr ('-', $2);
}
;
const
: FLOAT_VAL
{
@ -456,10 +464,6 @@ const
$$->type = ex_int;
$$->e.int_val = $1;
}
| '-' const
{
$$ = unary_expr ('-', $2);
}
;
%%