Skip to content

Commit 740e810

Browse files
committed
snapshot
1 parent 0a91d75 commit 740e810

File tree

3 files changed

+62
-29
lines changed

3 files changed

+62
-29
lines changed

lib/4.06.1/bsb.ml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,13 +3750,20 @@ type info =
37503750
| Impl
37513751
| Impl_intf
37523752

3753+
type syntax_kind =
3754+
| Ml
3755+
| Reason
37533756

37543757

37553758
type module_info =
37563759
{
37573760
mutable info : info;
37583761
dir : string;
3759-
is_re : bool;
3762+
syntax_kind : syntax_kind;
3763+
(* This is actually not stored in bsbuild meta info
3764+
since creating .d file only emit .cmj/.cmi dependencies, so it does not
3765+
need know which syntax it is written
3766+
*)
37603767
case : bool;
37613768
name_sans_extension : string;
37623769
}
@@ -3819,12 +3826,16 @@ type info =
38193826
| Intf (* intemediate state *)
38203827
| Impl
38213828
| Impl_intf
3829+
3830+
type syntax_kind =
3831+
| Ml
3832+
| Reason
38223833

38233834
type module_info =
38243835
{
38253836
mutable info : info;
38263837
dir : string ;
3827-
is_re : bool;
3838+
syntax_kind : syntax_kind;
38283839
case : bool;
38293840
name_sans_extension : string ;
38303841
}
@@ -10305,13 +10316,13 @@ let sanity_check (map : t) =
1030510316
let check (x : module_info)
1030610317
name_sans_extension
1030710318
case
10308-
is_re
10319+
syntax_kind
1030910320
(module_info : Bsb_db.info)
1031010321
=
1031110322
let x_ml_info = x.info in
1031210323
(if x.name_sans_extension <> name_sans_extension
1031310324
|| x.case <> case
10314-
|| x.is_re <> is_re
10325+
|| x.syntax_kind <> syntax_kind
1031510326
|| x_ml_info = module_info
1031610327
|| x_ml_info = Impl_intf
1031710328
then
@@ -10332,24 +10343,24 @@ let add_basename
1033210343
?(error_on_invalid_suffix)
1033310344
basename : t =
1033410345
let info = ref Bsb_db.Impl in
10335-
let is_re = ref false in
10346+
let syntax_kind = ref Bsb_db.Ml in
1033610347
let invalid_suffix = ref false in
1033710348
(match Ext_filename.get_extension_maybe basename with
1033810349
| ".ml" ->
1033910350
()
1034010351
| ".re" ->
10341-
is_re := true
10352+
syntax_kind := Reason
1034210353
| ".mli" ->
1034310354
info := Intf
1034410355
| ".rei" ->
1034510356
info := Intf;
10346-
is_re := true
10357+
syntax_kind := Reason
1034710358
| _ ->
1034810359
invalid_suffix := true
1034910360

1035010361
);
1035110362
let info= !info in
10352-
let is_re = !is_re in
10363+
let syntax_kind = !syntax_kind in
1035310364
let invalid_suffix = !invalid_suffix in
1035410365
if invalid_suffix then
1035510366
match error_on_invalid_suffix with
@@ -10372,9 +10383,9 @@ let add_basename
1037210383
(fun opt_module_info ->
1037310384
match opt_module_info with
1037410385
| None ->
10375-
{dir ; name_sans_extension ; info ; is_re ; case }
10386+
{dir ; name_sans_extension ; info ; syntax_kind ; case }
1037610387
| Some x ->
10377-
check x name_sans_extension case is_re info
10388+
check x name_sans_extension case syntax_kind info
1037810389
)
1037910390

1038010391
end
@@ -12435,7 +12446,7 @@ let encode_single (db : Bsb_db.map) (buf : Ext_buffer.t) =
1243512446
let len_encoding = make_encoding length buf in
1243612447
Map_string.iter db (fun _ module_info ->
1243712448
len_encoding buf
12438-
(Hash_string.find_exn mapping module_info.dir lsl 1 + Obj.magic module_info.case ));
12449+
(Hash_string.find_exn mapping module_info.dir lsl 1 + (Obj.magic (module_info.case : bool) : int)));
1243912450
nl buf
1244012451
end
1244112452
let encode (dbs : Bsb_db.t) buf =
@@ -13444,7 +13455,7 @@ let emit_module_build
1344413455
(module_info : Bsb_db.module_info)
1344513456
=
1344613457
let has_intf_file = module_info.info = Impl_intf in
13447-
let is_re = module_info.is_re in
13458+
let is_re = module_info.syntax_kind = Reason in
1344813459
let filename_sans_extension = module_info.name_sans_extension in
1344913460
let input_impl =
1345013461
Bsb_config.proj_rel

