Expand description
lex.toml manifest parsing and package resolution.
A lex.toml file marks a project root and declares its package
dependencies. Import paths of the form "pkg-name/module" are
resolved against this file.
§File format
[package]
name = "lex-web"
version = "0.1.0"
[dependencies]
lex-schema = { path = "../lex-schema" }
# or:
lex-schema = { git = "https://github.com/alpibrusl/lex-schema" }§Module resolution
import "lex-schema/validate" as v splits into pkg = "lex-schema",
module = "validate". The loader:
- Walks up from the importing file to find the nearest
lex.toml. - Looks up
lex-schemain[dependencies]. - For
path =: resolves{dep_path}/src/validate.lex; falls back to{dep_path}/validate.lexifsrc/doesn’t exist. - For
git =: clones the repo into~/.lex/packages/lex-schema/(once; subsequent loads hit the cache), then resolves the same way.
Structs§
Enums§
Functions§
- find_
manifest - Walk up from
start(a file or directory) looking forlex.toml. Returns(toml_path, toml_dir)for the nearest ancestor that has one. - resolve_
package_ import - Resolve
pkg_name/module_pathto a.lexfile on disk.