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
4f3552b4
Commit
4f3552b4
authored
Feb 16, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added check that prevents that multiplication sign is not printed before a negated scope node.
parent
e4a17ba8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
line.py
line.py
+3
-1
tests/test_line.py
tests/test_line.py
+2
-2
No files found.
line.py
View file @
4f3552b4
...
...
@@ -283,11 +283,13 @@ def generate_line(root):
right_paren
=
e
[
1
][
0
]
==
'('
if
(
is_id
(
left
)
or
left_paren
or
is_int
(
left
))
\
and
(
is_id
(
right
)
or
right_paren
):
and
(
(
not
right
.
negated
and
is_id
(
right
)
)
or
right_paren
):
sep
=
''
exp
=
sep
.
join
(
e
)
#if node.negated:
# FIXME: Keep it this way?
if
node
.
negated
and
op
!=
'*'
:
exp
=
'('
+
exp
+
')'
...
...
tests/test_line.py
View file @
4f3552b4
...
...
@@ -50,8 +50,8 @@ class TestLine(unittest.TestCase):
def
test_multiplication_identifiers
(
self
):
a
,
b
=
L
(
'a'
),
L
(
'b'
)
mul
=
N
(
'*'
,
a
,
b
)
self
.
assertEquals
(
generate_line
(
mul
),
'a
b'
)
self
.
assertEquals
(
generate_line
(
N
(
'*'
,
a
,
b
)),
'ab'
)
self
.
assertEquals
(
generate_line
(
N
(
'*'
,
a
,
-
b
)),
'a * -
b'
)
def
test_multiplication_constant_identifier
(
self
):
l0
,
a
=
L
(
2
),
L
(
'a'
)
...
...
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