Skip to content

Commit a2f017f

Browse files
committed
Format Tast_iterator
1 parent 45a319b commit a2f017f

File tree

2 files changed

+63
-62
lines changed

2 files changed

+63
-62
lines changed

compiler/ml/tast_iterator.ml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,34 @@ open Asttypes
1717
open Typedtree
1818

1919
type iterator = {
20-
case : iterator -> case -> unit;
21-
cases : iterator -> case list -> unit;
22-
env : iterator -> Env.t -> unit;
23-
expr : iterator -> expression -> unit;
24-
extension_constructor : iterator -> extension_constructor -> unit;
25-
module_binding : iterator -> module_binding -> unit;
26-
module_coercion : iterator -> module_coercion -> unit;
27-
module_declaration : iterator -> module_declaration -> unit;
28-
module_expr : iterator -> module_expr -> unit;
29-
module_type : iterator -> module_type -> unit;
30-
module_type_declaration : iterator -> module_type_declaration -> unit;
31-
package_type : iterator -> package_type -> unit;
32-
pat : iterator -> pattern -> unit;
33-
row_field : iterator -> row_field -> unit;
34-
object_field : iterator -> object_field -> unit;
35-
signature : iterator -> signature -> unit;
36-
signature_item : iterator -> signature_item -> unit;
37-
structure : iterator -> structure -> unit;
38-
structure_item : iterator -> structure_item -> unit;
39-
typ : iterator -> core_type -> unit;
40-
type_declaration : iterator -> type_declaration -> unit;
41-
type_declarations : iterator -> rec_flag * type_declaration list -> unit;
42-
type_extension : iterator -> type_extension -> unit;
43-
type_kind : iterator -> type_kind -> unit;
44-
value_binding : iterator -> value_binding -> unit;
45-
value_bindings : iterator -> rec_flag * value_binding list -> unit;
46-
value_description : iterator -> value_description -> unit;
47-
with_constraint : iterator -> with_constraint -> unit;
20+
case: iterator -> case -> unit;
21+
cases: iterator -> case list -> unit;
22+
env: iterator -> Env.t -> unit;
23+
expr: iterator -> expression -> unit;
24+
extension_constructor: iterator -> extension_constructor -> unit;
25+
module_binding: iterator -> module_binding -> unit;
26+
module_coercion: iterator -> module_coercion -> unit;
27+
module_declaration: iterator -> module_declaration -> unit;
28+
module_expr: iterator -> module_expr -> unit;
29+
module_type: iterator -> module_type -> unit;
30+
module_type_declaration: iterator -> module_type_declaration -> unit;
31+
package_type: iterator -> package_type -> unit;
32+
pat: iterator -> pattern -> unit;
33+
row_field: iterator -> row_field -> unit;
34+
object_field: iterator -> object_field -> unit;
35+
signature: iterator -> signature -> unit;
36+
signature_item: iterator -> signature_item -> unit;
37+
structure: iterator -> structure -> unit;
38+
structure_item: iterator -> structure_item -> unit;
39+
typ: iterator -> core_type -> unit;
40+
type_declaration: iterator -> type_declaration -> unit;
41+
type_declarations: iterator -> rec_flag * type_declaration list -> unit;
42+
type_extension: iterator -> type_extension -> unit;
43+
type_kind: iterator -> type_kind -> unit;
44+
value_binding: iterator -> value_binding -> unit;
45+
value_bindings: iterator -> rec_flag * value_binding list -> unit;
46+
value_description: iterator -> value_description -> unit;
47+
with_constraint: iterator -> with_constraint -> unit;
4848
}
4949

5050
let structure sub {str_items; str_final_env; _} =
@@ -171,7 +171,9 @@ let expr sub {exp_extra; exp_desc; exp_env; _} =
171171
| Texp_variant (_, expo) -> Option.iter (sub.expr sub) expo
172172
| Texp_record {fields; extended_expression; _} ->
173173
Array.iter
174-
(function _, Kept _ -> () | _, Overridden (_, exp) -> sub.expr sub exp)
174+
(function
175+
| _, Kept _ -> ()
176+
| _, Overridden (_, exp) -> sub.expr sub exp)
175177
fields;
176178
Option.iter (sub.expr sub) extended_expression
177179
| Texp_field (exp, _, _) -> sub.expr sub exp
@@ -358,4 +360,4 @@ let default_iterator =
358360
value_bindings;
359361
value_description;
360362
with_constraint;
361-
}
363+
}

