Skip to main content

Module parser

Module parser 

Source
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 detected structurally (type ends with “Context”), not by string-searching the entire token stream.
  • Unparseable inner types become RustType::Custom(original_string) instead of silently falling back to String.
  • NaiveTime correctly maps to RustType::LocalTime.

Functions§

parse_project
Parse all Rust source files in a directory and extract schema definitions.