Skip to content

Commit 88f63f3

Browse files
authored
Remove old .ml tests. (#6847)
* Remove old .ml tests. Remove old tests that use `.ml` syntax, and the internal option `-bs-eval`. No implicit or explicit uses of `.ml` syntax is left in the compiler. Those tests seem to be mostly very old and different from the format of modern tests, where type errors are checked in explicitly. * Cleanup of Config.interface_suffix, and change log.
1 parent 938db06 commit 88f63f3

14 files changed

+5
-586
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
- Remove coercion with 2 types from internal representation. Coercion `e : t1 :> t2` was only supported in `.ml` syntax and never by the `.res` parser. https://github.com/rescript-lang/rescript-compiler/pull/6829
4747
- Convert `caml_format` and `js_math` to `.res`. https://github.com/rescript-lang/rescript-compiler/pull/6834
4848
- Convert `js.ml` files to `.res`. https://github.com/rescript-lang/rescript-compiler/pull/6835
49+
- Remove old `.ml` tests. https://github.com/rescript-lang/rescript-compiler/pull/6847
4950

5051
#### :nail_care: Polish
5152

jscomp/bsc/rescript_compiler_main.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
369369
"-bs-list-conditionals", unit_call (fun () -> Pp.list_variables Format.err_formatter),
370370
"*internal* List existing conditional variables";
371371

372-
"-bs-eval", string_call (fun s -> eval s ~suffix:Literals.suffix_ml),
373-
"*internal* (experimental) set the string to be evaluated in OCaml syntax";
374-
375372
"-e", string_call (fun s -> eval s ~suffix:Literals.suffix_res),
376373
"(experimental) set the string to be evaluated in ReScript syntax";
377374

jscomp/build_tests/cmd/input.js

Lines changed: 0 additions & 60 deletions
This file was deleted.

jscomp/ext/config.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ and cmt_magic_number = "Caml1999T022"
2626

2727
let load_path = ref ([] : string list)
2828

29-
let interface_suffix = ref ".mli"
30-
3129
(* This is normally the same as in obj.ml, but we have to define it
3230
separately because it can differ when we're in the middle of a
3331
bootstrapping phase. *)

jscomp/ext/config.mli

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ val unsafe_empty_array : bool ref
3030
val load_path : string list ref
3131
(* Directories in the search path for .cmi and .cmo files *)
3232

33-
val interface_suffix : string ref
34-
(* Suffix for interface file names *)
35-
3633
val cmi_magic_number : string
3734

3835
(* Magic number for compiled interface files *)

jscomp/ext/ext_file_extensions.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type valid_input =
1717
let classify_input ext =
1818
match () with
1919
| _ when ext = Literals.suffix_ml -> Ml
20-
| _ when ext = !Config.interface_suffix -> Mli
20+
| _ when ext = Literals.suffix_mli -> Mli
2121
| _ when ext = Literals.suffix_ast -> Impl_ast
2222
| _ when ext = Literals.suffix_iast -> Intf_ast
2323
| _ when ext = Literals.suffix_mlmap -> Mlmap

jscomp/ml/typemod.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,14 +1688,14 @@ let type_implementation_more ?check_exists sourcefile outputprefix modulename in
16881688
type_structure initial_env ast (Location.in_file sourcefile) in
16891689
let simple_sg = simplify_signature sg in
16901690
begin
1691-
let sourceintf =
1692-
Filename.remove_extension sourcefile ^ !Config.interface_suffix in
16931691
let mli_status = !Clflags.assume_no_mli in
16941692
if mli_status = Clflags.Mli_exists then begin
16951693
let intf_file =
16961694
try
16971695
find_in_path_uncap !Config.load_path (modulename ^ ".cmi")
16981696
with Not_found ->
1697+
let sourceintf =
1698+
Filename.remove_extension sourcefile ^ Literals.suffix_resi in
16991699
raise(Error(Location.in_file sourcefile, Env.empty,
17001700
Interface_not_compiled sourceintf)) in
17011701
let dclsig = Env.read_signature modulename intf_file in

0 commit comments

Comments
 (0)