mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Fix the parser side of aggregate initializers.
This commit is contained in:
parent
09af401f0c
commit
bc882ddc3c
1 changed files with 16 additions and 1 deletions
|
@ -373,7 +373,22 @@ external_decl
|
|||
spec.storage);
|
||||
}
|
||||
}
|
||||
| var_decl '=' var_initializer
|
||||
| var_decl var_initializer
|
||||
{
|
||||
specifier_t spec = $<spec>0;
|
||||
type_t *type;
|
||||
|
||||
type = find_type (append_type ($1->type, spec.type));
|
||||
if (spec.is_typedef) {
|
||||
error (0, "typedef %s is initialized", $1->name);
|
||||
$1->type = type;
|
||||
$1->sy_type = sy_type;
|
||||
symtab_addsymbol (current_symtab, $1);
|
||||
} else {
|
||||
initialize_def ($1, type, $2, current_symtab->space,
|
||||
spec.storage);
|
||||
}
|
||||
}
|
||||
| function_decl
|
||||
{
|
||||
specifier_t spec = $<spec>0;
|
||||
|
|
Loading…
Reference in a new issue