Skip to content

Remove some #ifdef #6228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions jscomp/bsc/rescript_compiler_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ let file_level_flags_handler (e : Parsetree.expression option) =

let _ : unit =
Bs_conditional_initial.setup_env ();
Clflags.color := Some Always;

let flags = "flags" in
Ast_config.add_structure
flags file_level_flags_handler;
Expand Down
18 changes: 2 additions & 16 deletions jscomp/core/bs_conditional_initial.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ let setup_env () =
Clflags.dump_location := false;
Config.syntax_kind := `rescript;
Parmatch.print_res_pat := Pattern_printer.print_pattern;
#ifdef BROWSER
#else
Clflags.color := Some Always;
#endif
(* default true
otherwise [bsc -I sc src/hello.ml ] will include current directory to search path
*)
Expand All @@ -53,21 +49,11 @@ let setup_env () =
Lambda.blk_record := Record_attributes_check.blk_record;
Matching.names_from_construct_pattern :=
Matching_polyfill.names_from_construct_pattern;
#ifndef RELEASE
(let root_dir =
Filename.dirname
(Filename.dirname Sys.executable_name) in
let (//) = Filename.concat in
Clflags.include_dirs :=
(root_dir//"jscomp"//"others") ::
(root_dir//"jscomp"//"stdlib-406") ::
!Clflags.include_dirs);
#endif
Rescript_cpp.replace_directive_bool "BS" true;

Rescript_cpp.replace_directive_bool "BS" true;
Rescript_cpp.replace_directive_bool "JS" true;
Rescript_cpp.replace_directive_string "BS_VERSION" Bs_version.version
(*; Switch.cut := 100*) (* tweakable but not very useful *)


let () =
at_exit (fun _ -> Format.pp_print_flush Format.err_formatter ())