Commit d2b145ff authored by Tom Niget's avatar Tom Niget

Add Scope.declare_local

parent ae2d8da7
...@@ -65,8 +65,9 @@ class Scope: ...@@ -65,8 +65,9 @@ class Scope:
self.children.append(res) self.children.append(res)
return res return res
def declare_local(self, name: str): def declare_local(self, name: str, type: BaseType):
"""Declares a local variable""" """Declares a local variable"""
self.vars[name] = VarDecl(VarKind.LOCAL, type)
def get(self, name: str) -> Optional[VarDecl]: 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