Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
arpeggio-gm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
backend
arpeggio-gm
Commits
6304da60
Commit
6304da60
authored
Feb 16, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small optimization
parent
4392c896
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
__init__.py
arpeggio/__init__.py
+4
-6
No files found.
arpeggio/__init__.py
View file @
6304da60
...
@@ -186,17 +186,15 @@ class ParsingExpression(object):
...
@@ -186,17 +186,15 @@ class ParsingExpression(object):
# Create terminal or non-terminal if result is not
# Create terminal or non-terminal if result is not
# already a Terminal.
# already a Terminal.
if
result
and
not
isinstance
(
result
,
Terminal
):
if
self
.
root
and
result
and
not
isinstance
(
result
,
Terminal
):
if
parser
.
reduce_tree
:
if
parser
.
reduce_tree
:
if
isinstance
(
result
,
list
):
if
isinstance
(
result
,
list
):
if
self
.
root
:
result
=
flatten
(
result
)
result
=
flatten
(
result
)
if
len
(
result
)
>
1
:
if
len
(
result
)
==
1
:
result
=
NonTerminal
(
self
.
rule
,
c_pos
,
result
)
else
:
result
=
result
[
0
]
result
=
result
[
0
]
else
:
else
:
if
self
.
root
:
result
=
NonTerminal
(
self
.
rule
,
c_pos
,
result
)
else
:
result
=
NonTerminal
(
self
.
rule
,
c_pos
,
result
)
result
=
NonTerminal
(
self
.
rule
,
c_pos
,
result
)
# Result caching for use by memoization.
# Result caching for use by memoization.
...
...
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