Skip to main content

init_parse_status

Function init_parse_status 

Source
pub fn init_parse_status()
Expand description

Initialize parser status. Direct port of zsh/Src/parse.c:491 init_parse_status. Clears the per-parse-call lexer flags so a fresh parse starts from cmd-position with no nesting state inherited from a prior parse.

Previously the Rust port omitted inrepeat_ = 0 at c:501. inrepeat_ is the repeat N <body> parse-state counter that the lexer toggles in 3 phases (1 → 2 → 3 → 0). Without the reset, a fresh parse called after an in-flight repeat command would inherit the stale counter and silently misread the next token as a body of an already-completed repeat.