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 fc8b6bad authored by eckhart's avatar eckhart

parser.py: Grammar.rollback_to__ bugfix: set last rollback location to -1 if...

parser.py: Grammar.rollback_to__ bugfix: set last rollback location to -1 if rollback stack is empty. (How did that happen!?)
parent e3342480
......@@ -971,7 +971,7 @@ class Grammar:
last_rb__loc__: The last, i.e. most advanced location in the text
where a variable changing operation occurred. If the parser
backtracks to a location at or before last_rb__loc__ (i.e.
location <= last_rb__loc__) then a rollback of all variable
location < last_rb__loc__) then a rollback of all variable
changing operations is necessary that occurred after the
location to which the parser backtracks. This is done by
calling method :func:`rollback_to__(location)`.
......@@ -1330,7 +1330,7 @@ class Grammar:
self.document__ = StringView(document)
self.document_length__ = len(self.document__)
self._document_lbreaks__ = linebreaks(document) if self.history_tracking__ else []
self.last_rb__loc__ = -1 # rollback location
# done by reset: self.last_rb__loc__ = -1 # rollback location
result = None # type: Optional[Node]
stitches = [] # type: List[Node]
rest = self.document__
......@@ -1460,7 +1460,7 @@ class Grammar:
# *line_col(self.document__, len(self.document__) - self.last_rb__loc__))
rollback_func()
self.last_rb__loc__ == self.rollback__[-1][0] if self.rollback__ \
else (self.document__.__len__() + 1)
else -1 # (self.document__.__len__() + 1)
def as_ebnf(self) -> str:
......
......@@ -76,7 +76,7 @@ class EBNFGrammar(Grammar):
countable = Forward()
element = Forward()
expression = Forward()
source_hash__ = "fd2cca3a2d036370bd29a19ed5bea8cd"
source_hash__ = "09b88d557e08f59db56613dadff966e3"
anonymous__ = re.compile('pure_elem$|countable$|FOLLOW_UP$|SYM_REGEX$|ANY_SUFFIX$|EOF$')
static_analysis_pending__ = [] # type: List[bool]
parser_initialization__ = ["upon instantiation"]
......
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