Author: Nathan Taylor <[email protected]>
Branch: improved_ebnfparse_error
Changeset: r59595:8b0a39ad3cda
Date: 2012-12-25 10:50 -0700
http://bitbucket.org/pypy/pypy/changeset/8b0a39ad3cda/
Log: added test case
diff --git a/pypy/rlib/parsing/test/test_ebnfparse.py
b/pypy/rlib/parsing/test/test_ebnfparse.py
--- a/pypy/rlib/parsing/test/test_ebnfparse.py
+++ b/pypy/rlib/parsing/test/test_ebnfparse.py
@@ -318,7 +318,7 @@
""")
excinfo = py.test.raises(ValueError, make_parse_function, regexs, rules)
assert "primari" in str(excinfo.value)
-
+
def test_starred_star():
regexs, rules, ToAST = parse_ebnf("""
IGNORE: " ";
@@ -470,3 +470,10 @@
t = ToAST().transform(t)
assert len(t.children) == 6
excinfo = py.test.raises(ParseError, parse, "a")
+
+def test_zero_repetition_production():
+ grammar = """
+IGNORE: " ";
+foo: "A"?;
+"""
+ py.test.raises(AssertionError, parse_ebnf, grammar)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit