Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs444
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xun Yang
cs444
Commits
63084429
Commit
63084429
authored
5 years ago
by
pycsham
Browse files
Options
Downloads
Patches
Plain Diff
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
!5
Name disambig
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AstBuilding.py
+1
-1
1 addition, 1 deletion
AstBuilding.py
NameNode.py
+1
-8
1 addition, 8 deletions
NameNode.py
with
2 additions
and
9 deletions
AstBuilding.py
+
1
−
1
View file @
63084429
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
NameNode.py
+
1
−
8
View file @
63084429
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment