Skip to main content

parse_state

Function parse_state 

Source
pub fn parse_state(input: &str) -> ParseResult<StateFile>
Expand description

Parses raw .agm.state text into a StateFile.

Returns Err(Vec<AgmError>) if any Error-severity diagnostics are produced (missing required headers, bad enum values, duplicate node IDs). Warnings (unknown fields) are returned inside the Ok payload via the diagnostic approach — since ParseResult<StateFile> only carries errors we collect warnings as AgmError with Severity::Warning but still return Ok as long as no errors are present.

To keep the API consistent with the rest of the codebase, warnings are currently accumulated but not returned (they would be returned via a DiagnosticCollection in a higher-level API). Fatal errors always cause Err.