From 60507214c098beaf3ae01a202e564bfe2f7c8364 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sat, 27 Jul 2019 21:08:22 -0400 Subject: Add basic scoping --- pc.l | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pc.l') 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; } -- cgit v1.1