Skip to main content

MAX_PAREN_DEPTH

Constant MAX_PAREN_DEPTH 

Source
pub const MAX_PAREN_DEPTH: u16 = 200;
Expand description

Maximum allowed depth of parenthesis / operator recursion.

Each parse level requires two stack frames (parse_expr_climbing + parse_atom). In debug builds these frames are large enough that 1024 levels can overflow the default 8 MB thread stack. 200 keeps the recursive depth ≈ 400 frames, which is safe on every target.