tree-sitter / tree-sitter-c-sharp

C# Grammar for tree-sitter
MIT License
177 stars 48 forks source link

Fix `record_base` to allow generic types and generic constructor calls #258

Closed tamasvajk closed 1 year ago

tamasvajk commented 1 year ago
// record A<T>();
record B() : A<int>();

produces

(compilation_unit [0, 0] - [1, 22]
  (comment [0, 0] - [0, 16])
  (record_declaration [1, 0] - [1, 22]
    name: (identifier [1, 7] - [1, 8])
    (ERROR [1, 8] - [1, 14]
      (parameter_list [1, 8] - [1, 10])
      (base_list [1, 11] - [1, 14]
        (identifier [1, 13] - [1, 14])))
    type_parameters: (type_parameter_list [1, 14] - [1, 19]
      (type_parameter [1, 15] - [1, 18]
        name: (identifier [1, 15] - [1, 18])))
    parameters: (parameter_list [1, 19] - [1, 21])))
damieng commented 1 year ago

This is an easy fix, I can take it if you want.

tamasvajk commented 1 year ago

This is an easy fix, I can take it if you want.

Awesome, I found this in the errors reported on Roslyn, so it will help in reducing the number of issues there.

damieng commented 1 year ago

When you create an issues if you want to assign yourself to the ones you're working on I can take a look at the others.