#ifndef APFL_SCOPE_H #define APFL_SCOPE_H #ifdef __cplusplus extern "C" { #endif #include "gc.h" #include "hashmap.h" #include "value.h" struct scope { struct apfl_hashmap map; }; struct scope *apfl_scope_new(struct gc *); void apfl_scope_deinit(struct apfl_allocator, struct scope *); bool apfl_scope_get(struct scope *, struct apfl_string *name, struct apfl_value *out); bool apfl_scope_has(struct scope *, struct apfl_string *name); bool apfl_scope_set(struct gc *, struct scope *, struct apfl_string *name, struct apfl_value value); bool apfl_scope_create_var(struct gc *, struct scope *, struct apfl_string *name); bool apfl_scope_update_existing(struct scope *, struct apfl_string *, struct apfl_value); bool apfl_scope_merge_into(struct scope *self, struct scope *other); #ifdef __cplusplus } #endif #endif