Commit f594984b authored by Igor Dejanovic's avatar Igor Dejanovic

Added "Empty" syntax predicate that always succeeds without consuming

input.
parent 43410d8c
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment