Expand description
Fluent functions for constructing AST nodes program by programmatically.
These functions leverage the From trait implementations defined in ast.rs
to allow users to pass primitive types directly as arguments where an Expr is expected.
Functionsยง
- add
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Addoperator. - and
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Andoperator. - call
- Creates an
Expr::Callnode. - comprehension
- Creates an
Expr::Comprehensionnode (e.g.,list.all(i, i > 0)). - conditional
- Creates an
Expr::Conditionalnode (ternary operator). - div
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Divoperator. - eq
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Eqoperator. - field_
access - Creates an
Expr::FieldAccessnode (e.g.,base.field). - ge
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Geoperator. - gt
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Gtoperator. - has
- Creates an
Expr::Hasmacro node. - ident
- Creates an
Expr::Identifiernode. - in
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Inoperator. - index
- Creates an
Expr::Indexnode (e.g.,base[index]). - le
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Leoperator. - list
- Creates an
Expr::Listnode. - lit
- Creates an
Expr::Literalnode from any type implementingInto<Literal>. - lt
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Ltoperator. - map
- Creates an
Expr::MapLiteralnode. - map_
macro - Creates an
Expr::Mapmacro node. - mul
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Muloperator. - ne
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Neoperator. - neg
- Creates an
Expr::UnaryOpnode with theNegoperator (-). - not
- Creates an
Expr::UnaryOpnode with theNotoperator (!). - null
- Creates an
Expr::Literal(Literal::Null)node. - or
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Oroperator. - rem
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Remoperator. - sub
- Creates an
Expr::BinaryOpnode with theBinaryOperator::Suboperator.