lib/4.06.1/unstable/all_ounit_tests.ml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5222,13 +5222,20 @@ type info =
52225222
| Impl
52235223
| Impl_intf
52245224

5225+
type syntax_kind =
5226+
| Ml
5227+
| Reason
52255228

52265229

52275230
type module_info =
52285231
{
52295232
mutable info : info;
52305233
dir : string;
5231-
is_re : bool;
5234+
syntax_kind : syntax_kind;
5235+
(* This is actually not stored in bsbuild meta info
5236+
since creating .d file only emit .cmj/.cmi dependencies, so it does not
5237+
need know which syntax it is written
5238+
*)
52325239
case : bool;
52335240
name_sans_extension : string;
52345241
}
@@ -5291,12 +5298,16 @@ type info =
52915298
| Intf (* intemediate state *)
52925299
| Impl
52935300
| Impl_intf
5301+
5302+
type syntax_kind =
5303+
| Ml
5304+
| Reason
52945305

52955306
type module_info =
52965307
{
52975308
mutable info : info;
52985309
dir : string ;
5299-
is_re : bool;
5310+
syntax_kind : syntax_kind;
53005311
case : bool;
53015312
name_sans_extension : string ;
53025313
}
@@ -7068,7 +7079,7 @@ let encode_single (db : Bsb_db.map) (buf : Ext_buffer.t) =
70687079
let len_encoding = make_encoding length buf in
70697080
Map_string.iter db (fun _ module_info ->
70707081
len_encoding buf
7071-
(Hash_string.find_exn mapping module_info.dir lsl 1 + Obj.magic module_info.case ));
7082+
(Hash_string.find_exn mapping module_info.dir lsl 1 + (Obj.magic (module_info.case : bool) : int)));
70727083
nl buf
70737084
end
70747085
let encode (dbs : Bsb_db.t) buf =
@@ -7276,12 +7287,12 @@ let s_test1 s a =
72767287

