295295module  E  =  struct 
296296  (*  Value expressions for the core language *) 
297297
298-   let  map_jsx_list  sub  (e  : expression ) : Pt.expression list   = 
298+   let  map_jsx_children  sub  (e  : expression ) : Pt.jsx_children   = 
299299    let  rec  visit  (e  : expression ) : Pt.expression list  = 
300300      match  e.pexp_desc with 
301301      |  Pexp_construct 
@@ -308,7 +308,11 @@ module E = struct
308308        |  Some  e  -> visit e)
309309      |  _  -> [sub.expr sub e]
310310    in 
311-     visit e
311+     match  e.pexp_desc with 
312+     |  Pexp_construct  ({txt =  Longident. Lident  " []" |  Longident. Lident  " ::" 
313+       ->
314+       JSXChildrenItems  (visit e)
315+     |  _  -> JSXChildrenSpreading  (sub.expr sub e)
312316
313317  let  try_map_jsx_prop  (sub  : mapper ) (lbl  : Asttypes.Noloc.arg_label )
314318      (e  : expression ) : Parsetree.jsx_prop option  = 
@@ -340,8 +344,7 @@ module E = struct
340344      match  items with 
341345      |  []  |  [_] -> (List. rev props, None )
342346      |  [(Asttypes.Noloc. Labelled  " children" 
343-         ( List. rev props,
344-           Some  (Parsetree. JSXChildrenItems  (map_jsx_list sub children_expr)) )
347+         (List. rev props, Some  (map_jsx_children sub children_expr))
345348      |  (lbl , e ) :: rest  -> (
346349        match  try_map_jsx_prop sub lbl e with 
347350        |  Some  prop  -> visit (prop :: props) rest
@@ -431,8 +434,7 @@ module E = struct
431434      when  has_jsx_attribute ()  ->
432435      let  attrs =  attrs |>  List. filter (fun  ({txt} , _ ) -> txt <>  " JSX" in 
433436      (*  TODO: support spread *) 
434-       jsx_fragment ~loc  ~attrs  loc.loc_start
435-         (Parsetree. JSXChildrenItems  (map_jsx_list sub e))
437+       jsx_fragment ~loc  ~attrs  loc.loc_start (map_jsx_children sub e)
436438        loc.loc_end
437439    |  Pexp_construct  (lid , arg ) -> (
438440      let  lid1 =  map_loc sub lid in 
0 commit comments