pub fn parse_file(path: &Path) -> Result<IndexMap<String, Element>, MpsError>Expand description
Parses a .mps file into a flat ordered map keyed by dotted ref-path (e.g. “1746000000.1.2”).
Algorithm mirrors Ruby’s Engines::Parser.parse_mps_file_to_elements_hash exactly:
- Wrap file content in a synthetic @mps[]{\n…\n} root.
- Single-pass: at each pos, find the nearest @element[args]{ open and } close.
- Whichever starts earlier wins.
- Open → push stack frame; Close → pop, emit element keyed by dotted ref path.