pub enum Postfix {
Empty,
Function(Arc<str>, Box<Expression>),
Index(Box<Postfix>, Box<Expression>),
Method(Box<Postfix>, Arc<str>, Box<Expression>),
Inference(Arc<Reference>, Box<Expression>),
Critical(Box<Postfix>),
Primary(Box<Primary>),
}Expand description
Postfix expression AST for AIMX.
Captures postfix operations applied after primary expressions, including function calls, indexing, method calls, inference calls, criticalization, and flattened primaries for shallow trees.
Used by parse_postfix and ExpressionLike evaluation.
Variants§
Empty
The empty placeholder _
Function(Arc<str>, Box<Expression>)
Function call with function name and argument expression
Index(Box<Postfix>, Box<Expression>)
Array indexing operation with base and index expressions
Method(Box<Postfix>, Arc<str>, Box<Expression>)
Method call on an object with method name and arguments
Inference(Arc<Reference>, Box<Expression>)
Inference call on a reference and arguments
Critical(Box<Postfix>)
Criticalization on a postfix expression
Primary(Box<Primary>)
Primary flattened AST optimization
Implementations§
Trait Implementations§
Source§impl ExpressionLike for Postfix
impl ExpressionLike for Postfix
Source§fn evaluate(&self, context: &mut dyn ContextLike) -> Result<Arc<Value>>
fn evaluate(&self, context: &mut dyn ContextLike) -> Result<Arc<Value>>
Evaluate postfix expression in context.
Function/method/inference calls are delegated via ContextLike.
Indexing supports arrays and collections; Critical turns Value::Errata
into a CriticalError.
Source§fn to_formula(&self) -> String
fn to_formula(&self) -> String
Return the formula-string representation (round-trippable by the parser).
Source§impl WriterLike for Postfix
impl WriterLike for Postfix
Source§fn to_stringized(&self) -> String
fn to_stringized(&self) -> String
Source§fn to_sanitized(&self) -> String
fn to_sanitized(&self) -> String
Source§fn to_expressionized(&self) -> String
fn to_expressionized(&self) -> String
impl StructuralPartialEq for Postfix
Auto Trait Implementations§
impl Freeze for Postfix
impl RefUnwindSafe for Postfix
impl Send for Postfix
impl Sync for Postfix
impl Unpin for Postfix
impl UnwindSafe for Postfix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.