Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
b142a23c
Commit
b142a23c
authored
Jul 08, 2021
by
di68kap
Browse files
Vorschlagsliste aktualisiert
parent
b893ad31
Changes
2
Show whitespace changes
Inline
Side-by-side
DHParser/parse.py
View file @
b142a23c
...
...
@@ -2819,7 +2819,8 @@ class MandatoryNary(NaryParser):
"""
grammar
=
self
.
_grammar
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 '
)
+
'...'
sym
=
self
.
grammar
.
associated_symbol__
(
self
).
pname
err_msgs
=
self
.
grammar
.
error_messages__
.
get
(
sym
,
[])
...
...
DHParser/syntaxtree.py
View file @
b142a23c
...
...
@@ -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"
# % (self._pos, pos, repr(self)))
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!"
if
self
.
_pos
<
0
:
self
.
_pos
=
pos
...
...
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