name:
src/main/js/models/nodes/UnaryPercentOperationNode.ts
-rw-r--r--
437
1import { Node } from "./Node";
2import { NodeType } from "./NodeType";
3
4/**
5 * Unary percent operation is essentially division by 100.
6 */
7export class UnaryPercentOperationNode extends Object implements Node {
8 readonly type: NodeType = NodeType.UnaryPercentOperation;
9 readonly operand: Node;
10
11 constructor(operand: Node) {
12 super();
13 this.operand = operand;
14 }
15
16 toString() {
17 return `${this.operand.toString()}%`;
18 }
19}