aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compile.c4
-rw-r--r--src/environment.c8
-rw-r--r--src/environment.h1
3 files changed, 3 insertions, 10 deletions
diff --git a/src/compile.c b/src/compile.c
index e5d0e0ec..5809c670 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -2427,7 +2427,9 @@ CORD compile_arguments(env_t *env, ast_t *call_ast, arg_t *spec_args, arg_ast_t
{
Table_t used_args = {};
CORD code = CORD_EMPTY;
- env_t *default_scope = namespace_scope(env);
+ env_t *default_scope = new(env_t);
+ *default_scope = *env;
+ default_scope->locals = new(Table_t, .fallback=env->namespace_bindings ? env->namespace_bindings : env->globals);
for (arg_t *spec_arg = spec_args; spec_arg; spec_arg = spec_arg->next) {
int64_t i = 1;
// Find keyword:
diff --git a/src/environment.c b/src/environment.c
index 05ebed5a..db17da94 100644
--- a/src/environment.c
+++ b/src/environment.c
@@ -577,14 +577,6 @@ env_t *load_module_env(env_t *env, ast_t *ast)
return module_env;
}
-env_t *namespace_scope(env_t *env)
-{
- env_t *scope = new(env_t);
- *scope = *env;
- scope->locals = new(Table_t, .fallback=env->namespace_bindings ? env->namespace_bindings : env->globals);
- return scope;
-}
-
env_t *fresh_scope(env_t *env)
{
env_t *scope = new(env_t);
diff --git a/src/environment.h b/src/environment.h
index a89935e6..a508c967 100644
--- a/src/environment.h
+++ b/src/environment.h
@@ -63,7 +63,6 @@ env_t *load_module_env(env_t *env, ast_t *ast);
CORD namespace_name(env_t *env, namespace_t *ns, CORD name);
CORD get_id_suffix(const char *filename);
env_t *get_namespace_by_type(env_t *env, type_t *t);
-env_t *namespace_scope(env_t *env);
env_t *fresh_scope(env_t *env);
env_t *for_scope(env_t *env, ast_t *ast);
env_t *with_enum_scope(env_t *env, type_t *t);