mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
simplify the type rule
This commit is contained in:
parent
3fe67eecd2
commit
a2bfff5dc4
1 changed files with 17 additions and 15 deletions
|
@ -113,6 +113,7 @@ typedef struct {
|
|||
%token <type> TYPE
|
||||
|
||||
%type <type> type maybe_func
|
||||
%type <integer_val> opt_field
|
||||
%type <def> param param_list def_item def_list def_name
|
||||
%type <expr> const opt_expr expr arg_list
|
||||
%type <expr> statement statements statement_block
|
||||
|
@ -157,28 +158,29 @@ def
|
|||
;
|
||||
|
||||
type
|
||||
: TYPE
|
||||
{
|
||||
current_type = $1;
|
||||
}
|
||||
maybe_func
|
||||
{
|
||||
$$ = $3 ? $3 : $1;
|
||||
}
|
||||
| '.' TYPE
|
||||
: opt_field TYPE
|
||||
{
|
||||
current_type = $2;
|
||||
}
|
||||
maybe_func
|
||||
{
|
||||
type_t new;
|
||||
memset (&new, 0, sizeof (new));
|
||||
new.type = ev_field;
|
||||
new.aux_type = $4 ? $4 : $2;
|
||||
$$ = PR_FindType (&new);
|
||||
{
|
||||
if ($1) {
|
||||
type_t new;
|
||||
memset (&new, 0, sizeof (new));
|
||||
new.type = ev_field;
|
||||
new.aux_type = $4 ? $4 : $2;
|
||||
$$ = PR_FindType (&new);
|
||||
} else {
|
||||
$$ = $4 ? $4 : $2;
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
opt_field
|
||||
: /* empty */ { $$ = 0; }
|
||||
| '.' { $$ = 1; }
|
||||
;
|
||||
|
||||
maybe_func
|
||||
: /* empty */
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue