Expand description
AST builder DSL AST builder DSL
Re-exports
pub use super::BinOp;
Structs
Functions
make a BinaryExpression
(left
, BinOp::Plus
, right
)
make an ArrayExpression
(vec![v1, v2, ...]
) (JS: [v1, v2, ...]
)
make a BinaryExpression
(left
, op
, right
)
Creates a BlockStatement
from a closure that builds a vector of Statement
s.
make a CallExpression
with callee
and arguments
(JS: callee(arguments...)
)
make an empty ArrayExpression
, JS: []
make an empty ObjectExpression
(JS: {}
)
make a BinaryExpression
(left
, BinOp::EqEq
, right
)
make an Identifier
from name
(JS: name
)
make a computed MemberExpression
(object
, attr
) (JS: object[attr]
)
make a non-computed (i.e. object.attr
) MemberExpression
(object
, attr
)
make a BinaryExpression
(left
, BinOp::Star
, right
)
make a ObjectExpression
(vec![(k1, v1), ...]
) (JS: {k1: v1, ...}
)
make a UnaryExpression
(UnOp::Plus
, expr
)
make a ReturnStatement
make a BinaryExpression
(left
, BinOp::Minus
, right
)
A helper to surround an closure in assert_parse!
macro calls.
Type Definitions
An AST DSL helper to enable Program::try_from(block(|ctx| Ok(...)))
via block