Skip to content

Commit 9254df9

Browse files
committed
Cleanup
1 parent 671f520 commit 9254df9

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

jscomp/syntax/src/res_parsetree_viewer.ml

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
open Parsetree
22

3-
let attrs_string attrs =
4-
List.map (fun (attr, _) -> print_endline attr.Asttypes.txt) attrs
5-
6-
let ident_string ident =
7-
match ident with
8-
| Longident.Lident v -> v
9-
| Longident.Ldot (_, v) -> v
10-
| Longident.Lapply _ -> "Lapply"
11-
12-
let print_ct ct =
13-
match ct with
14-
| {ptyp_desc = Ptyp_constr (ident, _); ptyp_attributes = attrs} ->
15-
let _ =
16-
print_endline
17-
("Ptyp_constr: " ^ ident_string ident.txt ^ " attrs: "
18-
^ string_of_int (List.length attrs))
19-
in
20-
let _ = attrs_string attrs in
21-
()
22-
| {ptyp_desc = Ptyp_arrow _; ptyp_attributes = attrs} ->
23-
print_endline
24-
("Ptyp_arrow: " ^ " attrs: " ^ string_of_int (List.length attrs))
25-
| {ptyp_desc = Ptyp_variant _} -> print_endline "Ptyp_variant"
26-
| _ -> print_endline "Something else"
27-
283
let arrow_type ?(arity = max_int) ?(attrs = []) ct =
294
let has_as_attr attrs =
305
Ext_list.exists attrs (fun (x, _) -> x.Asttypes.txt = "as")
@@ -72,7 +47,7 @@ let arrow_type ?(arity = max_int) ?(attrs = []) ct =
7247
match ct with
7348
| {ptyp_desc = Ptyp_arrow (Nolabel, _typ1, _typ2); ptyp_attributes = attrs1}
7449
as typ ->
75-
let attrs = List.concat [attrs; attrs1] in
50+
let attrs = attrs @ attrs1 in
7651
process attrs [] {typ with ptyp_attributes = []} arity
7752
| typ -> process attrs [] typ arity
7853

jscomp/syntax/src/res_parsetree_viewer.mli

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ val arrow_type :
99
* (Parsetree.attributes * Asttypes.arg_label * Parsetree.core_type) list
1010
* Parsetree.core_type
1111

12-
val print_ct : Parsetree.core_type -> unit
13-
1412
val functor_type :
1513
Parsetree.module_type ->
1614
(Parsetree.attributes * string Asttypes.loc * Parsetree.module_type option)

0 commit comments

Comments
 (0)