Skip to content

Commit ce32b6b

Browse files
committed
1 parent 2a54c5d commit ce32b6b

File tree

7 files changed

+43
-26
lines changed

7 files changed

+43
-26
lines changed

Diff for: jscomp/all.depend

+2-2
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,8 @@ core/lam_compile_main.cmx : ext/literals.cmx core/lam_util.cmx \
676676
core/js_implementation.cmx : core/ocaml_parse.cmx ext/literals.cmx \
677677
core/lam_compile_main.cmx core/lam_compile_env.cmx common/js_config.cmx \
678678
ext/ext_string.cmx ext/ext_pervasives.cmx ext/ext_namespace.cmx \
679-
common/ext_log.cmx ext/ext_io.cmx syntax/bs_ast_invariant.cmx \
680-
depends/binary_ast.cmx core/js_implementation.cmi
679+
common/ext_log.cmx ext/ext_io.cmx depends/binary_ast.cmx \
680+
core/js_implementation.cmi
681681
core/ocaml_batch_compile.cmx : core/ocaml_parse.cmx \
682682
core/js_implementation.cmx common/js_config.cmx ext/ext_ref.cmx \
683683
ext/ext_pervasives.cmx ext/ext_namespace.cmx ext/ext_modulename.cmx \

Diff for: jscomp/core/js_implementation.ml

+3-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ open Compenv
2020

2121
let fprintf = Format.fprintf
2222

23-
let dummy_unused_attribute : Warnings.t = (Bs_unused_attribute "")
23+
2424

2525
let print_if ppf flag printer arg =
2626
if !flag then fprintf ppf "%a@." printer arg;
@@ -41,8 +41,7 @@ let after_parsing_sig ppf sourcefile outputprefix ast =
4141
end;
4242
if !Js_config.syntax_only then () else
4343
begin
44-
if Warnings.is_active dummy_unused_attribute then
45-
Bs_ast_invariant.emit_external_warnings.signature Bs_ast_invariant.emit_external_warnings ast ;
44+
4645
if Js_config.get_diagnose () then
4746
Format.fprintf Format.err_formatter "Building %s@." sourcefile;
4847
let modulename = module_of_filename ppf sourcefile outputprefix in
@@ -86,9 +85,7 @@ let after_parsing_impl ppf sourcefile outputprefix ast =
8685
ast ;
8786
if !Js_config.syntax_only then () else
8887
begin
89-
90-
if Warnings.is_active dummy_unused_attribute then
91-
Bs_ast_invariant.emit_external_warnings.structure Bs_ast_invariant.emit_external_warnings ast ;
88+
9289
if Js_config.get_diagnose () then
9390
Format.fprintf Format.err_formatter "Building %s@." sourcefile;
9491
let modulename = Compenv.module_of_filename ppf sourcefile outputprefix in

Diff for: jscomp/syntax/ppx_entry.ml

+10-3
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ let signature_config_table :
687687
(Parsetree.expression option -> unit) String_map.t=
688688
String_map.of_list common_actions_table
689689

690-
690+
let dummy_unused_attribute : Warnings.t = (Bs_unused_attribute "")
691691

692692
let rewrite_signature :
693693
(Parsetree.signature -> Parsetree.signature) ref =
@@ -703,7 +703,10 @@ let rewrite_signature :
703703
end
704704
| _ ->
705705
unsafe_mapper.signature unsafe_mapper x in
706-
reset (); result
706+
reset ();
707+
if Warnings.is_active dummy_unused_attribute then
708+
Bs_ast_invariant.emit_external_warnings.signature Bs_ast_invariant.emit_external_warnings ast ;
709+
result
707710
)
708711

709712
let rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref =
@@ -727,5 +730,9 @@ let rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref =
727730
end
728731
| _ ->
729732
unsafe_mapper.structure unsafe_mapper x in
730-
reset (); result )
733+
reset ();
734+
(if Warnings.is_active dummy_unused_attribute then
735+
Bs_ast_invariant.emit_external_warnings.structure Bs_ast_invariant.emit_external_warnings result);
736+
result
737+
)
731738

Diff for: jscomp/syntax/ppx_entry.mli

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525

2626

2727

28-
val rewrite_signature : (Parsetree.signature -> Parsetree.signature) ref
28+
val rewrite_signature :
29+
(Parsetree.signature -> Parsetree.signature) ref
2930

