File tree Expand file tree Collapse file tree 6 files changed +25
-14
lines changed Expand file tree Collapse file tree 6 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ let encode_single (db : Bsb_db.map) (buf : Ext_buffer.t) =
82
82
let len_encoding = make_encoding length buf in
83
83
Map_string. iter db (fun _ module_info ->
84
84
len_encoding buf
85
- (Hash_string. find_exn mapping module_info.dir lsl 1 + Obj. magic module_info.case ));
85
+ (Hash_string. find_exn mapping module_info.dir lsl 1 + ( Obj. magic ( module_info.case : bool ) : int ) ));
86
86
nl buf
87
87
end
88
88
let encode (dbs : Bsb_db.t ) buf =
Original file line number Diff line number Diff line change @@ -60,13 +60,13 @@ let sanity_check (map : t) =
60
60
let check (x : module_info )
61
61
name_sans_extension
62
62
case
63
- is_re
63
+ syntax_kind
64
64
(module_info : Bsb_db.info )
65
65
=
66
66
let x_ml_info = x.info in
67
67
(if x.name_sans_extension <> name_sans_extension
68
68
|| x.case <> case
69
- || x.is_re <> is_re
69
+ || x.syntax_kind <> syntax_kind
70
70
|| x_ml_info = module_info
71
71
|| x_ml_info = Impl_intf
72
72
then
@@ -87,24 +87,24 @@ let add_basename
87
87
?(error_on_invalid_suffix )
88
88
basename : t =
89
89
let info = ref Bsb_db. Impl in
90
- let is_re = ref false in
90
+ let syntax_kind = ref Bsb_db. Ml in
91
91
let invalid_suffix = ref false in
92
92
(match Ext_filename. get_extension_maybe basename with
93
93
| ".ml" ->
94
94
()
95
95
| ".re" ->
96
- is_re := true
96
+ syntax_kind := Reason
97
97
| ".mli" ->
98
98
info := Intf
99
99
| ".rei" ->
100
100
info := Intf ;
101
- is_re := true
101
+ syntax_kind := Reason
102
102
| _ ->
103
103
invalid_suffix := true
104
104
105
105
);
106
106
let info= ! info in
107
- let is_re = ! is_re in
107
+ let syntax_kind = ! syntax_kind in
108
108
let invalid_suffix = ! invalid_suffix in
109
109
if invalid_suffix then
110
110
match error_on_invalid_suffix with
@@ -127,7 +127,7 @@ let add_basename
127
127
(fun opt_module_info ->
128
128
match opt_module_info with
129
129
| None ->
130
- {dir ; name_sans_extension ; info ; is_re ; case }
130
+ {dir ; name_sans_extension ; info ; syntax_kind ; case }
131
131
| Some x ->
132
- check x name_sans_extension case is_re info
132
+ check x name_sans_extension case syntax_kind info
133
133
)
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ let emit_module_build
73
73
(module_info : Bsb_db.module_info )
74
74
=
75
75
let has_intf_file = module_info.info = Impl_intf in
76
- let is_re = module_info.is_re in
76
+ let is_re = module_info.syntax_kind = Reason in
77
77
let filename_sans_extension = module_info.name_sans_extension in
78
78
let input_impl =
79
79
Bsb_config. proj_rel
Original file line number Diff line number Diff line change @@ -31,12 +31,16 @@ type info =
31
31
| Intf (* intemediate state *)
32
32
| Impl
33
33
| Impl_intf
34
+
35
+ type syntax_kind =
36
+ | Ml
37
+ | Reason
34
38
35
39
type module_info =
36
40
{
37
41
mutable info : info ;
38
42
dir : string ;
39
- is_re : bool ;
43
+ syntax_kind : syntax_kind ;
40
44
case : bool ;
41
45
name_sans_extension : string ;
42
46
}
Original file line number Diff line number Diff line change @@ -37,13 +37,20 @@ type info =
37
37
| Impl
38
38
| Impl_intf
39
39
40
+ type syntax_kind =
41
+ | Ml
42
+ | Reason
40
43
41
44
42
45
type module_info =
43
46
{
44
47
mutable info : info ;
45
48
dir : string ;
46
- is_re : bool ;
49
+ syntax_kind : syntax_kind ;
50
+ (* This is actually not stored in bsbuild meta info
51
+ since creating .d file only emit .cmj/.cmi dependencies, so it does not
52
+ need know which syntax it is written
53
+ *)
47
54
case : bool ;
48
55
name_sans_extension : string ;
49
56
}
Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ let s_test1 s a =
34
34
35
35
let group0 = Map_string. of_list [
36
36
" Liba" ,
37
- {Bsb_db. info = Impl_intf ; dir= " a" ;is_re = false ;case = false ;
37
+ {Bsb_db. info = Impl_intf ; dir= " a" ;syntax_kind = Ml ;case = false ;
38
38
name_sans_extension = " liba" }
39
39
]
40
40
let group1 = Map_string. of_list [
41
41
" Ciba" ,
42
- {Bsb_db. info = Impl_intf ; dir= " b" ;is_re = false ;case = false ;
42
+ {Bsb_db. info = Impl_intf ; dir= " b" ;syntax_kind = Ml ;case = false ;
43
43
name_sans_extension = " liba" }
44
44
]
45
45
You can’t perform that action at this time.
0 commit comments