pub fn parse_format(input: &str) -> IResult<&str, Value>Expand description
Parses a format value from input text.
This function parses format values according to the AIMX grammar syntax:
"Instruction" <format> "Example1", "Example2", ...
The parser expects:
- Optional whitespace
- A quoted instruction text
- Optional whitespace
- A format specification enclosed in angle brackets
- Optional whitespace
- A comma-separated list of quoted example texts
§Arguments
input- The input string to parse
§Returns
IResult<&str, Value>- A nom result with remaining input and parsed format value
§Examples
use aimx::values::parse_format;
let result = parse_format(r#""Display as currency" <$0.00> "$42.00", "$123.45""#);
assert!(result.is_ok());
let (remaining, format_value) = result.unwrap();
assert!(format_value.is_format());
assert_eq!(remaining, "");See also: crate::values::format::parse_string_array, crate::literals::parse_text, crate::literals::parse_tag