aboutsummaryrefslogtreecommitdiff
path: root/src/environment.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-10 14:44:03 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-10 14:44:03 -0400
commit611ebeab13b64d505ad4b44d0f80b3d0e9fb8dba (patch)
treef0edc3737d3e7366aad896355f2f7628bc2d8840 /src/environment.h
parent98cadc2135be65abcf9dff53d87af9ea549757a2 (diff)
Add full protection against accessing fields and methods that start with
underscores outside of the scope where the type is defined.
Diffstat (limited to 'src/environment.h')
-rw-r--r--src/environment.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/environment.h b/src/environment.h
index 2d4e822c..18b749ed 100644
--- a/src/environment.h
+++ b/src/environment.h
@@ -50,6 +50,7 @@ typedef struct env_s {
deferral_t *deferred;
Closure_t *comprehension_action;
bool do_source_mapping:1;
+ type_t *current_type;
} env_t;
typedef struct {
@@ -84,7 +85,7 @@ env_t *namespace_env(env_t *env, const char *namespace_name);
exit(1); \
})
binding_t *get_binding(env_t *env, const char *name);
-binding_t *get_constructor(env_t *env, type_t *t, arg_ast_t *args);
+binding_t *get_constructor(env_t *env, type_t *t, arg_ast_t *args, bool allow_underscores);
PUREFUNC binding_t *get_metamethod_binding(env_t *env, ast_e tag, ast_t *lhs, ast_t *rhs, type_t *ret);
void set_binding(env_t *env, const char *name, type_t *type, Text_t code);
binding_t *get_namespace_binding(env_t *env, ast_t *self, const char *name);