Skip to content
Snippets Groups Projects
Commit f74348dc authored by Xun Yang's avatar Xun Yang
Browse files

import java.lang.* by default

parent 52860a88
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ class CompNode(ASTNode): ...@@ -8,7 +8,7 @@ class CompNode(ASTNode):
def __init__(self, parseTree): def __init__(self, parseTree):
self.parseTree = parseTree self.parseTree = parseTree
self.packageName = '' self.packageName = ''
self.importNames = [] # list of strings representing names getting imported self.importNames = ['java.lang.*'] # all compUnit automatically imports java.lang.*
self.env = None self.env = None
self.typeDcl = None self.typeDcl = None
self.children = [] self.children = []
...@@ -29,6 +29,7 @@ class CompNode(ASTNode): ...@@ -29,6 +29,7 @@ class CompNode(ASTNode):
self.typeDcl = InterNode(typeNode[0]) self.typeDcl = InterNode(typeNode[0])
else: else:
self.typeDcl = ClassNode(typeNode[0]) self.typeDcl = ClassNode(typeNode[0])
# always populate the children list # always populate the children list
self.children.append(self.typeDcl) self.children.append(self.typeDcl)
......
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