Skip to content

Commit 669d304

Browse files
committed
upgrade refined meta data info from upsteram
1 parent 547df72 commit 669d304

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+298
-256
lines changed

jscomp/core/js_of_lam_block.ml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,14 @@ let make_block mutable_flag (tag_info : Lam_tag_info.t) tag args =
5151
let field (field_info : Lam_compat.field_dbg_info) e i =
5252
match field_info with
5353
| Fld_na
54-
| Fld_tuple ->
55-
(* let comment = "NA" in *)
56-
E.array_index_by_int (* ~comment *) e i
57-
#if OCAML_VERSION =~ ">4.03.0" then
58-
| Fld_record_inline comment
59-
| Fld_record_extension comment
54+
| Fld_tuple
55+
| Fld_poly_var_tag
56+
| Fld_poly_var_content
57+
| Fld_record_inline _
58+
| Fld_record_extension _
6059
->
61-
E.array_index_by_int ~comment e i
62-
#end
60+
E.array_index_by_int
61+
?comment:(Lam_compat.str_of_field_info field_info) e i
6362
| Fld_record {name}
6463
-> E.record_access e name i
6564
| Fld_module name

jscomp/core/lam_compat.ml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,16 @@ type field_dbg_info = Lambda.field_dbg_info =
191191
| Fld_record_extension of string
192192
#end
193193
| Fld_tuple
194+
| Fld_poly_var_tag
195+
| Fld_poly_var_content
196+
197+
194198
let str_of_field_info (x : field_dbg_info) : string option =
195199
match x with
196200
| Fld_na
197-
| Fld_tuple -> None
201+
| Fld_poly_var_tag
202+
| Fld_poly_var_content
203+
| Fld_tuple -> None
198204
| Fld_record {name = s}
199205
| Fld_module s
200206
| Fld_record_inline s

jscomp/core/lam_compat.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ type field_dbg_info = Lambda.field_dbg_info =
9292
| Fld_record_extension of string
9393
#end
9494
| Fld_tuple
95+
| Fld_poly_var_tag
96+
| Fld_poly_var_content
97+
9598

9699
val str_of_field_info :
97100
field_dbg_info ->

jscomp/core/lam_compile_util.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ let comment_of_tag_info (x : Lam_tag_info.t) =
5959
| Blk_extension (* TODO: enhance it later *)
6060
| Blk_extension_slot -> None
6161
| Blk_na s -> if s = "" then None else Some s
62+
63+
let module_alias = Some "alias"
6264
let comment_of_pointer_info (x : Lam_pointer_info.t)=
6365
match x with
6466
| Pt_constructor {name}
6567
| Pt_variant {name} -> Some name
66-
| Pt_module_alias -> None (* FIXME *)
68+
| Pt_module_alias -> module_alias
6769
| Pt_na -> None

jscomp/test/array_data_util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function randomRange(i, j) {
1616
return v;
1717
}
1818

19-
var A = 0;
19+
var A = /* alias */0;
2020

2121
exports.A = A;
2222
exports.range = range;

jscomp/test/bigarray_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function init3(v) {
3535
return /* () */0;
3636
}
3737

38-
var BA1 = 0;
38+
var BA1 = /* alias */0;
3939

4040
exports.BA1 = BA1;
4141
exports.sum = sum;

jscomp/test/bs_MapInt_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function test(param) {
2626

2727
test(/* () */0);
2828

29-
var M = 0;
29+
var M = /* alias */0;
3030

3131
exports.should = should;
3232
exports.M = M;

jscomp/test/bs_array_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,9 +1586,9 @@ eq("File \"bs_array_test.ml\", line 339, characters 5-12", Belt_Array.getIndexBy
15861586

15871587
Mt.from_pair_suites("File \"bs_array_test.ml\", line 341, characters 23-30", suites.contents);
15881588

1589-
var A = 0;
1589+
var A = /* alias */0;
15901590

1591-
var L = 0;
1591+
var L = /* alias */0;
15921592

15931593
exports.suites = suites;
15941594
exports.test_id = test_id;

jscomp/test/bs_float_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ eq("File \"bs_float_test.ml\", line 44, characters 5-12", 3.0 / 2.0, 1.5);
8787

8888
Mt.from_pair_suites("File \"bs_float_test.ml\", line 46, characters 23-30", suites.contents);
8989

90-
var F = 0;
90+
var F = /* alias */0;
9191

9292
exports.suites = suites;
9393
exports.test_id = test_id;

jscomp/test/bs_hashmap_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ b("File \"bs_hashmap_test.ml\", line 57, characters 4-11", Belt_Array.every(Arra
101101

102102
Mt.from_pair_suites("Bs_hashmap_test", suites.contents);
103103

104-
var N = 0;
104+
var N = /* alias */0;
105105

106-
var S = 0;
106+
var S = /* alias */0;
107107

108-
var I = 0;
108+
var I = /* alias */0;
109109

110110
var $plus$plus = Belt_Array.concat;
111111

112-
var A = 0;
112+
var A = /* alias */0;
113113

114-
var So = 0;
114+
var So = /* alias */0;
115115

116116
exports.suites = suites;
117117
exports.test_id = test_id;

0 commit comments

Comments
 (0)