UNPKG

phrase-engine

Version:

Language files on steroids for conversational UIs that aren't boring.

39 lines 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const PhraseError_1 = require("./PhraseError"); class PhraseNode { constructor(root, packet) { this.__node_name = this.constructor.name; if (!this.validateNodeName(root.nodeName)) { let err = new PhraseError_1.PhraseError(`Tag name "${root.nodeName}" not supported.`); err.node(root); throw err; } this.init(root, packet); this.__seq(++packet.node_count); } __seq(seq) { this.__node_sequenced_name = `n-${seq}`; } vars(packet) { if (!this.__vared) { this.next().vars(packet); this.__vared = true; } return packet; } count(packet) { return this.next().count(packet); } *gen(packet) { yield packet; } setNextNode(node) { this.__next_node = node; } next() { return this.__next_node; } } exports.PhraseNode = PhraseNode; //# sourceMappingURL=Node.js.map