In January 2021 we will introduce a 10 GB quota for project repositories. Higher limits for individual projects will be available on request. Please see https://doku.lrz.de/display/PUBLIC/GitLab for more information.

Commit 511ec92a authored by di68kap's avatar di68kap

- better testing of lookaheads

parent 92513cc4
DHParser Version 0.8.4 (pending)
................................
- lookahead parsers can now be unit-tested
DHParser Version 0.8.3 (20.8.2018)
..................................
......
......@@ -718,6 +718,7 @@ class Grammar:
last_record = self.history__[-2] if len(self.history__) > 1 else []
if last_record and parser != self.root__ \
and last_record.status == HistoryRecord.MATCH \
and last_record.node.pos + len(last_record.node) >= len(self.document__) \
and any(isinstance(parser, Lookahead)
for parser in last_record.call_stack):
error_msg = 'Parser did not match except for lookahead! ' + err_info
......
......@@ -274,9 +274,12 @@ class TestLookahead:
fail_cases = {
"category": {
"match": {
1: """Mountains: b""", # stop sign ":" is missing
1: """Mountains: b""", # stop sign ":" is missing
2: """Rivers:
# not allowed"""
# not allowed""",
2: """Mountains:
K2
Rivers:""" # lookahead only covers K2
},
"fail": {
1: """Mountains: big:
......
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