In January 2021 we will introduce a 10 GB quota for project repositories. Higher limits for individual projects will be available on request. Please see https://doku.lrz.de/display/PUBLIC/GitLab for more information.

Commit 1fc8788d authored by eckhart's avatar eckhart

- further cleanups

parent faa86362
......@@ -677,7 +677,7 @@ class Grammar:
cls.parser_initialization__ = "done"
def __init__(self, root: Parser=None) -> None:
def __init__(self, root: Parser = None) -> None:
# if not hasattr(self.__class__, 'parser_initialization__'):
# self.__class__.parser_initialization__ = "pending"
# if not hasattr(self.__class__, 'wspL__'):
......@@ -1023,7 +1023,8 @@ class PreprocessorToken(Parser):
class RegExp(Parser):
"""Regular expression parser.
r"""
Regular expression parser.
The RegExp-parser parses text that matches a regular expression.
RegExp can also be considered as the "atomic parser", because all
......@@ -1068,7 +1069,7 @@ class Whitespace(RegExp):
class RE(Parser):
"""
r"""
Regular Expressions with optional leading or trailing whitespace.
The RE-parser parses pieces of text that match a given regular
......@@ -1096,6 +1097,7 @@ class RE(Parser):
EBNF-Notation: `/ ... /~` or `~/ ... /` or `~/ ... /~`
EBNF-Example: `word = /\w+/~`
"""
def __init__(self, regexp, wL=None, wR=None, name=''):
"""Constructor for class RE.
......@@ -1248,7 +1250,7 @@ class NaryOperator(Parser):
class Option(UnaryOperator):
"""
r"""
Parser `Optional` always matches, even if its child-parser
did not match.
......@@ -1328,7 +1330,7 @@ class ZeroOrMore(Option):
class OneOrMore(UnaryOperator):
"""
r"""
`OneOrMore` applies a parser repeatedly as long as this parser
matches. Other than `ZeroOrMore` which always matches, at least
one match is required by `OneOrMore`.
......@@ -1372,7 +1374,7 @@ class OneOrMore(UnaryOperator):
class Series(NaryOperator):
"""
r"""
Matches if each of a series of parsers matches exactly in the order of
the series.
......@@ -1394,7 +1396,8 @@ class Series(NaryOperator):
L = len(self.parsers)
assert 1 <= L < Series.NOPE, ('Length %i of series exceeds maximum length of %i'
% (L, Series.NOPE))
if mandatory < 0: mandatory += L
if mandatory < 0:
mandatory += L
assert 0 <= mandatory < L or mandatory == Series.NOPE
self.mandatory = mandatory
......
This diff is collapsed.
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