Skip to main content

PARSE_STACK_SIZE

Constant PARSE_STACK_SIZE 

Source
pub const PARSE_STACK_SIZE: usize = _ /* 16_777_216usize */;
Expand description

Native stack a thread needs to parse any source the parser accepts.

The parser recurses once per nesting level, and an unoptimized build spends about 140 KiB of stack on each level of nested expressions. Rust’s 2 MiB default thread stack is exhausted after about a dozen levels, long before crate::MAX_NESTING_DEPTH refuses the source.

The size follows the refusal, not the typical program: the parser must be able to reach the nesting limit and report it.