Skip to main content

parse_program_with_depth

Function parse_program_with_depth 

Source
pub fn parse_program_with_depth(
    src: &str,
    max_depth: usize,
) -> Result<Vec<Sexp>, ParseError>
Expand description

parse_program with the nesting bound supplied by the caller.

The bound is a safety limit, not a dialect: max_depth cannot change what any program means, only whether a pathological one is refused before the stack is at risk. That is why it is a parameter here and MAX_EXPR_DEPTH is only the default — a knob that could alter meaning would belong nowhere near a config file (see blue-lang-cli’s config module for the rule this obeys).