mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 07:20:50 +00:00
Make it easy to print symbol types.
This commit is contained in:
parent
2904c619c1
commit
3bb8b1b9d2
2 changed files with 19 additions and 0 deletions
|
@ -94,6 +94,8 @@ typedef struct symtab_s {
|
|||
struct defspace_s *space; ///< storage for vars in scope symtabs
|
||||
} symtab_t;
|
||||
|
||||
const char *symtype_str (sy_type_e type);
|
||||
|
||||
/** Create a new, empty named symbol.
|
||||
|
||||
Only the symbol name field will be filled in. \a name will be copied
|
||||
|
|
|
@ -50,6 +50,23 @@
|
|||
static symtab_t *free_symtabs;
|
||||
static symbol_t *free_symbols;
|
||||
|
||||
static const char *sy_type_names[] = {
|
||||
"sy_var",
|
||||
"sy_const",
|
||||
"sy_type",
|
||||
"sy_expr",
|
||||
"sy_func",
|
||||
"sy_class",
|
||||
};
|
||||
|
||||
const char *
|
||||
symtype_str (sy_type_e type)
|
||||
{
|
||||
if (type < 0 || type > sy_class)
|
||||
return "<invalid sy_type>";
|
||||
return sy_type_names[type];
|
||||
}
|
||||
|
||||
symbol_t *
|
||||
new_symbol (const char *name)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue