static struct symbol *
cf_new_symbol(struct sym_scope *scope, pool *p, struct linpool *lp, const byte *c)
{
+ if (scope->readonly)
+ cf_error("Unknown symbol %s", c);
+
struct symbol *s;
uint l = strlen(c);
sym->class = SYM_KEYWORD;
sym->keyword = k;
}
+
+ global_root_scope->readonly = 1;
}
ifs_head = ifs = push_ifs(NULL);
HASH(struct symbol) hash; /* Local symbol hash */
uint slots; /* Variable slots */
- byte active; /* Currently entered */
- byte block; /* No independent stack frame */
byte soft_scopes; /* Number of soft scopes above */
+ byte active:1; /* Currently entered */
+ byte block:1; /* No independent stack frame */
+ byte readonly:1; /* Do not add new symbols */
};
extern struct sym_scope *global_root_scope;