Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 0e90dfe0 authored by Eckhart Arnold's avatar Eckhart Arnold
Browse files

- test for whitespace handling added

parent 60800f1c
......@@ -257,6 +257,7 @@ def parser_factory(ebnf_src: str, branding="DSL") -> Grammar:
"""
grammar_src = compileDSL(ebnf_src, nil_scanner, get_ebnf_grammar(),
get_ebnf_transformer(), get_ebnf_compiler(branding))
print(grammar_src)
return compile_python_object(DHPARSER_IMPORTS + grammar_src, 'get_(?:\w+_)?grammar$')
......
......@@ -707,6 +707,15 @@ class RE(Parser):
class Token(RE):
"""Class Token parses simple strings. Any regular regular
expression commands will be interpreted as simple sequence of
characters.
Other than that class Token is essentially a renamed version of
class RE. Because tokens often have a particular semantic different
from other REs, parsing them with a separate parser class allows to
distinguish them by their parser type.
"""
assert TOKEN_PTYPE == ":Token"
def __init__(self, token: str, wL=None, wR=None, name: str = '') -> None:
......
......@@ -274,6 +274,32 @@ class TestPopRetrieve:
syntax_tree.log("test_PopRetrieve_multi_line.cst")
class TestWhitespaceHandling:
minilang = """@testing = True
doc = A B
A = "A"
B = "B"
Rdoc = ar br
ar = /A/
br = /B/
"""
def setup(self):
self.gr = parser_factory(self.minilang)()
def test_token_whitespace(self):
st = self.gr("AB", 'doc')
assert not st.error_flag
st = self.gr("A B", 'doc')
assert not st.error_flag
def test_regexp_whitespace(self):
st = self.gr("AB", 'Rdoc')
assert not st.error_flag
st = self.gr("A B", 'Rdoc')
assert st.error_flag
if __name__ == "__main__":
from DHParser.testing import runner
runner("", globals())
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