diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-06-16 16:08:35 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-06-16 16:08:35 -0400 |
| commit | 9f8be0c5029a69bfa9796ac31866658b9da70390 (patch) | |
| tree | 5a9b74da9d766921daa78f9f6557f80facd5ef36 /environment.h | |
| parent | 7dcb5bea3f32f7f122aea323995fe1da55cb8316 (diff) | |
Support library name as a separate environment field from namespace
Diffstat (limited to 'environment.h')
| -rw-r--r-- | environment.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/environment.h b/environment.h index ff411649..7ecedd6f 100644 --- a/environment.h +++ b/environment.h @@ -37,6 +37,7 @@ typedef struct env_s { compilation_unit_t *code; fn_ctx_t *fn_ctx; loop_ctx_t *loop_ctx; + CORD *libname; // Pointer to currently compiling library name (if any) namespace_t *namespace; const char *comprehension_var; } env_t; @@ -49,9 +50,9 @@ typedef struct { }; } binding_t; -env_t *new_compilation_unit(void); +env_t *new_compilation_unit(CORD *libname); env_t *load_module_env(env_t *env, ast_t *ast); -CORD namespace_prefix(namespace_t *ns); +CORD namespace_prefix(CORD *libname, namespace_t *ns); env_t *global_scope(env_t *env); env_t *fresh_scope(env_t *env); env_t *for_scope(env_t *env, ast_t *ast); |
