2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 6a14734a authored by eckhart's avatar eckhart
Browse files

- fixed doctest and syntaxtree.Node.__str__()

parent 37746fdc
...@@ -277,9 +277,7 @@ class Node(collections.abc.Sized): ...@@ -277,9 +277,7 @@ class Node(collections.abc.Sized):
def __str__(self): def __str__(self):
# s = self._content if self._content is not None else \ s = "".join(str(child) for child in self.children) if self.children else self.content
# "".join(str(child) for child in self.children) if self.children else self.content
s = self.content
if self.errors: if self.errors:
return ' <<< Error on "%s" | %s >>> ' % \ return ' <<< Error on "%s" | %s >>> ' % \
(s, '; '.join(e.message for e in self.errors)) (s, '; '.join(e.message for e in self.errors))
...@@ -838,7 +836,7 @@ def parse_sxpr(sxpr: str) -> Node: ...@@ -838,7 +836,7 @@ def parse_sxpr(sxpr: str) -> Node:
Example: Example:
>>> parse_sxpr("(a (b c))").as_sxpr() >>> parse_sxpr("(a (b c))").as_sxpr()
'(a\\n (b\\n "c"\\n )\\n)' '(a\\n (b\\n "c"\\n )\\n)'
""" """
sxpr = StringView(sxpr).strip() sxpr = StringView(sxpr).strip()
mock_parsers = dict() mock_parsers = dict()
......
#!/bin/sh #!/bin/sh
# CFLAGS="-O3 -march=native -mtune=native" # CFLAGS="-O3 -march=native -mtune=native"
python3 setup.py build_ext --inplace python37 setup.py build_ext --inplace
...@@ -237,7 +237,7 @@ class LaTeXGrammar(Grammar): ...@@ -237,7 +237,7 @@ class LaTeXGrammar(Grammar):
paragraph = Forward() paragraph = Forward()
tabular_config = Forward() tabular_config = Forward()
text_element = Forward() text_element = Forward()
source_hash__ = "79c6f2eaa821f7e92346e0ff24e7c5f8" source_hash__ = "1329c620430169c2cbeff23b05e049c3"
parser_initialization__ = "upon instantiation" parser_initialization__ = "upon instantiation"
COMMENT__ = r'%.*' COMMENT__ = r'%.*'
WHITESPACE__ = r'[ \t]*(?:\n(?![ \t]*\n)[ \t]*)?' WHITESPACE__ = r'[ \t]*(?:\n(?![ \t]*\n)[ \t]*)?'
......
#!/usr/bin/python #!/usr/bin/python
"""Runs the dhparser test-suite with several installed interpreters"""
if __name__ == "__main__": if __name__ == "__main__":
import os import os
...@@ -8,14 +10,15 @@ if __name__ == "__main__": ...@@ -8,14 +10,15 @@ if __name__ == "__main__":
# print("Running nosetests:") # print("Running nosetests:")
# os.system("nosetests test") # os.system("nosetests test")
interpreter = 'python ' interpreters = ['python ', 'pypy3 ', 'python37 ']
# interpreter = r'C:\Users\di68kap\AppData\Local\Programs\Python\Python37-32\python.exe ' # interpreters = [r'C:\Users\di68kap\AppData\Local\Programs\Python\Python37-32\python.exe ']
os.system(interpreter + '--version') for interpreter in interpreters:
os.system(interpreter + '--version')
assert os.getcwd().endswith('test') assert os.getcwd().endswith('test')
files = os.listdir() files = os.listdir()
for filename in files: for filename in files:
if filename.startswith('test_'): if filename.startswith('test_'):
print('\nTEST ' + filename) print('\nTEST ' + filename)
os.system(interpreter + filename) os.system(interpreter + filename)
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