UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

25 lines (24 loc) 722 B
import { ExprEvalErrorObj, ExprEvalStatus, } from "./ExprEvalResult.js"; import { ExprBase } from "./ExprBase.js"; export class LiteralExpr extends ExprBase { constructor(exprKind, value) { super(exprKind); this.value = value; } getChildren() { return []; } evaluate(ctx, localCtx) { try { const result = this.calculateResult(ctx); return this.wrapInResultIfNecessary(result); } catch (error) { return this.handleError(error); } } handleError(error) { return new ExprEvalErrorObj(this.getKind(), ExprEvalStatus.ERROR, error, this.getTextSpan()); } } //# sourceMappingURL=LiteralExpr.js.map