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

Add a field name for bound identifiers #139

Merged
merged 1 commit into from
Mar 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@ function generate_pattern_matching_rule(
: generate_case_pattern($, allows_binding);
var expression_pattern = allows_expressions
? $._expression
: $.simple_identifier;
: field("bound_identifier", $.simple_identifier);
var all_patterns = always_allowed_patterns
.concat(binding_pattern_if_allowed)
.concat(case_pattern)
Expand Down
1 change: 1 addition & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
(type_parameter (type_identifier) @parameter)
(inheritance_constraint (identifier (simple_identifier) @parameter))
(equality_constraint (identifier (simple_identifier) @parameter))
(non_binding_pattern bound_identifier: (simple_identifier)) @variable

[
"typealias"
Expand Down