Commit bf0c8576 authored by Eckhart Arnold's avatar Eckhart Arnold
Browse files

Merge branch 'development' of https://gitlab.lrz.de/badw-it/DHParser into development

parents b689adbe a159683e
......@@ -496,6 +496,8 @@ class Parser:
memoization_state = grammar.suspend_memoization__
grammar.suspend_memoization__ = False
grammar.farthest_fail__ = 0
# now, the actual parser call!
try:
node, rest = self._parse_proxy(text)
......
......@@ -164,13 +164,16 @@ class StringView: # collections.abc.Sized
@cython.locals(_len=cython.int)
def __eq__(self, other) -> bool:
"""PERFORMANCE WARNING: This creates copies of the compared string-slices!"""
"""PERFORMANCE WARNING: This create copies of the compared string-slices!"""
# one string copy could be avoided by using find...
# return len(other) == self._len and str(self) == str(other)
_len = self._len
if len(other) == _len:
if _len == 0:
return True
if isinstance(other, StringView) \
and self._text is other._text and self._begin == other._begin:
return True
_fullstring = self._fullstring # type: str
if _fullstring:
return _fullstring == str(other)
......
......@@ -16,9 +16,6 @@
# permissions and limitations under the License.
"""
Module ``syntaxtree`` encapsulates the functionality for creating
and handling syntax-trees. This includes serialization and
......
......@@ -631,7 +631,7 @@ def grammar_suite(directory, parser_factory, transformer_factory,
if not ignore_unknown_filetypes or str(e).find("Unknown") < 0:
raise e
except AssertionError as e:
e.args = ('When processing "%s":\n%s' % (filename, e.args[0]),)
e.args = ('When processing "%s":\n%s' % (filename, e.args[0]) if e.args else '',)
raise e
os.chdir(save_cwd)
error_report = []
......
Supports Markdown
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