This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree 7 files changed +16
-3
lines changed
parsing/grammar/expressions
7 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ let recordFromProps ~loc ~removeKey callArguments =
188
188
let props, propsToSpread =
189
189
removeLastPositionUnitAux callArguments []
190
190
|> List. rev
191
- |> List. partition (fun (label , _ ) -> label <> labelled " spreadProps " )
191
+ |> List. partition (fun (label , _ ) -> label <> labelled " _spreadProps " )
192
192
in
193
193
let props =
194
194
if removeKey then
Original file line number Diff line number Diff line change @@ -2635,7 +2635,7 @@ and parseJsxProp p =
2635
2635
{e with pexp_attributes = propLocAttr :: e .pexp_attributes}
2636
2636
in
2637
2637
(* using label "spreadProps" to distinguish from others *)
2638
- let label = Asttypes. Labelled " spreadProps " in
2638
+ let label = Asttypes. Labelled " _spreadProps " in
2639
2639
match p.Parser. token with
2640
2640
| Rbrace ->
2641
2641
Parser. next p;
Original file line number Diff line number Diff line change @@ -4129,6 +4129,9 @@ and printJsxProp ~customLayout arg cmtTbl =
4129
4129
| Nolabel -> Doc. nil
4130
4130
| Labelled _lbl -> printIdentLike ident
4131
4131
| Optional _lbl -> Doc. concat [Doc. question; printIdentLike ident])
4132
+ | Asttypes. Labelled "_spreadProps" , expr ->
4133
+ let doc = printExpressionWithComments ~custom Layout expr cmtTbl in
4134
+ Doc. concat [Doc. lbrace; Doc. dotdotdot; Doc. softLine; doc; Doc. rbrace]
4132
4135
| lbl , expr ->
4133
4136
let argLoc, expr =
4134
4137
match expr.pexp_attributes with
Original file line number Diff line number Diff line change @@ -577,4 +577,8 @@ let _ =
577
577
;;(([(((fun a -> 1))[@ns.braces ])])[@JSX ])
578
578
;;(([((span ~children:[] ())[@JSX ])])[@JSX ])
579
579
;;(([[|a|]])[@JSX ])
580
- ;;(([(1, 2)])[@JSX ])
580
+ ;;(([(1, 2)])[@JSX ])
581
+ let _ =
582
+ ((A.createElement ~x:(({js|y|js})[@ns.namedArgLoc ]) ~_spreadProps:((str)
583
+ [@ns.namedArgLoc ]) ~children:[] ())
584
+ [@JSX ])
Original file line number Diff line number Diff line change @@ -513,3 +513,5 @@ let _ = <View style=styles["backgroundImageWrapper"]>
513
513
<> ... <span /> </>
514
514
<> ... [a ] </>
515
515
<> ... (1 , 2 ) </>
516
+
517
+ let _ = <A x = "y" {... str } />
Original file line number Diff line number Diff line change @@ -408,3 +408,5 @@ let v =
408
408
}}
409
409
</B>
410
410
</A>
411
+
412
+ let x = <A x="y" {...str} />
Original file line number Diff line number Diff line change @@ -401,3 +401,5 @@ let v =
401
401
}}
402
402
</B >
403
403
</A >
404
+
405
+ let x = <A x = "y" {... str } />
You can’t perform that action at this time.
0 commit comments