[qfcc] Support multiple type specs in type_ref

This is needed for `unsigned int` or `unsigned long` in type
expressions. However, there is a problem where @vector etc complain
about just `unsigned` (which should default to int, of course).
This commit is contained in:
Bill Currie 2024-09-04 09:41:57 +09:00
parent 65fc6054bb
commit 64334759f4

View file

@ -181,6 +181,7 @@ int yylex (YYSTYPE *yylval, YYLTYPE *yylloc);
%type <symbol> generic_param
%type <op> type_func type_op
%type <expr> type_function type_param type_ref
%type <spec> type_ref_spec
%type <expr> generic_type
%type <mut_expr> type_list type_param_list
@ -1250,7 +1251,7 @@ type_list
;
type_ref
: TYPE_SPEC { $$ = new_type_expr ($1.type); }
: type_ref_spec { $$ = new_type_expr ($1.type); }
| CLASS_NAME { $$ = new_type_expr ($1->type); }
| TYPE_NAME
{
@ -1262,6 +1263,11 @@ type_ref
}
;
type_ref_spec
: TYPE_SPEC
| type_ref_spec TYPE_SPEC { $$ = spec_merge ($1, $2); }
;
attribute_list
: attribute
| attribute_list ',' attribute