ts-fusion-parser
Version:
Parser for Neos Fusion Files
22 lines (21 loc) • 917 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TernaryOperationNode = void 0;
const AbstractNode_1 = require("../../../common/AbstractNode");
const EelNode_1 = require("./EelNode");
class TernaryOperationNode extends EelNode_1.EelNode {
constructor(condition, thenPart, elsePart, position) {
super(position);
this.thenPart = thenPart;
AbstractNode_1.AbstractNode.setParentOfNode(this.thenPart, this);
this.elsePart = elsePart;
AbstractNode_1.AbstractNode.setParentOfNode(this.elsePart, this);
this.condition = condition;
AbstractNode_1.AbstractNode.setParentOfNode(this.condition, this);
this.position = position;
}
toString(intend) {
return `${this.condition.toString()} ? ${this.thenPart.toString()} : ${this.elsePart.toString()}`;
}
}
exports.TernaryOperationNode = TernaryOperationNode;