aboutsummaryrefslogtreecommitdiff
path: root/pc.l
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-07-27 21:08:22 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-07-27 21:08:22 -0400
commit60507214c098beaf3ae01a202e564bfe2f7c8364 (patch)
treef189004a59cf1a19a743469a92f996f7615cdc02 /pc.l
parentd9ba5ec2f86dd69eae4edac586a889fccd8d31b1 (diff)
Add basic scoping
Diffstat (limited to 'pc.l')
-rw-r--r--pc.l8
1 files changed, 5 insertions, 3 deletions
diff --git a/pc.l b/pc.l
index 1a686d3..657f080 100644
--- a/pc.l
+++ b/pc.l
@@ -1,9 +1,11 @@
%{
-
+#include "node.h"
+#include "scope.h"
#include "y.tab.h"
#include "pc.h"
int line_num=1;
+extern scope *cur_scope;
%}
@@ -39,13 +41,13 @@ id [A-Za-z][A-Za-z0-9_]*
"procedure" {
debug_print(PROC, NULL);
- /*s = push_scope(s);*/
+ push_scope(&cur_scope);
return PROC;
}
"function" {
debug_print(FUNC, NULL);
- /*s = push_scope(s);*/
+ push_scope(&cur_scope);
return FUNC;
}