Expand description
Variable reference parsing for the AIMX language.
This module provides the core functionality for parsing variable references in AIMX expressions. References are used to access values from the evaluation context and can represent simple identifiers or chained property accessors.
§Reference Types
- Simple Identifiers: Single variable names like
variableor$inference - Chained Accessors: Dot-separated references like
object.propertyorobject.property.method - Inference Calls: References prefixed with
$that are used for AI inference
§Examples
use aimx::expressions::reference::{Reference, parse_reference};
// Parse simple identifier
let (_, reference) = parse_reference("variable").unwrap();
assert_eq!(reference.to_string(), "variable");
// Parse chained property access
let (_, reference) = parse_reference("object.property").unwrap();
assert_eq!(reference.to_string(), "object.property");
// Parse inference call (note the $ is stripped during parsing)
let (_, reference) = parse_reference("$workflow.inference").unwrap();
assert_eq!(reference.to_string(), "workflow.inference");Enums§
- Reference
- Represents a variable reference in an AIMX expression.
Functions§
- parse_
identifier - Parse an identifier according to JSON language specification.
- parse_
reference - Parse a reference chain: identifier (accessor identifier)*