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
2
Merge Requests
2
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
郭家华
arpeggio-gm
Commits
62080f76
Commit
62080f76
authored
Sep 08, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eolterm propagation fix
parent
96570573
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
__init__.py
arpeggio/__init__.py
+16
-12
No files found.
arpeggio/__init__.py
View file @
62080f76
...
@@ -397,10 +397,11 @@ class ZeroOrMore(Repetition):
...
@@ -397,10 +397,11 @@ class ZeroOrMore(Repetition):
def
_parse
(
self
,
parser
):
def
_parse
(
self
,
parser
):
results
=
[]
results
=
[]
# Remember current eolterm and set eolterm of
if
self
.
eolterm
:
# this repetition
# Remember current eolterm and set eolterm of
old_eolterm
=
parser
.
eolterm
# this repetition
parser
.
eolterm
=
self
.
eolterm
old_eolterm
=
parser
.
eolterm
parser
.
eolterm
=
self
.
eolterm
while
True
:
while
True
:
try
:
try
:
...
@@ -409,8 +410,9 @@ class ZeroOrMore(Repetition):
...
@@ -409,8 +410,9 @@ class ZeroOrMore(Repetition):
except
NoMatch
as
e
:
except
NoMatch
as
e
:
parser
.
position
=
c_pos
# Backtracking
parser
.
position
=
c_pos
# Backtracking
# Restore previous eolterm
if
self
.
eolterm
:
parser
.
eolterm
=
old_eolterm
# Restore previous eolterm
parser
.
eolterm
=
old_eolterm
if
results
:
if
results
:
break
break
...
@@ -428,10 +430,11 @@ class OneOrMore(Repetition):
...
@@ -428,10 +430,11 @@ class OneOrMore(Repetition):
results
=
[]
results
=
[]
first
=
False
first
=
False
# Remember current eolterm and set eolterm of
if
self
.
eolterm
:
# this repetition
# Remember current eolterm and set eolterm of
old_eolterm
=
parser
.
eolterm
# this repetition
parser
.
eolterm
=
self
.
eolterm
old_eolterm
=
parser
.
eolterm
parser
.
eolterm
=
self
.
eolterm
while
True
:
while
True
:
try
:
try
:
...
@@ -441,8 +444,9 @@ class OneOrMore(Repetition):
...
@@ -441,8 +444,9 @@ class OneOrMore(Repetition):
except
NoMatch
:
except
NoMatch
:
parser
.
position
=
c_pos
# Backtracking
parser
.
position
=
c_pos
# Backtracking
# Restore previous eolterm
if
self
.
eolterm
:
parser
.
eolterm
=
old_eolterm
# Restore previous eolterm
parser
.
eolterm
=
old_eolterm
if
not
first
:
if
not
first
:
raise
raise
...
...
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