UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

20 lines (19 loc) 673 B
import { Expr2 } from "../Expr2.js"; import { NumericValue } from "../../value/NumericValue.js"; import { ExprKind } from "../ExprKind.js"; import { Type } from "../../type/Types.js"; export class PowerExpr extends Expr2 { constructor(left, right) { super(ExprKind.NUM_POWER, left, right); } calculateResult(ctx, localCtx, leftOperand, rightOperand) { return NumericValue.of(leftOperand.getValue().pow(rightOperand.getValue())); } buildExprString(builder) { builder.appendExpr(this.left).appendString(" ^ ").appendExpr(this.right); } getType() { return Type.NUMERIC; } } //# sourceMappingURL=PowerExpr.js.map