(other: SyntaxTreeNode)
| 265 | } |
| 266 | |
| 267 | public equals(other: SyntaxTreeNode): boolean { |
| 268 | if (this.type !== other.type) { |
| 269 | return false; |
| 270 | } |
| 271 | if (this.allChildren.length !== other.children().length) { |
| 272 | return false; |
| 273 | } |
| 274 | |
| 275 | const areEqual = (first: string | SyntaxTreeNode, second: string | SyntaxTreeNode) => { |
| 276 | if (typeof first !== typeof second) { |
| 277 | return false; |
| 278 | } |
| 279 | if (typeof first === "string" || typeof second === "string") { |
| 280 | return first === second; |
| 281 | } |
| 282 | return first.equals(second); |
| 283 | }; |
| 284 | if (this.allChildren.some((child, index) => !areEqual(child, other.children()[index]))) { |
| 285 | return false; |
| 286 | } |
| 287 | return true; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | function buildSqlxLexer(): { [x: string]: moo.Rules } { |
no test coverage detected