Expand description
Rust source code parser for extracting FORGE schema definitions.
Parses Rust source files using syn to extract model, enum, and function
definitions without requiring compilation.
Key design decisions:
- Context arguments are matched against
KNOWN_CONTEXT_TYPES, a fixed list of the 8 Forge context types. User-defined types likeAppContextare not accidentally skipped. Result<T, E>extraction usessyn::TypePathrecursion, handling arbitrarily nested generics.- Unparseable inner types become
RustType::Custom(original_string)instead of silently falling back toString. NaiveTimecorrectly maps toRustType::LocalTime.
Structs§
- Parse
Outcome - Schema registry plus file-level parse failures from
parse_project.
Functions§
- find_
duplicate_ handlers - Scan a source directory and return every
(kind, name)pair that appears in more than one file. Map key is"kind:name", value is the list of file paths. - parse_
project - validate_
registry - Validate every function uses types the emitters support.