Skip to content

Stabilize parse() with std::expected #269

@K20shores

Description

@K20shores

See #268. Replace UniversalParser/ParserResult with parse(path)/parse(string) returning std::expected<Mechanism, Errors>. Dispatches to the correct version parser (v0, v1, v2), each producing the canonical Mechanism. Structural and semantic errors both reported. development::types::Mechanism becomes mechanism_configuration::Mechanism. ConfigParseStatus renamed to ErrorCode.

Acceptance criteria

  • parse(<filepath>) returns std::expected<Mechanism, Errors> with all errors included
  • .map() and .map_error() compose correctly
  • No caller touches UniversalParser
  • No v0::types or v1::types remain; all parsers target the canonical mechanism types.
  • development::types becomes the canonical type without a version, so it's just a mechanism_configuration::Mehchanism, mechanism_configuration::Arrhenius, etc.

Ideas

  • Semantic checks (species referenced in reactions exist in the species list, etc.) run after parsing
    • These means that two possible paths are parse file -> validate -> mechanism, or in code mechanism -> validate -> mechanism

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions