( type: string, children: Parser.SyntaxNode[], )
| 93 | }); |
| 94 | |
| 95 | function createMockSyntaxNode( |
| 96 | type: string, |
| 97 | children: Parser.SyntaxNode[], |
| 98 | ): Parser.SyntaxNode { |
| 99 | // Define minimal properties of SyntaxNode required for the test |
| 100 | const node: Partial<Parser.SyntaxNode> = { |
| 101 | type, |
| 102 | children, |
| 103 | childCount: children.length, |
| 104 | child: (index: number) => { |
| 105 | return children[index] || null; |
| 106 | }, |
| 107 | }; |
| 108 | return node as Parser.SyntaxNode; |
| 109 | } |