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
b31467af
Commit
b31467af
authored
Jan 08, 2012
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of kompiler.org:trs
parents
2ac45d25
ee3de873
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
external/graph_drawing
external/graph_drawing
+1
-1
src/node.py
src/node.py
+3
-4
No files found.
graph_drawing
@
fa7bed92
Subproject commit
591a3e65e0c08a4e9d316faee92dc3bd58b3dd8
6
Subproject commit
fa7bed9265f59c6ff2375c17c2df4be735d54f6
6
src/node.py
View file @
b31467af
...
...
@@ -137,7 +137,7 @@ class ExpressionBase(object):
return
ExpressionNode
(
'^'
,
self
,
to_expression
(
other
))
def
__neg__
(
self
):
return
ExpressionNode
(
'-'
,
to_expression
(
self
)
)
return
ExpressionNode
(
'-'
,
self
)
class
ExpressionNode
(
Node
,
ExpressionBase
):
...
...
@@ -205,7 +205,7 @@ class ExpressionNode(Node, ExpressionBase):
# r e
#
# rule: c * r ^ e | (r ^ e) * c
for
i
,
j
in
[(
0
,
1
),
(
1
,
0
)]
:
for
i
,
j
in
((
0
,
1
),
(
1
,
0
))
:
if
self
[
j
].
is_power
():
return
(
self
[
i
],
self
[
j
][
0
],
self
[
j
][
1
])
...
...
@@ -242,8 +242,7 @@ class ExpressionLeaf(Leaf, ExpressionBase):
self
.
type
=
TYPE_MAP
[
type
(
args
[
0
])]
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
int
)
or
isinstance
(
other
,
float
)
\
or
isinstance
(
other
,
str
):
if
type
(
other
)
in
(
int
,
float
,
str
):
return
self
.
value
==
other
if
other
.
is_leaf
():
...
...
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