test_repeatable.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:parglare 作者: igordejanovic 项目源码 文件源码
def test_repeatable_one_zero_rr_conflicts():
    """
    Check that translations of B+ and B* don't produce R/R conflict.
    """
    grammar = """
    S: A B+ C;
    S: A B* D;
    A:; B:; C:; D:;
    """
    g = Grammar.from_string(grammar, _no_check_recognizers=True)

    # Check if parser construction raises exception
    try:
        Parser(g)
    except RRConflicts:
        pytest.fail("R/R conflicts not expected here.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号