weaveback-macro is the macro-expansion engine at the heart of the weaveback
literate-programming toolchain. It reads a document containing %def /
%set / %if / %rhaidef / %pydef macro calls, evaluates them, and
emits the expanded text.
This page is the crate-level index. It generates lib.rs and links to every
sub-module documented as a literate AsciiDoc source.
Architecture
Modules
| Module | Adoc source | Description |
|---|---|---|
|
Shared vocabulary: |
|
|
Byte-offset → (line, column) via SIMD newline scan |
|
|
DFA tokeniser; emits |
|
|
Recursive-descent parser; builds |
|
|
Arena → tree conversion, serialisation, AST dump |
|
|
Macro expansion engine — see sub-modules below |
|
|
|
|
|
|
|
|
Main eval loop — node dispatch, macro call, freeze/export |
|
|
Built-in dispatch table, case conversion, |
|
|
Rhai and Monty (Python) script back-ends |
|
|
String / file / batch entry points; in==out guard |
|
|
Byte-oriented public API with tracing and precise attribution |
|
CLI binary |
|
lib.rs — crate root
The crate root re-exports the two most commonly used entry types
(Lexer and Parser) at the crate level and declares each module.
File structure
// <<@file weaveback-macro/src/lib.rs>>=
// <<lib preamble>>
// <<lib modules>>
// <<lib reexports>>
// @
Module declarations
// <<lib preamble>>=
// crates/weaveback-macro/src/lib.rs
pub use *;
// @
// <<lib modules>>=
// @
// <<lib reexports>>=
pub use Lexer;
pub use Parser;
// @