Skip to content

Commit abdb393

Browse files
authored
Remove Rescript_cpp module, -bs-D and -bs-list-conditionals (#7631)
* Remove Rescript_cpp module, -bs-D and -bs-list-conditionals * CHANGELOG * simplify
1 parent 556545d commit abdb393

File tree

5 files changed

+3
-167
lines changed

5 files changed

+3
-167
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#### :house: Internal
1616

1717
- Remove internal/unused `-bs-v` flag. https://github.com/rescript-lang/rescript/pull/7627
18+
- Remove unused `-bs-D` and `-bs-list-conditionals` flags. https://github.com/rescript-lang/rescript/pull/7631
1819

1920
# 12.0.0-beta.1
2021

compiler/bsc/rescript_compiler_main.ml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,6 @@ let eval (s : string) ~suffix =
205205

206206
(* let (//) = Filename.concat *)
207207

208-
module Pp = Rescript_cpp
209-
let define_variable s =
210-
match Ext_string.split ~keep_empty:true s '=' with
211-
| [key; v] ->
212-
if not (Pp.define_key_value key v) then
213-
Bsc_args.bad_arg ("illegal definition: " ^ s)
214-
| _ -> Bsc_args.bad_arg ("illegal definition: " ^ s)
215-
216208
let print_standard_library () =
217209
let standard_library = Config.standard_library in
218210
print_string standard_library;
@@ -297,11 +289,7 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
297289
( "-bs-syntax-only",
298290
set Js_config.syntax_only,
299291
"*internal* Only check syntax" );
300-
( "-bs-g",
301-
unit_call (fun _ ->
302-
Js_config.debug := true;
303-
Pp.replace_directive_bool "DEBUG" true),
304-
"Debug mode" );
292+
("-bs-g", set Js_config.debug, "Debug mode");
305293
( "-bs-package-name",
306294
string_call Js_packages_state.set_package_name,
307295
"*internal* Set package name, useful when you want to produce npm \
@@ -323,9 +311,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
323311
( "-unboxed-types",
324312
set Clflags.unboxed_types,
325313
"*internal* Unannotated unboxable types will be unboxed" );
326-
( "-bs-D",
327-
string_call define_variable,
328-
"Define conditional variable e.g, -D DEBUG=true" );
329314
( "-bs-unsafe-empty-array",
330315
set Config.unsafe_empty_array,
331316
"*internal* Allow [||] to be polymorphic" );
@@ -341,9 +326,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
341326
The current heuristic for 'auto'\n\
342327
checks that the TERM environment variable exists and is\n\
343328
not empty or \"dumb\", and that isatty(stderr) holds." );
344-
( "-bs-list-conditionals",
345-
unit_call (fun () -> Pp.list_variables Format.err_formatter),
346-
"*internal* List existing conditional variables" );
347329
( "-e",
348330
string_call (fun s -> eval s ~suffix:Literals.suffix_res),
349331
"(experimental) set the string to be evaluated in ReScript syntax" );

compiler/core/bs_conditional_initial.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ let setup_env () =
4747
Matching.names_from_construct_pattern :=
4848
Matching_polyfill.names_from_construct_pattern;
4949

50-
Rescript_cpp.replace_directive_bool "BS" true;
51-
Rescript_cpp.replace_directive_bool "JS" true;
52-
Printtyp.print_res_poly_identifier := Res_printer.polyvar_ident_to_string;
53-
Rescript_cpp.replace_directive_string "BS_VERSION" Bs_version.version
50+
Printtyp.print_res_poly_identifier := Res_printer.polyvar_ident_to_string
5451
(*; Switch.cut := 100*)
5552
(* tweakable but not very useful *)
5653

compiler/ml/rescript_cpp.ml

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

compiler/ml/rescript_cpp.mli

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

0 commit comments

Comments
 (0)