test_parser.py 文件源码

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

项目:SpaghettIDE 作者: Bleu-royal 项目源码 文件源码
def test_recurse_expansion(self):
        """Verify that stack depth doesn't get exceeded on recursive rules marked for expansion."""
        g = Grammar(r"""@start: a | start a ; a : A ; A : 'a' ;""")

        # Force PLY to write to the debug log, but prevent writing it to the terminal (uses repr() on the half-built
        # STree data structures, which uses recursion).
        g._grammar.debug = yacc.NullLogger()

        g.parse("a" * (sys.getrecursionlimit() // 4))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号