30-
val rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref
31+
val rewrite_implementation :
32+
(Parsetree.structure -> Parsetree.structure) ref
3133

3234

3335

Diff for: lib/bsdep.ml

+8-4
Original file line numberDiff line numberDiff line change
@@ -31185,7 +31185,7 @@ let init () =
3118531185
(Exp.fun_ "" None
3118631186
(Pat.var pat_param)
3118731187
(if createType then
31188-
(eraseType (Exp.constraint_ exp_param newType) -~ const_int offset)
31188+
(( exp_param +: newType) -~ const_int offset)
3118931189
+>
3119031190
core_type
3119131191
else
@@ -35477,9 +35477,11 @@ module Ppx_entry : sig
3547735477

3547835478

3547935479

35480-
val rewrite_signature : (Parsetree.signature -> Parsetree.signature) ref
35480+
val rewrite_signature :
35481+
(Parsetree.signature -> Parsetree.signature) ref
3548135482

35482-
val rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref
35483+
val rewrite_implementation :
35484+
(Parsetree.structure -> Parsetree.structure) ref
3548335485

3548435486

3548535487

@@ -36248,7 +36250,9 @@ let rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref =
3624836250
end
3624936251
| _ ->
3625036252
unsafe_mapper.structure unsafe_mapper x in
36251-
reset (); result )
36253+
reset ();
36254+
result
36255+
)
3625236256

3625336257

3625436258
end

Diff for: lib/bsppx.ml

+8-4
Original file line numberDiff line numberDiff line change
@@ -13133,7 +13133,7 @@ let init () =
1313313133
(Exp.fun_ "" None
1313413134
(Pat.var pat_param)
1313513135
(if createType then
13136-
(eraseType (Exp.constraint_ exp_param newType) -~ const_int offset)
13136+
(( exp_param +: newType) -~ const_int offset)
1313713137
+>
1313813138
core_type
1313913139
else
@@ -18594,9 +18594,11 @@ module Ppx_entry : sig
1859418594

1859518595

1859618596

18597-
val rewrite_signature : (Parsetree.signature -> Parsetree.signature) ref
18597+
val rewrite_signature :
18598+
(Parsetree.signature -> Parsetree.signature) ref
1859818599

18599-
val rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref
18600+
val rewrite_implementation :
18601+
(Parsetree.structure -> Parsetree.structure) ref
1860018602

1860118603

1860218604

@@ -19365,7 +19367,9 @@ let rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref =
1936519367
end
1936619368
| _ ->
1936719369
unsafe_mapper.structure unsafe_mapper x in
19368-
reset (); result )
19370+
reset ();
19371+
result
19372+
)
1936919373

1937019374

1937119375
end

Diff for: lib/whole_compiler.ml

+8-5
Original file line numberDiff line numberDiff line change
@@ -105952,7 +105952,7 @@ let init () =
105952105952
(Exp.fun_ "" None
105953105953
(Pat.var pat_param)
105954105954
(if createType then
105955-
(eraseType (Exp.constraint_ exp_param newType) -~ const_int offset)
105955+
(( exp_param +: newType) -~ const_int offset)
105956105956
+>
105957105957
core_type
105958105958
else
@@ -109391,9 +109391,11 @@ module Ppx_entry : sig
109391109391

109392109392

109393109393

109394-
val rewrite_signature : (Parsetree.signature -> Parsetree.signature) ref
109394+
val rewrite_signature :
109395+
(Parsetree.signature -> Parsetree.signature) ref
109395109396

109396-
val rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref
109397+
val rewrite_implementation :
109398+
(Parsetree.structure -> Parsetree.structure) ref
109397109399

109398109400

109399109401

@@ -110162,7 +110164,9 @@ let rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref =
110162110164
end
110163110165
| _ ->
110164110166
unsafe_mapper.structure unsafe_mapper x in
110165-
reset (); result )
110167+
reset ();
110168+
result
110169+
)
110166110170

110167110171

110168110172
end
@@ -113807,7 +113811,6 @@ let after_parsing_impl ppf sourcefile outputprefix ast =
113807113811
ast ;
113808113812
if !Js_config.syntax_only then () else
113809113813
begin
113810-
113811113814
if Warnings.is_active dummy_unused_attribute then
113812113815
Bs_ast_invariant.emit_external_warnings.structure Bs_ast_invariant.emit_external_warnings ast ;
113813113816
if Js_config.get_diagnose () then

0 commit comments

Comments
 (0)