Commit d12286eb authored by Tom Niget's avatar Tom Niget

Add Scope.declare_local

parent 1c590c5d
......@@ -65,8 +65,9 @@ class Scope:
self.children.append(res)
return res
def declare_local(self, name: str):
def declare_local(self, name: str, type: BaseType):
"""Declares a local variable"""
self.vars[name] = VarDecl(VarKind.LOCAL, type)
def get(self, name: str) -> Optional[VarDecl]:
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment