weaveback-core contains shared constants and basic types used by both the
macro expander and the noweb tangle tool. By keeping these here, we ensure
consistency across the entire pipeline without creating a circular dependency
between the macro and tangle crates.
Shared Constants
// <<core-constants>>=
/// Maximum recursion depth for macro expansion and noweb chunk expansion.
pub const MAX_RECURSION_DEPTH: usize = 100;
// @
Path Resolution
PathResolver maps between the two path spaces the toolchain works with:
-
gen paths — keys stored in the database, relative to
gen_dir -
source paths — paths to literate
.adocfiles, relative toproject_root
project_root should be set to the directory containing weaveback.db, which
is also the directory from which weaveback was originally run. Using the db
location (rather than the current working directory) ensures that paths resolve
correctly when subcommands like apply-back are invoked from a different
directory.
// <<core-path>>=
use ;
// @
Assembly
// <<@file weaveback-core/src/lib.rs>>=
// <<core-constants>>
// <<core-path>>
// @