72777288
let group0 = Map_string.of_list [
72787289
"Liba",
7279-
{Bsb_db.info = Impl_intf; dir= "a";is_re=false;case = false;
7290+
{Bsb_db.info = Impl_intf; dir= "a";syntax_kind=Ml;case = false;
72807291
name_sans_extension = "liba"}
72817292
]
72827293
let group1 = Map_string.of_list [
72837294
"Ciba",
7284-
{Bsb_db.info = Impl_intf; dir= "b";is_re=false;case = false;
7295+
{Bsb_db.info = Impl_intf; dir= "b";syntax_kind=Ml;case = false;
72857296
name_sans_extension = "liba"}
72867297
]
72877298

lib/4.06.1/unstable/bsb_native.ml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,13 +3750,20 @@ type info =
37503750
| Impl
37513751
| Impl_intf
37523752

3753+
type syntax_kind =
3754+
| Ml
3755+
| Reason
37533756

37543757

37553758
type module_info =
37563759
{
37573760
mutable info : info;
37583761
dir : string;
3759-
is_re : bool;
3762+
syntax_kind : syntax_kind;
3763+
(* This is actually not stored in bsbuild meta info
3764+
since creating .d file only emit .cmj/.cmi dependencies, so it does not
3765+
need know which syntax it is written
3766+
*)
37603767
case : bool;
37613768
name_sans_extension : string;
37623769
}
@@ -3819,12 +3826,16 @@ type info =
38193826
| Intf (* intemediate state *)
38203827
| Impl
38213828
| Impl_intf
3829+
3830+
type syntax_kind =
3831+
| Ml
3832+
| Reason
38223833

38233834
type module_info =
38243835
{
38253836
mutable info : info;
38263837
dir : string ;
3827-
is_re : bool;
3838+
syntax_kind : syntax_kind;
38283839
case : bool;
38293840
name_sans_extension : string ;
38303841
}
@@ -10337,13 +10348,13 @@ let sanity_check (map : t) =
1033710348
let check (x : module_info)
1033810349
name_sans_extension
1033910350
case
10340-
is_re
10351+
syntax_kind
1034110352
(module_info : Bsb_db.info)
1034210353
=
1034310354
let x_ml_info = x.info in
1034410355
(if x.name_sans_extension <> name_sans_extension
1034510356
|| x.case <> case
10346-
|| x.is_re <> is_re
10357+
|| x.syntax_kind <> syntax_kind
1034710358
|| x_ml_info = module_info
1034810359
|| x_ml_info = Impl_intf
1034910360
then
@@ -10364,24 +10375,24 @@ let add_basename
1036410375
?(error_on_invalid_suffix)
1036510376
basename : t =
1036610377
let info = ref Bsb_db.Impl in
10367-
let is_re = ref false in
10378+
let syntax_kind = ref Bsb_db.Ml in
1036810379
let invalid_suffix = ref false in
1036910380
(match Ext_filename.get_extension_maybe basename with
1037010381
| ".ml" ->
1037110382
()
1037210383
| ".re" ->
10373-
is_re := true
10384+
syntax_kind := Reason
1037410385
| ".mli" ->
1037510386
info := Intf
1037610387
| ".rei" ->
1037710388
info := Intf;
10378-
is_re := true
10389+
syntax_kind := Reason
1037910390
| _ ->
1038010391
invalid_suffix := true
1038110392

1038210393
);
1038310394
let info= !info in
10384-
let is_re = !is_re in
10395+
let syntax_kind = !syntax_kind in
1038510396
let invalid_suffix = !invalid_suffix in
1038610397
if invalid_suffix then
1038710398
match error_on_invalid_suffix with
@@ -10404,9 +10415,9 @@ let add_basename
1040410415
(fun opt_module_info ->
1040510416
match opt_module_info with
1040610417
| None ->
10407-
{dir ; name_sans_extension ; info ; is_re ; case }
10418+
{dir ; name_sans_extension ; info ; syntax_kind ; case }
1040810419
| Some x ->
10409-
check x name_sans_extension case is_re info
10420+
check x name_sans_extension case syntax_kind info
1041010421
)
1041110422

1041210423
end
@@ -12584,7 +12595,7 @@ let encode_single (db : Bsb_db.map) (buf : Ext_buffer.t) =
1258412595
let len_encoding = make_encoding length buf in
1258512596
Map_string.iter db (fun _ module_info ->
1258612597
len_encoding buf
12587-
(Hash_string.find_exn mapping module_info.dir lsl 1 + Obj.magic module_info.case ));
12598+
(Hash_string.find_exn mapping module_info.dir lsl 1 + (Obj.magic (module_info.case : bool) : int)));
1258812599
nl buf
1258912600
end
1259012601
let encode (dbs : Bsb_db.t) buf =
@@ -13593,7 +13604,7 @@ let emit_module_build
1359313604
(module_info : Bsb_db.module_info)
1359413605
=
1359513606
let has_intf_file = module_info.info = Impl_intf in
13596-
let is_re = module_info.is_re in
13607+
let is_re = module_info.syntax_kind = Reason in
1359713608
let filename_sans_extension = module_info.name_sans_extension in
1359813609
let input_impl =
1359913610
Bsb_config.proj_rel

0 commit comments

Comments
 (0)