tree-sitter / tree-sitter-c-sharp

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

Support `scoped` as identifier name #275

Closed tamasvajk closed 1 year ago

tamasvajk commented 1 year ago

Commit-by-commit review is advised.

This PR is adding support for scoped as identifier name. I had to somewhat rework the parameter rule, which previously allowed parameter modifiers without a parameter type. I found it somewhat odd that parameters can be declared without a type, but that's the case in lambdas, such as System.Func<int, int, object> l = (i, j) => null;, and also in the rare case of __arglist. I don't think parameter modifiers could be used in such cases.

I have no systematic way of finding issues regarding contextual keywords (such as the issue fixed in the last commit), so there might be other cases too, when scoped doesn't work as an identifier.

tamasvajk commented 1 year ago

@damieng I've rebased this PR, and updated the file-sizes.txt.