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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
__init__.py
arpeggio/__init__.py
+7
-9
No files found.
arpeggio/__init__.py
View file @
6304da60
...
...
@@ -186,18 +186,16 @@ class ParsingExpression(object):
# Create terminal or non-terminal if result is not
# 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
isinstance
(
result
,
list
):
if
self
.
root
:
result
=
flatten
(
result
)
if
len
(
result
)
>
1
:
result
=
NonTerminal
(
self
.
rule
,
c_pos
,
result
)
else
:
result
=
result
[
0
]
result
=
flatten
(
result
)
if
len
(
result
)
==
1
:
result
=
result
[
0
]
else
:
result
=
NonTerminal
(
self
.
rule
,
c_pos
,
result
)
else
:
if
self
.
root
:
result
=
NonTerminal
(
self
.
rule
,
c_pos
,
result
)
result
=
NonTerminal
(
self
.
rule
,
c_pos
,
result
)
# Result caching for use by memoization.
self
.
result_cache
[
c_pos
]
=
(
result
,
parser
.
position
)
...
...
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