Skip to main content

Module compiler

Module compiler 

Source
Expand description

Compilation pipeline: source text → Program.

Re-exports§

pub use ast::BinOp;
pub use ast::Expr;
pub use ast::IfBranch;
pub use ast::LineVariant;
pub use ast::Node;
pub use ast::OptionItem;
pub use ast::Stmt;
pub use ast::TextSegment;
pub use ast::UnOp;
pub use lexer::Spanned;
pub use lexer::Token;
pub use lexer::tokenise;
pub use program::Program;
pub use program::VariableDecl;

Modules§

ast
AST types: node/statement types and expression tree - data only, no logic.
expr
Recursive-descent expression parser - turns a source string into an Expr tree.
interpolation
Shared {expr} brace-scanning used by both the compile-time interpolation parser and the runtime translation-template evaluator.
lexer
Logos-based lexer that tokenises .bub source and expression strings.
markup
Scanner for inline markup ([name]…[/name], [name /]) combined with {expr} interpolation. Both are parsed in one left-to-right pass.
program
Program - the compiled output of one or more .bub sources.

Functions§

compile
Compiles a single .bub source string into a Program.
compile_many
Compiles multiple named .bub sources into a single Program.
validate
Validates all jump and detour targets in program refer to existing nodes.