tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
361 stars 108 forks source link

Tolerate trailing commas in tuple types #143

Closed mjambon closed 3 years ago

mjambon commented 3 years ago

The following code should parse correctly:

type tuple = [ number, ]

but it currently gives us:

(program
  (type_alias_declaration
    (type_identifier)
    (tuple_type (predefined_type) (ERROR))))

typescript playground