Skip to content

Commit 80297bb

Browse files
authored
Merge pull request #3794 from BuckleScript/call_gentype_from_buckle
Calling genType from buckle instead from the patched compiler
2 parents 7b9a647 + 4074f11 commit 80297bb

File tree

11 files changed

+50
-22
lines changed

11 files changed

+50
-22
lines changed

jscomp/common/bs_version.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* You should have received a copy of the GNU Lesser General Public License
2323
* along with this program; if not, write to the Free Software
2424
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
25-
let version = "5.1.1"
25+
let version = "5.2.0-dev.1"
2626
let header =
2727
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
2828
let package_name = "bs-platform"

jscomp/core/js_implementation.ml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ let print_if ppf flag printer arg =
2727
arg
2828

2929

30+
let process_with_gentype filename =
31+
match !Clflags.bs_gentype with
32+
| None -> ()
33+
| Some cmd ->
34+
let comm = (cmd ^
35+
" -bs-version " ^ Bs_version.version ^
36+
" -cmt-add " ^
37+
filename ^
38+
( ":" ^ !Location.input_name)) in
39+
if !Clflags.verbose then begin
40+
prerr_string "+ ";
41+
prerr_endline comm;
42+
prerr_newline ()
43+
end ;
44+
ignore
45+
(Sys.command comm
46+
)
3047

3148
let after_parsing_sig ppf outputprefix ast =
3249
if !Js_config.binary_ast then
@@ -76,6 +93,7 @@ let after_parsing_sig ppf outputprefix ast =
7693
#end
7794
Typemod.save_signature modulename tsg outputprefix !Location.input_name
7895
initial_env sg ;
96+
process_with_gentype (outputprefix ^ ".cmti");
7997
end
8098
end
8199

@@ -142,7 +160,7 @@ let after_parsing_impl ppf outputprefix ast =
142160
outputprefix
143161
);
144162
end;
145-
Stypes.dump (Some (outputprefix ^ ".annot"));
163+
process_with_gentype (outputprefix ^ ".cmt")
146164
end
147165
let implementation ppf fname outputprefix =
148166
Compmisc.init_path false;

lib/4.02.3/bsb.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ end = struct
5555
* You should have received a copy of the GNU Lesser General Public License
5656
* along with this program; if not, write to the Free Software
5757
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
58-
let version = "5.1.1"
58+
let version = "5.2.0-dev.1"
5959
let header =
6060
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
6161
let package_name = "bs-platform"

lib/4.02.3/bsdep.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ end = struct
5555
* You should have received a copy of the GNU Lesser General Public License
5656
* along with this program; if not, write to the Free Software
5757
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
58-
let version = "5.1.1"
58+
let version = "5.2.0-dev.1"
5959
let header =
6060
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
6161
let package_name = "bs-platform"

lib/4.02.3/bsppx.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16164,7 +16164,7 @@ end = struct
1616416164
* You should have received a copy of the GNU Lesser General Public License
1616516165
* along with this program; if not, write to the Free Software
1616616166
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
16167-
let version = "5.1.1"
16167+
let version = "5.2.0-dev.1"
1616816168
let header =
1616916169
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
1617016170
let package_name = "bs-platform"

lib/4.02.3/unstable/bsb_native.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ end = struct
5555
* You should have received a copy of the GNU Lesser General Public License
5656
* along with this program; if not, write to the Free Software
5757
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
58-
let version = "5.1.1"
58+
let version = "5.2.0-dev.1"
5959
let header =
6060
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
6161
let package_name = "bs-platform"

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16071,7 +16071,7 @@ end = struct
1607116071
* You should have received a copy of the GNU Lesser General Public License
1607216072
* along with this program; if not, write to the Free Software
1607316073
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
16074-
let version = "5.1.1"
16074+
let version = "5.2.0-dev.1"
1607516075
let header =
1607616076
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
1607716077
let package_name = "bs-platform"
@@ -50054,11 +50054,7 @@ let save_cmt filename modname binary_annots sourcefile initial_env sg =
5005450054
cmt_use_summaries = need_to_clear_env;
5005550055
} in
5005650056
output_cmt oc cmt;
50057-
close_out oc;
50058-
(* TODO: does not make sense to do post-proccesing for [Partial_implementaiton]*)
50059-
match !Clflags.bs_gentype with
50060-
| None -> ()
50061-
| Some cmd -> ignore (Sys.command (cmd ^ " -cmt-add " ^ filename ^ (match sourcefile with None -> "" | Some sourcefile -> ":" ^ sourcefile)))
50057+
close_out oc
5006250058
end;
5006350059
clear ()
5006450060

