Enum umbra_lang::AST [−][src]
pub enum AST {
Macro {
tokens: Vec<Token>,
},
Container {
token: Token,
children: Vec<AST>,
},
Operator {
token: Token,
lhs: Box<AST>,
rhs: Box<AST>,
},
Value {
token: Token,
},
Empty,
}
Expand description
The parsed representation of a script expression.
Variants
A function call that accepts tokens as arguments.
A collection of other expressions.
An operation between two operands.
A singular value.
Fields of Value
token: Token
The empty AST, used to represent an empty child. Cannot be run.
Implementations
Returns a String
representing the AST
. Not guaranteed to be the same
as the source script.
Parses the Token
stream into a single AST
representing the entire
expression.
Errors
Will return Err
if parse()
on children resulted in an error.
An internal function will error if it’s unable to reduce adjacent ASTs
into a single AST.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for AST
impl UnwindSafe for AST
Blanket Implementations
Mutably borrows from an owned value. Read more