Skip to content

Commit 21d858f

Browse files
committed
upgrade rescript syntax
1 parent 7b2a112 commit 21d858f

File tree

4 files changed

+658
-951
lines changed

4 files changed

+658
-951
lines changed

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406616,23 +406616,14 @@ let makePropsExternalSig fnName loc namedArgListWithKeyAndRef propsType =
406616406616
{ psig_loc = loc; psig_desc = Psig_value (makePropsValue fnName loc namedArgListWithKeyAndRef propsType) }
406617406617
[@@raises Invalid_argument]
406618406618

406619-
(* Build an AST node for the props name when converted to a Js.t inside the function signature *)
406619+
(* Build an AST node for the props name when converted to an object inside the function signature *)
406620406620
let makePropsName ~loc name = { ppat_desc = Ppat_var { txt = name; loc }; ppat_loc = loc; ppat_attributes = [] }
406621406621

406622406622
let makeObjectField loc (str, attrs, type_) = Otag ({ loc; txt = str }, attrs, type_)
406623406623

406624-
(* Build an AST node representing a "closed" Js.t object representing a component's props *)
406624+
(* Build an AST node representing a "closed" object representing a component's props *)
406625406625
let makePropsType ~loc namedTypeList =
406626-
Typ.mk ~loc
406627-
(Ptyp_constr
406628-
( { txt = Ldot (Lident "Js", "t"); loc },
406629-
[
406630-
{
406631-
ptyp_desc = Ptyp_object (List.map (makeObjectField loc) namedTypeList, Closed);
406632-
ptyp_loc = loc;
406633-
ptyp_attributes = [];
406634-
};
406635-
] ))
406626+
Typ.mk ~loc (Ptyp_object (List.map (makeObjectField loc) namedTypeList, Closed))
406636406627

406637406628
(* Builds an AST node for the entire `external` definition of props *)
406638406629
let makeExternalDecl fnName loc namedArgListWithKeyAndRef namedTypeList =

0 commit comments

Comments
 (0)