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))
评论列表
文章目录