Skip to main content

MAX_NESTING

Constant MAX_NESTING 

Source
pub const MAX_NESTING: usize = 100;
Expand description

How deeply a program may nest, counted as the nesting depth of its JSON form (every expression node is one level, a block is two).

serde_json refuses documents nested deeper than 127 levels; capping programs below that, identically in both front ends (and in Program::compile), guarantees that every program one front end accepts the other accepts too, and bounds the parser’s and the interpreter’s recursion on hostile input.