UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

24 lines (23 loc) 857 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UnaryMinusExpr = void 0; const NumericValue_js_1 = require("../../value/NumericValue.js"); const Expr1_js_1 = require("../Expr1.js"); const ExprKind_js_1 = require("../ExprKind.js"); const Types_js_1 = require("../../type/Types.js"); class UnaryMinusExpr extends Expr1_js_1.Expr1 { constructor(value) { super(ExprKind_js_1.ExprKind.NUM_UNARY_MINUS, value); } calculateResult(ctx, localCtx, subExpressionResult) { return NumericValue_js_1.NumericValue.of(subExpressionResult.getValue().times(-1)); } buildExprString(builder) { builder.appendString("-").appendExpr(this.sub); } getType() { return Types_js_1.Type.NUMERIC; } } exports.UnaryMinusExpr = UnaryMinusExpr; //# sourceMappingURL=UnaryMinusExpr.js.map