UNPKG

@akala/core

Version:
37 lines 1.15 kB
import { Expression } from './expression.js'; import { ExpressionType } from './expression-type.js'; /** * Represents an assignment expression. * @template T - The type of the expressions. */ export class AssignmentExpression extends Expression { left; operator; right; /** * Gets the type of the expression. * @returns {ExpressionType.AssignmentExpression} The type of the expression. */ get type() { return ExpressionType.AssignmentExpression; } /** * Initializes a new instance of the AssignExpression class. * @param {T} left - The left expression. * @param {AssignmentOperator} operator - The binary operator. * @param {T} right - The right expression. */ constructor(left, operator, right) { super(); this.left = left; this.operator = operator; this.right = right; } /** * Accepts a visitor. * @param {ExpressionVisitor} visitor - The visitor. * @returns {any} The result of the visit. */ accept(visitor) { return visitor.visitAssign(this); } } //# sourceMappingURL=assignment-expression.js.map