Skip to main content

Module parse

Module parse 

Source
Expand description

Parse a LOGOS source string into the arena-allocated AST and hand it to a callback, mirroring the front-end of compile::compile_program_full.

The parser needs a bundle of bumpalo arenas whose lifetimes cannot escape the parsing scope, so access is given through a callback f(&[Stmt], &Interner). Whatever the callback returns (typically a crate::symexec::SymSummary, which holds only owned VerifyExprs) outlives the arenas.

Functionsยง

with_program
Parse source, optionally run the production optimizer, and invoke f with the resulting statements and the interner used to intern their symbols.