File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -1073,7 +1073,10 @@ module.exports = grammar({
10731073
10741074 decorator_arguments : $ => seq (
10751075 '(' ,
1076- commaSept ( $ . expression ) ,
1076+ choice (
1077+ commaSept ( $ . expression ) ,
1078+ $ . type_annotation
1079+ ) ,
10771080 ')' ,
10781081 ) ,
10791082
Original file line number Diff line number Diff line change @@ -114,3 +114,31 @@ and bar = {bar: int}
114114 (decorator (decorator_identifier))
115115 (type_identifier)
116116 (record_type (record_type_field (property_identifier) (type_annotation (type_identifier))))))))
117+
118+ ============================================
119+ Decorator with type
120+ ============================================
121+
122+ @react.component(:sharedProps)
123+ let make = (~x, ~y) => React.string(x ++ y)
124+
125+ ---
126+
127+ (source_file
128+ (decorated
129+ (decorator
130+ (decorator_identifier)
131+ (decorator_arguments
132+ (type_annotation (type_identifier))))
133+ (let_binding
134+ (value_identifier)
135+ (function
136+ (formal_parameters
137+ (parameter (labeled_parameter (value_identifier)))
138+ (parameter (labeled_parameter (value_identifier))))
139+ (call_expression
140+ (value_identifier_path
141+ (module_identifier) (value_identifier))
142+ (arguments
143+ (binary_expression
144+ (value_identifier) (value_identifier))))))))
You can’t perform that action at this time.
0 commit comments