Skip to main content

Crate inf2ron

Crate inf2ron 

Source
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"));

Re-exports§

pub use error::InfError;
pub use error::InfResult;
pub use parser::InfParser;
pub use types::*;

Modules§

cli
error
.inf parsing errors.
parser
Generic stack-based parser for .inf files.
types
Generic data types for .inf file parsing.