mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-07 08:21:59 +00:00
fix the conflicts caused by -ve constants
This commit is contained in:
parent
35f5118803
commit
4673d701c9
1 changed files with 10 additions and 6 deletions
|
@ -65,7 +65,7 @@ typedef struct {
|
||||||
|
|
||||||
%type <type> type maybe_func
|
%type <type> type maybe_func
|
||||||
%type <def> param param_list def_item def_list def_name
|
%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 <expr> statement statements statement_block
|
||||||
%type <function> begin_function
|
%type <function> begin_function
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ param
|
||||||
|
|
||||||
opt_initializer
|
opt_initializer
|
||||||
: /*empty*/
|
: /*empty*/
|
||||||
| '=' const
|
| '=' signed_const
|
||||||
{
|
{
|
||||||
if (pr_scope) {
|
if (pr_scope) {
|
||||||
def_t *imm = PR_ReuseConstant ($2, 0);
|
def_t *imm = PR_ReuseConstant ($2, 0);
|
||||||
|
@ -425,6 +425,14 @@ arg_list
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
signed_const
|
||||||
|
: const
|
||||||
|
| '-' const
|
||||||
|
{
|
||||||
|
$$ = unary_expr ('-', $2);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
const
|
const
|
||||||
: FLOAT_VAL
|
: FLOAT_VAL
|
||||||
{
|
{
|
||||||
|
@ -456,10 +464,6 @@ const
|
||||||
$$->type = ex_int;
|
$$->type = ex_int;
|
||||||
$$->e.int_val = $1;
|
$$->e.int_val = $1;
|
||||||
}
|
}
|
||||||
| '-' const
|
|
||||||
{
|
|
||||||
$$ = unary_expr ('-', $2);
|
|
||||||
}
|
|
||||||
;
|
;
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
Loading…
Reference in a new issue