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
834e15e0
Commit
834e15e0
authored
Dec 27, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed old suggestions file.
parent
561ab805
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
42 deletions
+0
-42
src/suggestions.py
src/suggestions.py
+0
-42
No files found.
src/suggestions.py
deleted
100644 → 0
View file @
561ab805
#!/usr/bin/env python
from
parser
import
main
from
node
import
ExpressionLeaf
as
Leaf
from
rules
import
rules
# (node, funcptr, (args...))
def
get_node_possibilities
(
node
):
"""
Get all possible rewrite steps for this node.
"""
op
=
node
.
title
()
possibilities
=
[]
for
key
,
fn
in
rules
.
iteritems
():
if
op
==
key
:
possibilities
+=
fn
(
node
)
return
possibilities
def
get_possibilities
(
node
):
"""
Get all possible rewrite steps for this node and its children.
"""
possibilities
=
get_node_possibilities
(
node
)
if
not
isinstance
(
node
,
Leaf
):
possibilities
+=
[
get_possibilities
(
n
)
for
n
in
node
]
return
possibilities
if
__name__
==
'__main__'
:
node
=
main
()
print
'node:'
,
node
p
=
get_possibilities
(
node
)
print
' p: -------------'
print
'
\
n
'
.
join
(
p
),
print
'----------------'
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