@akala/core
Version:
41 lines • 1.25 kB
JavaScript
import { Expression } from './expression.js';
import { ExpressionType } from './expression-type.js';
/**
* Represents a call expression.
* @template T
* @template TMethod
* @extends {Expression}
*/
export class CallExpression extends Expression {
source;
method;
optional;
/**
* Gets the type of the expression.
* @returns {ExpressionType.CallExpression} The type of the expression.
*/
get type() { return ExpressionType.CallExpression; }
arguments;
/**
* Creates an instance of CallExpression.
* @param {TypedExpression<T>} source - The source expression.
* @param {TypedExpression<TMethod>} method - The method expression.
* @param {StrictExpressions[]} args - The arguments of the call expression.
*/
constructor(source, method, args, optional) {
super();
this.source = source;
this.method = method;
this.optional = optional;
this.arguments = args;
}
/**
* Accepts a visitor.
* @param {ExpressionVisitor} visitor - The visitor to accept.
* @returns {any} The result of the visitor's visit.
*/
accept(visitor) {
return visitor.visitCall(this);
}
}
//# sourceMappingURL=call-expression.js.map