Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
graph_drawing
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
graph_drawing
Commits
43e674b5
Commit
43e674b5
authored
Feb 27, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of kompiler.org:python/graph_drawing
parents
f9709555
79a5b196
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
line.py
line.py
+4
-4
No files found.
line.py
View file @
43e674b5
...
@@ -98,7 +98,7 @@ def generate_line(root):
...
@@ -98,7 +98,7 @@ def generate_line(root):
return
'<empty expression>'
return
'<empty expression>'
if
root
.
is_leaf
:
if
root
.
is_leaf
:
return
'-'
*
root
.
negated
+
root
.
title
(
)
return
str
(
root
)
content
=
{}
content
=
{}
...
@@ -197,7 +197,7 @@ def generate_line(root):
...
@@ -197,7 +197,7 @@ def generate_line(root):
# the leafs and nodes in depth first order.
# the leafs and nodes in depth first order.
for
node
in
traverse_depth_first
(
root
):
for
node
in
traverse_depth_first
(
root
):
if
node
.
is_leaf
:
if
node
.
is_leaf
:
content
[
node
]
=
node
.
title
(
)
content
[
node
]
=
str
(
node
)
else
:
else
:
arity
=
len
(
node
)
arity
=
len
(
node
)
...
@@ -209,8 +209,8 @@ def generate_line(root):
...
@@ -209,8 +209,8 @@ def generate_line(root):
else
:
else
:
content
[
node
]
=
construct_function
(
node
)
content
[
node
]
=
construct_function
(
node
)
# Add negations
# Add negations
content
[
node
]
=
'-'
*
node
.
negated
+
content
[
node
]
content
[
node
]
=
'-'
*
node
.
negated
+
content
[
node
]
# Merge binary plus and unary minus signs into binary minus.
# Merge binary plus and unary minus signs into binary minus.
return
content
[
root
].
replace
(
'+ -'
,
'- '
)
return
content
[
root
].
replace
(
'+ -'
,
'- '
)
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