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

modified test file to make debugging easier

parent 9bc45ca0
No related branches found
No related tags found
No related merge requests found
...@@ -59,7 +59,9 @@ def makeNodeFromNoTailStatement(parseTree): ...@@ -59,7 +59,9 @@ def makeNodeFromNoTailStatement(parseTree):
elif child.name == 'returnStatement': elif child.name == 'returnStatement':
return ReturnNode(child) return ReturnNode(child)
###########################################################
# end of factory methods
###########################################################
# block # block
# Rules: # Rules:
...@@ -78,6 +80,9 @@ class BlockNode(ASTNode): ...@@ -78,6 +80,9 @@ class BlockNode(ASTNode):
self.children = self.statements self.children = self.statements
# def buildEnv(self, parentEnv):
......
...@@ -40,6 +40,8 @@ def a2Multiple(): ...@@ -40,6 +40,8 @@ def a2Multiple():
testCases = [f.path for f in scandir(testDirectory) if f.is_dir()] testCases = [f.path for f in scandir(testDirectory) if f.is_dir()]
for c in testCases: for c in testCases:
print("**********************************************************")
print("DIRECTORY")
print(c) print(c)
print("**********************************************************") print("**********************************************************")
# get all files in the folder recursively # get all files in the folder recursively
...@@ -104,13 +106,18 @@ def run(testFiles): ...@@ -104,13 +106,18 @@ def run(testFiles):
ASTs = astBuild(parseTrees) ASTs = astBuild(parseTrees)
for (n, t) in ASTs: # for (n, t) in ASTs:
print(n) # print(n)
print("--------------------") # print("--------------------")
t.printTree() # t.printTree()
print("\n \n\n \n") # print("\n \n\n \n")
buildEnvAndLink(ASTs) try:
buildEnvAndLink(ASTs)
except Exception as e:
print("error at environment building and linking")
print(e)
return
print("<<<<------- after buildEnvAndLink -------->>>>>>") print("<<<<------- after buildEnvAndLink -------->>>>>>")
for (n, t) in ASTs: for (n, t) in ASTs:
......
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