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
f594984b
Commit
f594984b
authored
Jan 26, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "Empty" syntax predicate that always succeeds without consuming
input.
parent
43410d8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
__init__.py
arpeggio/__init__.py
+9
-1
No files found.
arpeggio/__init__.py
View file @
f594984b
...
...
@@ -317,7 +317,7 @@ class OneOrMore(Repetition):
class
SyntaxPredicate
(
ParsingExpression
):
'''
Base class for all syntax predicates (and, not).
Base class for all syntax predicates (and, not
, empty
).
Predicates are parser expressions that will do the match but will not
consume any input.
'''
...
...
@@ -365,6 +365,14 @@ class Not(SyntaxPredicate):
parser
.
_nm_raise
(
self
.
name
,
self
.
c_pos
,
parser
)
class
Empty
(
SyntaxPredicate
):
'''
This predicate will always succeed without consuming input.
'''
def
_parse
(
self
,
parser
):
pass
class
Match
(
ParsingExpression
):
'''
Base class for all classes that will try to match something from the input.
...
...
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