Skip to content
Snippets Groups Projects
Commit 63084429 authored by pycsham's avatar pycsham
Browse files

fixed bug where disambig name was called twice on name node. passes 95% A2 test cases.

parent eae4a5e3
No related branches found
No related tags found
1 merge request!5Name disambig
......@@ -55,7 +55,7 @@ def disamiguateAndTypeChecking(ASTs):
# t[1].recurseAction("disambigName")
# except Exception as e:
# raise e
t[1].recurseAction("disambigName")
t[1].disambigName()
# type checking
......
......@@ -64,8 +64,6 @@ class NameNode(ASTNode):
def checkLocalVar(self):
if not self.IDs:
return True
print("checking local variable")
print(self.IDs)
ID = self.IDs[0]
localVarNode = self.env.findNode(ID, "expr")
if localVarNode:
......@@ -79,8 +77,6 @@ class NameNode(ASTNode):
def checkContains(self, update=False):
if not self.IDs:
return True
print("checking contains set")
print(self.IDs)
ID = self.IDs[0]
if self.env.findNode(ID, "fieldDcl") or self.env.findNode(ID, "method"):
......@@ -136,12 +132,9 @@ class NameNode(ASTNode):
# Checking if a1 is a local variable
if self.checkLocalVar():
print("local variable check is true")
print(self.IDs)
return
# TODO: Checking if a1 is in the contains set
# We shoudln't resolve it at this stage (i.e. shouldn't link the prefix to an AST node yet)
# Checking if a1 is in contains set
if self.checkContains():
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment