maat_module 0.11.3

Module system and multi-file compilation for the Maat programming language
Documentation

Module resolution, dependency graph construction, and multi-module compilation for the Maat compiler.

This crate builds a directed acyclic graph (DAG) of module dependencies before compilation begins. Each reachable source file is parsed independently, cycle detection is performed via DFS with gray/black coloring, and the final graph provides a topological ordering suitable for compilation.

File Resolution

Resolution follows Rust's module conventions:

  • Root entry files and mod.maat files resolve submodules in their own directory: mod foo; in dir/mod.maat resolves to dir/foo.maat or dir/foo/mod.maat.
  • All other files resolve submodules in a subdirectory named after the file stem: mod bar; in dir/foo.maat resolves to dir/foo/bar.maat or dir/foo/bar/mod.maat.

If both foo.maat and foo/mod.maat exist, the resolution is ambiguous and an error is produced. If neither exists, a resolution error is produced.