pub fn parse_event(endtok: i32) -> Option<ZshProgram>Expand description
Top-level parse-event entry. Direct port of zsh/Src/parse.c:
612-631 parse_event. Reads one event from the lexer (a
sublist optionally followed by SEPER/AMPER/AMPERBANG) and
returns the resulting ZshProgram.
endtok is the token that terminates the event — usually
ENDINPUT, but for command-style substitutions the closing
) (zsh’s CMD_SUBST_CLOSE).
zshrs port note: zsh’s parse_event returns an Eprog (heap-
allocated wordcode program). zshrs returns a ZshProgram
(AST root). Same role at the parse-output boundary.