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
d2dfccad
Commit
d2dfccad
authored
Jun 11, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better debug and error reporting. Few spelling fixes.
parent
74003628
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
__init__.py
arpeggio/__init__.py
+6
-4
No files found.
arpeggio/__init__.py
View file @
d2dfccad
...
...
@@ -62,8 +62,9 @@ class NoMatch(Exception):
self
.
_up
=
True
def
__str__
(
self
):
return
"Expected
%
s at position
%
s."
%
(
self
.
rule
,
str
(
self
.
parser
.
pos_to_linecol
(
self
.
position
)))
return
"Expected '{}' at position {} => '{}'."
.
format
(
self
.
rule
,
str
(
self
.
parser
.
pos_to_linecol
(
self
.
position
)),
self
.
parser
.
context
(
position
=
self
.
position
))
def
flatten
(
_iterable
):
...
...
@@ -203,7 +204,7 @@ class ParsingExpression(object):
return
result
#TODO: _nm_change_rule should be called from every parser expression parse
# method that can potentialy be the root parser rule.
# method that can potential
l
y be the root parser rule.
def
_nm_change_rule
(
self
,
nm
,
parser
):
"""
Change rule for the given NoMatch object to a more generic if
...
...
@@ -262,6 +263,7 @@ class Repetition(ParsingExpression):
Base class for all repetition-like parser expressions (?,*,+)
"""
class
Optional
(
Repetition
):
"""
Optional will try to match parser expression specified buy will not fail in
...
...
@@ -431,7 +433,7 @@ class Match(ParsingExpression):
comments
.
append
(
parser
.
comments_model
.
parse
(
parser
))
parser
.
_skip_ws
()
except
NoMatch
:
# If comment match successfull try terminal match again
# If comment match successfull
y
try terminal match again
if
comments
:
match
=
self
.
_parse
(
parser
)
match
.
comments
=
NonTerminal
(
'comment'
,
self
.
c_pos
,
...
...
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