32
32
*)
33
33
34
34
type mutable_flag = Js_op .mutable_flag
35
-
36
35
type binop = Js_op .binop
37
-
38
36
type int_op = Js_op .int_op
39
-
40
37
type kind = Js_op .kind
41
-
42
38
type property = Js_op .property
43
-
44
39
type number = Js_op .number
45
-
46
40
type ident_info = Js_op .ident_info
47
-
48
41
type exports = Js_op .exports
49
-
50
42
type tag_info = Js_op .tag_info
51
-
52
43
type property_name = Js_op .property_name
53
44
54
45
type label = string
55
-
56
46
and ident = Ident .t
57
47
(* we override `method ident` *)
58
48
@@ -64,7 +54,6 @@ and ident = Ident.t
64
54
and module_id = { id : ident ; kind : Js_op .kind }
65
55
66
56
and required_modules = module_id list
67
-
68
57
and vident = Id of ident | Qualified of module_id * string option
69
58
(* Since camldot is only available for toplevel module accessors,
70
59
we don't need print `A.length$2`
@@ -83,13 +72,9 @@ and vident = Id of ident | Qualified of module_id * string option
83
72
*)
84
73
85
74
and exception_ident = ident
86
-
87
75
and for_ident = ident
88
-
89
76
and for_direction = Js_op. direction_flag
90
-
91
77
and property_map = (property_name * expression) list
92
-
93
78
and length_object = Js_op. length_object
94
79
95
80
and expression_desc =
@@ -142,13 +127,15 @@ and expression_desc =
142
127
*)
143
128
| New of expression * expression list option (* TODO: option remove *)
144
129
| Var of vident
145
- | Fun of bool * ident list * block * Js_fun_env. t * bool * bool
146
- (* The first parameter by default is false,
147
- it will be true when it's a method
148
- The second-last pararemter [true] return unit
149
- The last pararemter [true] means async
150
- *)
151
- | Str of {delim : string option ; txt : string }
130
+ | Fun of {
131
+ is_method : bool ;
132
+ params : ident list ;
133
+ body : block ;
134
+ env : Js_fun_env .t ;
135
+ return_unit : bool ;
136
+ async : bool ;
137
+ }
138
+ | Str of { delim : string option ; txt : string }
152
139
(* A string is UTF-8 encoded, and may contain
153
140
escape sequences.
154
141
*)
@@ -267,7 +254,6 @@ and case_clause = {
267
254
}
268
255
269
256
and string_clause = string * case_clause
270
-
271
257
and int_clause = int * case_clause
272
258
273
259
and statement_desc =
@@ -276,7 +262,8 @@ and statement_desc =
276
262
(* Function declaration and Variable declaration *)
277
263
| Exp of expression
278
264
| If of expression * block * block
279
- | While of label option * expression * block * Js_closure. t (* check if it contains loop mutable values, happens in nested loop *)
265
+ | While of label option * expression * block * Js_closure. t
266
+ (* check if it contains loop mutable values, happens in nested loop *)
280
267
| ForRange of
281
268
for_ident_expression option
282
269
* finish_ident_expression
@@ -286,8 +273,9 @@ and statement_desc =
286
273
* Js_closure. t
287
274
| Continue of label
288
275
| Break (* only used when inline a fucntion *)
289
- | Return of expression (* Here we need track back a bit ?, move Return to Function ...
290
- Then we can only have one Return, which is not good *)
276
+ | Return of expression
277
+ (* Here we need track back a bit ?, move Return to Function ...
278
+ Then we can only have one Return, which is not good *)
291
279
(* since in ocaml, it's expression oriented langauge, [return] in
292
280
general has no jumps, it only happens when we do
293
281
tailcall conversion, in that case there is a jump.
@@ -305,7 +293,6 @@ and statement_desc =
305
293
| Debugger
306
294
307
295
and expression = { expression_desc : expression_desc ; comment : string option }
308
-
309
296
and statement = { statement_desc : statement_desc ; comment : string option }
310
297
311
298
and variable_declaration = {
@@ -319,7 +306,6 @@ and variable_declaration = {
319
306
be concatenated in both ways
320
307
*)
321
308
and block = statement list
322
-
323
309
and program = { block : block ; exports : exports ; export_set : Set_ident .t }
324
310
325
311
and deps_program = {
0 commit comments