ifc-expressions
Version:
Parsing and evaluation of IFC expressions
29 lines (28 loc) • 904 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LiteralExpr = void 0;
const ExprEvalResult_js_1 = require("./ExprEvalResult.js");
const ExprBase_js_1 = require("./ExprBase.js");
class LiteralExpr extends ExprBase_js_1.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 ExprEvalResult_js_1.ExprEvalErrorObj(this.getKind(), ExprEvalResult_js_1.ExprEvalStatus.ERROR, error, this.getTextSpan());
}
}
exports.LiteralExpr = LiteralExpr;
//# sourceMappingURL=LiteralExpr.js.map