aboutsummaryrefslogtreecommitdiff
path: root/pc.y
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-10-07 23:59:11 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-10-08 22:33:49 -0400
commite11eda53660f19bcbcede3bb25b09a71363cef21 (patch)
treeef8eb830df6620bbf0a5c29b4ae643ef6d3ed1e1 /pc.y
parenteee77999764131bd35ce2c471d32cd0b6e85f598 (diff)
Add scope based stack offsets for variables
Diffstat (limited to 'pc.y')
-rw-r--r--pc.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/pc.y b/pc.y
index 23b3b24..3753cdf 100644
--- a/pc.y
+++ b/pc.y
@@ -133,6 +133,7 @@ id_list
check_id(cur_scope, $1);
tmp = scope_insert(cur_scope, $1);
+ tmp->offset = cur_scope->offset++;
$$ = mkid(tmp);
}
|id_list ',' ID
@@ -141,6 +142,7 @@ id_list
check_id(cur_scope, $3);
tmp = scope_insert(cur_scope, $3);
+ tmp->offset = cur_scope->offset++;
$$ = mktree(LIST, $1, mkid(tmp));
}
;