aboutsummaryrefslogtreecommitdiffstats
path: root/prism/prism.c
diff options
context:
space:
mode:
Diffstat (limited to 'prism/prism.c')
-rw-r--r--prism/prism.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/prism/prism.c b/prism/prism.c
index 7adc4c38d7..2bef8e3e47 100644
--- a/prism/prism.c
+++ b/prism/prism.c
@@ -654,14 +654,22 @@ pm_arguments_validate_block(pm_parser_t *parser, pm_arguments_t *arguments, pm_b
// Generate a scope node from the given node.
void
-pm_scope_node_init(pm_node_t *node, pm_scope_node_t *scope) {
+pm_scope_node_init(const pm_node_t *node, pm_scope_node_t *scope, pm_scope_node_t *previous, pm_parser_t *parser) {
scope->base.type = PM_SCOPE_NODE;
scope->base.location.start = node->location.start;
scope->base.location.end = node->location.end;
- scope->ast_node = node;
+ scope->previous = previous;
+ scope->parser = parser;
+ scope->ast_node = (pm_node_t *)node;
scope->parameters = NULL;
scope->body = NULL;
+ scope->constants = NULL;
+ if (previous) {
+ scope->constants = previous->constants;
+ }
+ scope->index_lookup_table = NULL;
+
pm_constant_id_list_init(&scope->locals);
switch (PM_NODE_TYPE(node)) {