Expand description
§ruitl_compiler
Parser and code generator for the RUITL template language.
This crate is runtime-free: it contains only syn/quote/proc-macro2-based
AST and codegen logic so it can be depended on from both the ruitl runtime
crate and its build.rs without pulling in server-side deps like hyper/tokio.
Re-exports§
pub use codegen::CodeGenerator;pub use error::CompileError;pub use error::Result;pub use parser::Attribute;pub use parser::AttributeValue;pub use parser::ComponentDef;pub use parser::ImportDef;pub use parser::MatchArm;pub use parser::ParamDef;pub use parser::PropDef;pub use parser::PropValue;pub use parser::RuitlFile;pub use parser::RuitlParser;pub use parser::TemplateAst;pub use parser::TemplateDef;
Modules§
- codegen
- RUITL Code Generator
- error
- Error types for the RUITL compiler.
- format
- Pretty-print a parsed
RuitlFileback to canonical.ruitlsource. - parser
- RUITL Template Parser
- suggest
- Fuzzy-match helpers for “did you mean” diagnostics.
Constants§
- CODEGEN_
VERSION - Bumped whenever codegen output changes shape. Used as a cache-buster in
the sibling-file hash header so
cargo buildinvalidates cached output after any codegen.rs change, even if the.ruitlsource is unchanged.
Functions§
- compile_
dir_ sibling - Walk a directory for
.ruitlfiles and compile each into a sibling*_ruitl.rsfile. Also writes a top-levelmod.rsindirthat declares and re-exports each compiled module, so consumers canmod templates;. Returns the list of written output paths. - compile_
file - Compile a single
.ruitlfile to the given output path. - compile_
file_ sibling - Compile a single
.ruitlfile to a sibling*_ruitl.rsfile. - generate
- Generate Rust code (as a formatted string) from a
RuitlFile. - parse_
str - Parse a
.ruitlsource string into aRuitlFileAST.