pub fn parse_typedef(input: &str) -> IResult<&str, Typedef>Expand description
Parse a type definition from a string according to the AIM expression grammar syntax.
This function parses type names and array markers to create the appropriate Typedef variant. It supports both basic types and array types.
§Supported Type Names
Any- Wildcard type that matches any valueBool- Boolean typeDate- Date typeNumber- Number typeTask- Task typeText- Text type
§Special Types
Eval- Evaluation typeFormat- Format typeNode- Node type
§Arguments
input- A string slice containing the type definition to parse
§Returns
IResult<&str, Typedef>- A nom result with remaining input and parsed type definition
§Examples
use aimx::typedef::{parse_typedef, Typedef};
assert_eq!(parse_typedef("Bool"), Ok(("", Typedef::Bool)));
assert_eq!(parse_typedef("Number[]"), Ok(("", Typedef::NumberArray)));
assert_eq!(parse_typedef("Text[]"), Ok(("", Typedef::TextArray)));