lib/4.02.3/unstable/native_ppx.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15284,7 +15284,7 @@ end = struct
1528415284
* You should have received a copy of the GNU Lesser General Public License
1528515285
* along with this program; if not, write to the Free Software
1528615286
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
15287-
let version = "5.1.1"
15287+
let version = "5.2.0-dev.1"
1528815288
let header =
1528915289
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
1529015290
let package_name = "bs-platform"

lib/4.02.3/whole_compiler.ml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5270,7 +5270,7 @@ end = struct
52705270
* You should have received a copy of the GNU Lesser General Public License
52715271
* along with this program; if not, write to the Free Software
52725272
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
5273-
let version = "5.1.1"
5273+
let version = "5.2.0-dev.1"
52745274
let header =
52755275
"// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE"
52765276
let package_name = "bs-platform"
@@ -38275,11 +38275,7 @@ let save_cmt filename modname binary_annots sourcefile initial_env sg =
3827538275
cmt_use_summaries = need_to_clear_env;
3827638276
} in
3827738277
output_cmt oc cmt;
38278-
close_out oc;
38279-
(* TODO: does not make sense to do post-proccesing for [Partial_implementaiton]*)
38280-
match !Clflags.bs_gentype with
38281-
| None -> ()
38282-
| Some cmd -> ignore (Sys.command (cmd ^ " -cmt-add " ^ filename ^ (match sourcefile with None -> "" | Some sourcefile -> ":" ^ sourcefile)))
38278+
close_out oc
3828338279
end;
3828438280
clear ()
3828538281

@@ -123404,6 +123400,23 @@ let print_if ppf flag printer arg =
123404123400
arg
123405123401

123406123402

123403+
let process_with_gentype filename =
123404+
match !Clflags.bs_gentype with
123405+
| None -> ()
123406+
| Some cmd ->
123407+
let comm = (cmd ^
123408+
" -bs-version " ^ Bs_version.version ^
123409+
" -cmt-add " ^
123410+
filename ^
123411+
( ":" ^ !Location.input_name)) in
123412+
if !Clflags.verbose then begin
123413+
prerr_string "+ ";
123414+
prerr_endline comm;
123415+
prerr_newline ()
123416+
end ;
123417+
ignore
123418+
(Sys.command comm
123419+
)
123407123420

123408123421
let after_parsing_sig ppf outputprefix ast =
123409123422
if !Js_config.binary_ast then
@@ -123446,6 +123459,7 @@ let after_parsing_sig ppf outputprefix ast =
123446123459

123447123460
Typemod.save_signature modulename tsg outputprefix !Location.input_name
123448123461
initial_env sg ;
123462+
process_with_gentype (outputprefix ^ ".cmti");
123449123463
end
123450123464
end
123451123465

@@ -123510,7 +123524,7 @@ let after_parsing_impl ppf outputprefix ast =
123510123524
outputprefix
123511123525
);
123512123526
end;
123513-
Stypes.dump (Some (outputprefix ^ ".annot"));
123527+
process_with_gentype (outputprefix ^ ".cmt")
123514123528
end
123515123529
let implementation ppf fname outputprefix =
123516123530
Compmisc.init_path false;

ocaml

Submodule ocaml updated from 025b846 to c45c78d

0 commit comments

Comments
 (0)