Expand description
Parse Stranded II .inf definition files to generic RON/JSON.
Format-agnostic parser: accepts any key=value syntax and
any xxx=start / xxx=end blocks. No hardcoded block names.
Classification of block contents is automatic:
- All lines parse as
key=value→Structured { fields, sub_blocks } - Otherwise →
Text { content }
§Example
use inf2ron::InfParser;
let entries = InfParser::parse_str(r#"
id=9
name=Meat
group=food
script=start
on:eat { eat 5,20,10,0; }
script=end
"#).unwrap();
assert_eq!(entries.len(), 1);
assert_eq!(entries[0].fields.get("name").unwrap()[0], "Meat");
assert!(entries[0].blocks.contains_key("script"));