GenExpr

Trait GenExpr 

Source
pub trait GenExpr: GetSpan {
    // Required method
    fn gen_expr(
        &self,
        p: &mut Codegen<'_>,
        precedence: Precedence,
        ctx: Context,
    );

    // Provided method
    fn print_expr(
        &self,
        p: &mut Codegen<'_>,
        precedence: Precedence,
        ctx: Context,
    ) { ... }
}
Expand description

Generate source code for an expression.

Required Methods§

Source

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Generate code for an expression, respecting operator precedence.

Provided Methods§

Source

fn print_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Generate code for an expression, respecting operator precedence. Alias for gen_expr.

Implementations on Foreign Types§

Source§

impl GenExpr for Expression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for MemberExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for SimpleAssignmentTarget<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for ArrowFunctionExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for AssignmentExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for AwaitExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for BinaryExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for CallExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for ChainExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for ComputedMemberExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, _precedence: Precedence, ctx: Context)

Source§

impl GenExpr for ConditionalExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for ImportExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for LogicalExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for NewExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for ObjectExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, _precedence: Precedence, ctx: Context)

Source§

impl GenExpr for ParenthesizedExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for PrivateFieldExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, _precedence: Precedence, ctx: Context)

Source§

impl GenExpr for PrivateInExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for SequenceExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for StaticMemberExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, _precedence: Precedence, ctx: Context)

Source§

impl GenExpr for UnaryExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for UpdateExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for V8IntrinsicExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for YieldExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, _ctx: Context)

Source§

impl GenExpr for BigIntLiteral<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, _ctx: Context)

Source§

impl GenExpr for NumericLiteral<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for TSAsExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for TSInstantiationExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for TSNonNullExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for TSSatisfiesExpression<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Source§

impl GenExpr for TSTypeAssertion<'_>

Source§

fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)

Implementors§