lpeg.setmaxstack

Sets the maximum size for the backtrack stack

Prototype

lpeg.setmaxstack (max)

Description

Sets the maximum size for the backtrack stack used by LPeg to track calls and choices. Most well-written patterns need little backtrack levels and therefore you seldom need to change this maximum; but a few useful patterns may need more space. Before changing this maximum you should try to rewrite your pattern to avoid the need for extra space.

Lua functions

Topics