Skip to main content

par_event_wordcode

Function par_event_wordcode 

Source
pub fn par_event_wordcode() -> usize
Expand description

P9c: wordcode-emission parser entry. Direct port of zsh’s parse_event(int endtok) from Src/parse.c:683-720. Emits a minimal wordcode stream for the parsed program into the live ECBUF thread_local via P9b’s ecadd / ecstrcode API and returns the start index of the emitted Eprog (matching C’s Eprog parse_event(...) return).

Minimal implementation: emits WCB_END() only for now (P9c stub). The full par_event/par_list/par_sublist/par_pipe/par_cmd recursion that walks the token stream and emits the right wordcode for each production is the multi-week rewrite called out in PORT_PLAN.md. This stub establishes the entry point and drives the live ECBUF emission so downstream consumers (P9d exec_wordcode) have a real wordcode buffer to walk.