ifc-expressions
Version:
Parsing and evaluation of IFC expressions
24 lines (23 loc) • 864 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BinaryBooleanOpExpr = void 0;
const Expr2_js_1 = require("../Expr2.js");
const Types_js_1 = require("../../type/Types.js");
class BinaryBooleanOpExpr extends Expr2_js_1.Expr2 {
constructor(kind, method, left, right) {
super(kind, left, right);
this.method = method;
}
calculateResult(ctx, localCtx, leftOperand, rightOperand) {
return leftOperand[this.method].call(leftOperand, rightOperand);
}
getType() {
if (Types_js_1.Types.isLogical(this.left.getType()) ||
Types_js_1.Types.isLogical(this.right.getType())) {
return Types_js_1.Type.LOGICAL;
}
return Types_js_1.Type.BOOLEAN;
}
}
exports.BinaryBooleanOpExpr = BinaryBooleanOpExpr;
//# sourceMappingURL=BinaryBooleanOpExpr.js.map