pub enum Ast {
Show 15 variants
NullLiteral,
BooleanLiteral(bool),
FloatLiteral(f64),
IntegerLiteral(i64),
IdentifierLiteral(String),
StringLiteral(String),
ListLiteral(Vec<AstMeta>),
FunctionCall(Box<AstMeta>, Vec<AstMeta>),
BinaryExpression(Opcode, Box<AstMeta>, Box<AstMeta>),
IndexExpression(Vec<AstMeta>),
BracketIndex(Box<AstMeta>),
PositiveUnary(Box<AstMeta>),
NegativeUnary(Box<AstMeta>),
NotUnary(Box<AstMeta>),
PreprocessorStatement(Box<AstMeta>, Vec<AstMeta>),
}Expand description
A list of possible AST expressions.
Variants§
NullLiteral
BooleanLiteral(bool)
A boolean literal, either true or false.
FloatLiteral(f64)
A 64-bit floating point number literal.
IntegerLiteral(i64)
A 64-bit integer literal.
IdentifierLiteral(String)
An identifier literal.
StringLiteral(String)
A string literal.
ListLiteral(Vec<AstMeta>)
A literal array of items, such as [item1, 2, 3, true, false].
FunctionCall(Box<AstMeta>, Vec<AstMeta>)
A function call with the given arguments.
BinaryExpression(Opcode, Box<AstMeta>, Box<AstMeta>)
A binary expression with two operands.
1 + 1IndexExpression(Vec<AstMeta>)
An expression made with an unlimited amount of indexes, for example,
item1["item2"].item3[item4()]
BracketIndex(Box<AstMeta>)
An index for an IndexExpression that may contain something other than an identifier.
item1["BracketIndexHere"]PositiveUnary(Box<AstMeta>)
This is caused by using the + operator at the start of an operand, such as +10.
NegativeUnary(Box<AstMeta>)
This is caused by using the - operator at the start of an operand, such as -10.
NotUnary(Box<AstMeta>)
Negates a logical expression, the ! operator. For example, (!1 == 1).
PreprocessorStatement(Box<AstMeta>, Vec<AstMeta>)
A preprocessor statement with a given name and arguments.