compiler/ml/tast_iterator.mli

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,35 @@ Allows the implementation of typed tree inspection using open recursion
2020
open Asttypes
2121
open Typedtree
2222

23-
type iterator =
24-
{
25-
case: iterator -> case -> unit;
26-
cases: iterator -> case list -> unit;
27-
env: iterator -> Env.t -> unit;
28-
expr: iterator -> expression -> unit;
29-
extension_constructor: iterator -> extension_constructor -> unit;
30-
module_binding: iterator -> module_binding -> unit;
31-
module_coercion: iterator -> module_coercion -> unit;
32-
module_declaration: iterator -> module_declaration -> unit;
33-
module_expr: iterator -> module_expr -> unit;
34-
module_type: iterator -> module_type -> unit;
35-
module_type_declaration: iterator -> module_type_declaration -> unit;
36-
package_type: iterator -> package_type -> unit;
37-
pat: iterator -> pattern -> unit;
38-
row_field: iterator -> row_field -> unit;
39-
object_field: iterator -> object_field -> unit;
40-
signature: iterator -> signature -> unit;
41-
signature_item: iterator -> signature_item -> unit;
42-
structure: iterator -> structure -> unit;
43-
structure_item: iterator -> structure_item -> unit;
44-
typ: iterator -> core_type -> unit;
45-
type_declaration: iterator -> type_declaration -> unit;
46-
type_declarations: iterator -> (rec_flag * type_declaration list) -> unit;
47-
type_extension: iterator -> type_extension -> unit;
48-
type_kind: iterator -> type_kind -> unit;
49-
value_binding: iterator -> value_binding -> unit;
50-
value_bindings: iterator -> (rec_flag * value_binding list) -> unit;
51-
value_description: iterator -> value_description -> unit;
52-
with_constraint: iterator -> with_constraint -> unit;
53-
}
23+
type iterator = {
24+
case: iterator -> case -> unit;
25+
cases: iterator -> case list -> unit;
26+
env: iterator -> Env.t -> unit;
27+
expr: iterator -> expression -> unit;
28+
extension_constructor: iterator -> extension_constructor -> unit;
29+
module_binding: iterator -> module_binding -> unit;
30+
module_coercion: iterator -> module_coercion -> unit;
31+
module_declaration: iterator -> module_declaration -> unit;
32+
module_expr: iterator -> module_expr -> unit;
33+
module_type: iterator -> module_type -> unit;
34+
module_type_declaration: iterator -> module_type_declaration -> unit;
35+
package_type: iterator -> package_type -> unit;
36+
pat: iterator -> pattern -> unit;
37+
row_field: iterator -> row_field -> unit;
38+
object_field: iterator -> object_field -> unit;
39+
signature: iterator -> signature -> unit;
40+
signature_item: iterator -> signature_item -> unit;
41+
structure: iterator -> structure -> unit;
42+
structure_item: iterator -> structure_item -> unit;
43+
typ: iterator -> core_type -> unit;
44+
type_declaration: iterator -> type_declaration -> unit;
45+
type_declarations: iterator -> rec_flag * type_declaration list -> unit;
46+
type_extension: iterator -> type_extension -> unit;
47+
type_kind: iterator -> type_kind -> unit;
48+
value_binding: iterator -> value_binding -> unit;
49+
value_bindings: iterator -> rec_flag * value_binding list -> unit;
50+
value_description: iterator -> value_description -> unit;
51+
with_constraint: iterator -> with_constraint -> unit;
52+
}
5453

55-
val default_iterator: iterator
54+
val default_iterator : iterator

0 commit comments

Comments
 (0)