Commit 3b494803 authored by eckhart's avatar eckhart
Browse files

test_ebnf.py: new test case for skipping

parent 0182d8ce
......@@ -56,6 +56,8 @@ if __name__ == "__main__":
interpreters.append('~/.local/bin/python3.9 ')
if os.system('pypy3 -V') == 0:
interpreters.append('pypy3 ')
elif os.system('pypy36 -V') == 0:
interpreters.append('pypy36 ')
elif os.system('pypy -V') == 0:
interpreters.append('pypy ')
print('Interpreters found: ' + ''.join(interpreters))
......
......@@ -692,16 +692,19 @@ class TestErrorRecovery:
grammar = """
@whitespace = vertical
@literalws = right
document = { sentence }+ EOF
@sentence_skip = /\s|(?=\.|$)/
sentence = { word §&continuation }+ "."
continuation = (word | `.` | EOF)
@document_skip = /\s+|(?=$)/
document = { sentence § sentence_continuation }+ EOF
sentence_continuation = &(sentence | EOF)
@sentence_skip = /\s+|(?=\.|$)/
sentence = { word § word_continuation }+ "."
word_continuation = &(word | `.` | EOF)
word = /[A-Za-z]+/~
EOF = !/./
"""
data = "Time is out of joint. Oh cursed spite that I was ever born to set it right."
parser = grammar_provider(grammar)()
st = parser(data)
print(st.as_sxpr())
assert not st.errors, str(st.errors)
data2 = data.replace('cursed', 'cur?ed')
st = parser(data2)
......
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