Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
42b050ef
Commit
42b050ef
authored
May 17, 2012
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validation now iterates over best possibilities instead of best indices.
parent
d67e91b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
src/possibilities.py
src/possibilities.py
+1
-0
src/validation.py
src/validation.py
+7
-5
No files found.
src/possibilities.py
View file @
42b050ef
...
...
@@ -122,6 +122,7 @@ def pick_best_possibility(parser, possibilities):
def
traverse_breadth_first
(
node
,
result
,
depth
=
0
):
if
depth
>
MAX_TREE_DEPTH
:
print
'warning: Aborting because MAX_TREE_DEPTH is reached.'
return
node_expr
=
str
(
node
)
...
...
src/validation.py
View file @
42b050ef
...
...
@@ -18,16 +18,18 @@ def validate(exp, result):
node_expr
=
str
(
node
)
possibilities
=
find_possibilities
(
node
)
# If a best possibility chain of rewrite steps is discovered before,
# use the corresponding possibility index of that chain instead.
if
node_expr
in
BEST_POSSIBILITY_CACHE
:
p
ossibility_index
=
BEST_POSSIBILITY_CACHE
[
node_expr
]
p
=
BEST_POSSIBILITY_CACHE
[
node_expr
]
# If there is no possible rewrite step, bail out
if
p
ossibility_index
is
None
:
if
p
is
None
:
return
False
possibilities
=
[
possibility_index
]
else
:
possibilities
=
find_possibilities
(
node
)
possibilities
=
possibilities
[
p
]
for
p
in
possibilities
:
# Clone the root node because it will be used in multiple
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment