diff --git a/grammar.js b/grammar.js index bb0cde2..e75396a 100644 --- a/grammar.js +++ b/grammar.js @@ -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) diff --git a/queries/highlights.scm b/queries/highlights.scm index 76f2881..9109cae 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -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"