Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Anonymous parameters in using clauses #215

Merged
merged 1 commit into from
May 22, 2023

Conversation

susliko
Copy link
Collaborator

@susliko susliko commented May 21, 2023

Problem

$.parameters required each param to have a name, so using clauses like def x(using X =:= X) failed to parse

Solution

Introduce $._using_parameters_clause, which allows anonymous parameters

Resolves #187

Problem
-------
`$.parameters` required each param to have a name, so `using` clauses like
`def x(using X =:= X)` failed to parse

Solution
-------
Introduce `$._using_parameters_clause`, which allows anonymous parameters
parameter: $ => seq(
repeat($.annotation),
optional($.inline_modifier),
field('name', $._identifier),
optional(seq(':', field('type', $._param_type))),
':',
field('type', $._param_type),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type annotation for parameters shouldn't be optional

Copy link
Collaborator

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @susliko!

@eed3si9n eed3si9n merged commit 2d0e6b8 into tree-sitter:master May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generalized type constraints not handled properly
2 participants