mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
handle -ve constants
This commit is contained in:
parent
1fd4590212
commit
1eef491c1c
1 changed files with 8 additions and 4 deletions
|
@ -425,30 +425,34 @@ const
|
||||||
$$->type = ex_float;
|
$$->type = ex_float;
|
||||||
$$->e.float_val = $1;
|
$$->e.float_val = $1;
|
||||||
}
|
}
|
||||||
| STRING_VAL {}
|
| STRING_VAL
|
||||||
{
|
{
|
||||||
$$ = new_expr ();
|
$$ = new_expr ();
|
||||||
$$->type = ex_string;
|
$$->type = ex_string;
|
||||||
$$->e.string_val = $1;
|
$$->e.string_val = $1;
|
||||||
}
|
}
|
||||||
| VECTOR_VAL {}
|
| VECTOR_VAL
|
||||||
{
|
{
|
||||||
$$ = new_expr ();
|
$$ = new_expr ();
|
||||||
$$->type = ex_vector;
|
$$->type = ex_vector;
|
||||||
memcpy ($$->e.vector_val, $1, sizeof ($$->e.vector_val));
|
memcpy ($$->e.vector_val, $1, sizeof ($$->e.vector_val));
|
||||||
}
|
}
|
||||||
| QUATERNION_VAL {}
|
| QUATERNION_VAL
|
||||||
{
|
{
|
||||||
$$ = new_expr ();
|
$$ = new_expr ();
|
||||||
$$->type = ex_quaternion;
|
$$->type = ex_quaternion;
|
||||||
memcpy ($$->e.quaternion_val, $1, sizeof ($$->e.quaternion_val));
|
memcpy ($$->e.quaternion_val, $1, sizeof ($$->e.quaternion_val));
|
||||||
}
|
}
|
||||||
| INT_VAL {}
|
| INT_VAL
|
||||||
{
|
{
|
||||||
$$ = new_expr ();
|
$$ = new_expr ();
|
||||||
$$->type = ex_int;
|
$$->type = ex_int;
|
||||||
$$->e.int_val = $1;
|
$$->e.int_val = $1;
|
||||||
}
|
}
|
||||||
|
| '-' const
|
||||||
|
{
|
||||||
|
$$ = unary_expr ('-', $2);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
Loading…
Reference in a new issue