File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed
Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -675,7 +675,7 @@ module.exports = grammar({
675675
676676 as_aliasing : $ => prec . left ( seq (
677677 'as' ,
678- $ . value_identifier ,
678+ $ . _pattern ,
679679 optional ( $ . type_annotation )
680680 ) ) ,
681681
Original file line number Diff line number Diff line change @@ -428,8 +428,8 @@ switch foo {
428428 (variant_identifier)
429429 (formal_parameters
430430 (value_identifier)
431- (as_aliasing (value_identifier))
432- (type_annotation (type_identifier))
431+ (as_aliasing (value_identifier)
432+ (type_annotation (type_identifier)))
433433 (record_pattern
434434 (value_identifier)
435435 (value_identifier))))
@@ -465,8 +465,8 @@ switch foo {
465465 (polyvar_identifier)
466466 (formal_parameters
467467 (value_identifier)
468- (as_aliasing (value_identifier))
469- (type_annotation (type_identifier))
468+ (as_aliasing (value_identifier)
469+ (type_annotation (type_identifier)))
470470 (number)))
471471 (as_aliasing (value_identifier))
472472 (expression_statement (number)))
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ Parameter aliasing
128128===================================================
129129
130130(~xTheGreat as x: int=3) => 5
131+ (~p as (x, _)) => x
131132
132133---
133134
@@ -138,10 +139,22 @@ Parameter aliasing
138139 (parameter
139140 (labeled_parameter
140141 (value_identifier)
141- (as_aliasing (value_identifier))
142- (type_annotation (type_identifier))
142+ (as_aliasing (value_identifier)
143+ (type_annotation (type_identifier)))
143144 (number))))
144- (number))))
145+ (number)))
146+
147+ (expression_statement
148+ (function
149+ (formal_parameters
150+ (parameter
151+ (labeled_parameter
152+ (value_identifier)
153+ (as_aliasing
154+ (tuple_pattern
155+ (tuple_item_pattern (value_identifier))
156+ (tuple_item_pattern (value_identifier)))))))
157+ (value_identifier))))
145158
146159===================================================
147160Record pattern
You can’t perform that action at this time.
0 commit comments