(path: jsonc.JSONPath, type: NodeType, offset: number, length: number = 0)
| 163 | } |
| 164 | |
| 165 | newNode(path: jsonc.JSONPath, type: NodeType, offset: number, length: number = 0) { |
| 166 | const node: ParseNode = { |
| 167 | id: toPointer(path), |
| 168 | type, |
| 169 | offset, |
| 170 | length, |
| 171 | keyLength: 0, |
| 172 | boundOffset: offset, |
| 173 | boundLength: length, |
| 174 | path, |
| 175 | parent: this.currentParent, |
| 176 | }; |
| 177 | |
| 178 | if (isIterable(node)) { |
| 179 | node.childrenKeys = []; |
| 180 | node.childrenKey2Id = {}; |
| 181 | node.childrenOffset = {}; |
| 182 | node.childrenKeyLength = {}; |
| 183 | } |
| 184 | |
| 185 | this.nodeMap[node.id] = node; |
| 186 | return node; |
| 187 | } |
| 188 | |
| 189 | setValue(node: ParseNode, value: any, offset: number, length: number) { |
| 190 | node.value = value; |
no test coverage detected