summaryrefslogtreecommitdiffstats
path: root/src/front/parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/front/parser.py')
-rw-r--r--src/front/parser.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/front/parser.py b/src/front/parser.py
index 53818bc..8eca7a2 100644
--- a/src/front/parser.py
+++ b/src/front/parser.py
@@ -144,7 +144,8 @@ class Parser:
self.match(Tag.LBRAK)
args = [] if self.token.tag == Tag.RBRAK else self.ident_list()
self.match(Tag.RBRAK, Tag.NEWLINE)
- self.scope.new(name, args)
+ self.scope.new(name)
+ self.scope.add_params(args)
block = self.statement_list()
self.match(Tag.END, Tag.NEWLINE)
return Function(name, args, block, line)
@@ -198,7 +199,7 @@ class Parser:
self.match(Tag.ASSIGNMENT)
exp = self.boolean()
self.match(Tag.NEWLINE)
- self.scope.add(name)
+ self.scope.add_locals(name)
return AssignStatement(name, exp, line)
# program = function_list.