mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Make enum values visible.
Put them in the current symbol table as well as the enum symbol table. The latter is really just for keeping track of what values are in the enum.
This commit is contained in:
parent
2860a8b28b
commit
d54a96e68a
1 changed files with 6 additions and 0 deletions
|
@ -153,6 +153,7 @@ start_enum (symbol_t *sym)
|
|||
void
|
||||
add_enum (symbol_t *enm, symbol_t *name, expr_t *val)
|
||||
{
|
||||
symbol_t *sym;
|
||||
type_t *enum_type = enm->type;
|
||||
symtab_t *enum_tab;
|
||||
int value;
|
||||
|
@ -175,8 +176,13 @@ add_enum (symbol_t *enm, symbol_t *name, expr_t *val)
|
|||
else
|
||||
value = expr_integer (val);
|
||||
}
|
||||
name->s.value.type = ev_integer;
|
||||
name->s.value.v.integer_val = value;
|
||||
symtab_addsymbol (enum_tab, name);
|
||||
sym = new_symbol_type (name->name, name->type);
|
||||
sym->sy_type = sy_const;
|
||||
sym->s.value = name->s.value;
|
||||
symtab_addsymbol (enum_tab->parent, sym);
|
||||
}
|
||||
|
||||
symbol_t *
|
||||
|
|
Loading…
Reference in a new issue