22
22
* along with this program; if not, write to the Free Software
23
23
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
24
24
25
- open Ast_helper
26
-
27
25
(* *
28
26
{[
29
27
Js.undefinedToOption
@@ -44,25 +42,26 @@ let handle_external loc (x : string) : Parsetree.expression =
44
42
pexp_desc =
45
43
Ast_external_mk. local_external_apply loc ~pval_prim: [" #raw_expr" ]
46
44
~pval_type:
47
- (Typ. arrow ~arity: (Some 1 )
48
- {lbl = Nolabel ; typ = Typ. any () }
49
- (Typ. any () ))
45
+ (Ast_helper. Typ. arrow ~arity: (Some 1 )
46
+ {lbl = Nolabel ; typ = Ast_helper. Typ. any () }
47
+ (Ast_helper. Typ. any () ))
50
48
[str_exp];
51
49
}
52
50
in
53
51
let empty =
54
52
(* FIXME: the empty delimiter does not make sense*)
55
- Exp. ident ~loc {txt = Ldot (Ldot (Lident " Js" , " Undefined" ), " empty" ); loc}
53
+ Ast_helper.Exp. ident ~loc
54
+ {txt = Ldot (Ldot (Lident " Js" , " Undefined" ), " empty" ); loc}
56
55
in
57
56
let undefined_typeof =
58
- Exp. ident {loc; txt = Ldot (Lident " Js" , " undefinedToOption" )}
57
+ Ast_helper. Exp. ident {loc; txt = Ldot (Lident " Js" , " undefinedToOption" )}
59
58
in
60
- let typeof = Exp. ident {loc; txt = Ldot (Lident " Js" , " typeof" )} in
59
+ let typeof = Ast_helper. Exp. ident {loc; txt = Ldot (Lident " Js" , " typeof" )} in
61
60
62
61
Ast_compatible. app1 ~loc undefined_typeof
63
- (Exp. ifthenelse ~loc
62
+ (Ast_helper. Exp. ifthenelse ~loc
64
63
(Ast_compatible. app2 ~loc
65
- (Exp. ident ~loc {loc; txt = Lident " ==" })
64
+ (Ast_helper. Exp. ident ~loc {loc; txt = Lident " ==" })
66
65
(Ast_compatible. app1 ~loc typeof raw_exp)
67
66
(Ast_compatible. const_exp_string ~loc " undefined" ))
68
67
empty (Some raw_exp))
@@ -72,8 +71,8 @@ let handle_debugger loc (payload : Ast_payload.t) =
72
71
| PStr [] ->
73
72
Ast_external_mk. local_external_apply loc ~pval_prim: [" %debugger" ]
74
73
~pval_type:
75
- (Typ. arrow ~arity: (Some 1 )
76
- {lbl = Nolabel ; typ = Typ. any () }
74
+ (Ast_helper. Typ. arrow ~arity: (Some 1 )
75
+ {lbl = Nolabel ; typ = Ast_helper. Typ. any () }
77
76
(Ast_literal. type_unit () ))
78
77
[Ast_literal. val_unit ~loc () ]
79
78
| _ ->
@@ -99,9 +98,9 @@ let handle_raw ~kind loc payload =
99
98
pexp_desc =
100
99
Ast_external_mk. local_external_apply loc ~pval_prim: [" #raw_expr" ]
101
100
~pval_type:
102
- (Typ. arrow ~arity: (Some 1 )
103
- {lbl = Nolabel ; typ = Typ. any () }
104
- (Typ. any () ))
101
+ (Ast_helper. Typ. arrow ~arity: (Some 1 )
102
+ {lbl = Nolabel ; typ = Ast_helper. Typ. any () }
103
+ (Ast_helper. Typ. any () ))
105
104
[exp];
106
105
pexp_attributes =
107
106
(match ! is_function with
@@ -152,9 +151,9 @@ let handle_ffi ~loc ~payload =
152
151
pexp_desc =
153
152
Ast_external_mk. local_external_apply loc ~pval_prim: [" #raw_expr" ]
154
153
~pval_type:
155
- (Typ. arrow ~arity: (Some 1 )
156
- {lbl = Nolabel ; typ = Typ. any () }
157
- (Typ. any () ))
154
+ (Ast_helper. Typ. arrow ~arity: (Some 1 )
155
+ {lbl = Nolabel ; typ = Ast_helper. Typ. any () }
156
+ (Ast_helper. Typ. any () ))
158
157
[exp];
159
158
pexp_attributes =
160
159
(match ! is_function with
@@ -171,9 +170,9 @@ let handle_raw_structure loc payload =
171
170
pexp_desc =
172
171
Ast_external_mk. local_external_apply loc ~pval_prim: [" #raw_stmt" ]
173
172
~pval_type:
174
- (Typ. arrow ~arity: (Some 1 )
175
- {lbl = Nolabel ; typ = Typ. any () }
176
- (Typ. any () ))
173
+ (Ast_helper. Typ. arrow ~arity: (Some 1 )
174
+ {lbl = Nolabel ; typ = Ast_helper. Typ. any () }
175
+ (Ast_helper. Typ. any () ))
177
176
[exp];
178
177
}
179
178
| None ->
0 commit comments