| 218 | |
| 219 | // Pops the current node if its type matches 'nodeType', invokes 'match', and updates the current node. |
| 220 | pop(nodeType) { |
| 221 | if (this.node.type !== nodeType) |
| 222 | return false; |
| 223 | this.doEvent("onMatch"); |
| 224 | this.node = this.node.prev; |
| 225 | // Keeps down node (node.next) for any field with a primitive value, else drops it (provides no value). |
| 226 | if (!(this.node.type === NodeType.field && this.node.next.type <= NodeType.string)) |
| 227 | this.node.next = undefined; // Drops down node (provides no value). |
| 228 | return true; |
| 229 | } |
| 230 | |
| 231 | // Pushes a new node with the specified type onto the stack and invokes 'setup'. |
| 232 | push(nodeType) { |