diff options
author | Maria Matejka <mq@ucw.cz> | 2022-07-13 14:14:37 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-07-13 14:14:37 +0200 |
commit | 68a2c9d4c91a36c90a768926495f7894324287c5 (patch) | |
tree | 996387a4741746aa1c5cad1d238b886cfe7620d6 /conf/conf.h | |
parent | af0d5ec2797bab2a928fa8ce2caf81608a3f7443 (diff) | |
parent | 2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f (diff) |
Merge commit '2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f' into thread-next
Diffstat (limited to 'conf/conf.h')
-rw-r--r-- | conf/conf.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/conf/conf.h b/conf/conf.h index 4ccaa54e..8b2e2dea 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -136,7 +136,8 @@ struct sym_scope { HASH(struct symbol) hash; /* Local symbol hash */ uint slots; /* Variable slots */ - int active; /* Currently entered */ + byte active; /* Currently entered */ + byte soft_scopes; /* Number of soft scopes above */ }; extern struct sym_scope *global_root_scope; @@ -202,6 +203,9 @@ struct symbol *cf_get_symbol(const byte *c); struct symbol *cf_default_name(char *template, int *counter); struct symbol *cf_localize_symbol(struct symbol *sym); +static inline int cf_symbol_is_local(struct symbol *sym) +{ return (sym->scope == conf_this_scope) && !conf_this_scope->soft_scopes; } + /** * cf_define_symbol - define meaning of a symbol * @sym: symbol to be defined @@ -225,6 +229,9 @@ struct symbol *cf_localize_symbol(struct symbol *sym); void cf_push_scope(struct symbol *); void cf_pop_scope(void); +void cf_push_soft_scope(void); +void cf_pop_soft_scope(void); + char *cf_symbol_class_name(struct symbol *sym); /* Parser */ |