ts-fusion-parser
Version:
Parser for Neos Fusion Files
27 lines (26 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatementList = void 0;
const AbstractNode_1 = require("../../common/AbstractNode");
const VisitableAbstractNode_1 = require("./VisitableAbstractNode");
class StatementList extends VisitableAbstractNode_1.VisitableAbstractNode {
constructor(statements, comments = [], position, parent) {
super(position, parent);
this.statements = [];
this.statements = statements;
for (const statement of this.statements) {
AbstractNode_1.AbstractNode.setParentOfNode(statement, this);
}
this.comments = comments;
for (const comment of this.comments) {
AbstractNode_1.AbstractNode.setParentOfNode(comment, this);
}
}
toString(intend = 0) {
return this.statements.map(statement => statement.toString(intend + 1)).join("\n");
}
visit(visitor) {
return visitor.visitStatementList(this);
}
}
exports.StatementList = StatementList;