Skip to main content

Module parser

Module parser 

Source
Expand description

JavaScript parser: token stream → AST.

Recursive descent with precedence climbing for binary operators. Automatic Semicolon Insertion is applied at statement boundaries using the newline_before flag the lexer records on every token. Arrow functions are detected at assignment level by looking ahead for => after a parameter list. Template-literal ${...} fields are re-parsed here from the raw source the lexer captured.

Functions§

parse
Parse a complete JS program into a statement list. Inline rust { ... } FFI blocks are desugared to __rust_compile(...) calls before lexing.