Commit b142a23c authored by di68kap's avatar di68kap
Browse files

Vorschlagsliste aktualisiert

parent b893ad31
...@@ -2819,7 +2819,8 @@ class MandatoryNary(NaryParser): ...@@ -2819,7 +2819,8 @@ class MandatoryNary(NaryParser):
""" """
grammar = self._grammar grammar = self._grammar
location = grammar.document_length__ - len(text_) location = grammar.document_length__ - len(text_)
err_node.with_pos(location) err_node._pos = -1 # bad hack to avoid error in case position is re-set
err_node.with_pos(location) # for testing artifacts
found = text_[:10].replace('\n', '\\n ') + '...' found = text_[:10].replace('\n', '\\n ') + '...'
sym = self.grammar.associated_symbol__(self).pname sym = self.grammar.associated_symbol__(self).pname
err_msgs = self.grammar.error_messages__.get(sym, []) err_msgs = self.grammar.error_messages__.get(sym, [])
......
...@@ -1307,7 +1307,8 @@ class Node: # (collections.abc.Sized): Base class omitted for cython-compatibil ...@@ -1307,7 +1307,8 @@ class Node: # (collections.abc.Sized): Base class omitted for cython-compatibil
# assert self._pos < 0 or self.pos == pos, ("pos mismatch %i != %i at Node: %s" # assert self._pos < 0 or self.pos == pos, ("pos mismatch %i != %i at Node: %s"
# % (self._pos, pos, repr(self))) # % (self._pos, pos, repr(self)))
if pos != self._pos >= 0: if pos != self._pos >= 0:
raise AssertionError("Position value cannot be reassigned to a different value!") raise AssertionError(f"Position value {self._pos} cannot be "
f"reassigned to a different value ({pos})!")
assert pos >= 0, "Negative value %i not allowed!" assert pos >= 0, "Negative value %i not allowed!"
if self._pos < 0: if self._pos < 0:
self._pos = pos self._pos = pos
......
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