-
-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Labels
Description
Did you check existing issues?
- I have read all the tree-sitter docs if it relates to using the parser
- I have searched the existing issues of tree-sitter-typescript
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
No response
Describe the bug
The TypeScript parser produces an ERROR node when parsing export type * as Name from './module', even though this is valid TypeScript syntax (accepted by the TypeScript compiler without errors).
Steps To Reproduce/Bad Parse Tree
program [0, 0] - [1, 0]
export_statement [0, 0] - [0, 41]
export [0, 0] - [0, 6]
ERROR [0, 7] - [0, 11]
type [0, 7] - [0, 11]
namespace_export [0, 12] - [0, 25]
* [0, 12] - [0, 13]
as [0, 14] - [0, 16]
identifier [0, 17] - [0, 25]
from [0, 26] - [0, 30]
source: string [0, 31] - [0, 41]
' [0, 31] - [0, 32]
string_fragment [0, 32] - [0, 40]
' [0, 40] - [0, 41]
Expected Behavior/Parse Tree
No ERROR node. The type keyword should be recognized as part of the export statement.
Repro
export type * as SomeName from './module'
https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBDAnmYcBUcCGBnOBlCAW2ADlNi4AzKIuAcgDoB6QiAEwFcAbYOgKDhwgA