8000 remove `--mel-g` and debug mode by anmonteiro · Pull Request #1234 · melange-re/melange · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

remove --mel-g and debug mode #1234

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 3 commits into from
Dec 16, 2024
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 Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Unreleased
([#1218](https://github.com/melange-re/melange/pull/1218))
- `melange.js`: add `TypedArray` types at the toplevel in the `Js` module
([#1248](https://github.com/melange-re/melange/pull/1248))
- BREAKING: remove `--mel-g`
([#1234](https://github.com/melange-re/melange/pull/1234))

4.0.1 2024-06-07
---------------
Expand Down
3 changes: 0 additions & 3 deletions bin/melc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ let main: Melc_cli.t -> _ Cmdliner.Term.ret
bs_package_output;
mel_module_system;
bs_syntax_only;
bs_g;
bs_package_name;
bs_module_name;
as_ppx;
Expand Down Expand Up @@ -302,8 +301,6 @@ let main: Melc_cli.t -> _ Cmdliner.Term.ret
bs_cross_module_opt ;
if bs_syntax_only then Js_config.syntax_only := bs_syntax_only;

if bs_g then Js_config.debug := bs_g;

Option.iter Js_packages_state.set_package_name bs_package_name;
begin match mel_module_system, bs_package_output with
| None, [] -> ()
Expand Down
10 changes: 2 additions & 8 deletions bin/melc_cli.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type t = {
bs_package_output : string list;
mel_module_system : Module_system.t option;
bs_syntax_only : bool;
bs_g : bool;
bs_package_name : string option;
bs_module_name : string option;
as_ppx : bool;
Expand Down Expand Up @@ -148,10 +147,6 @@ let bs_syntax_only =
let doc = "Only check syntax" in
Arg.(value & flag & info [ "bs-syntax-only"; "mel-syntax-only" ] ~doc)

let bs_g =
let doc = "Debug mode" in
Arg.(value & flag & info [ "bs-g"; "mel-g" ] ~doc)

let bs_package_name =
let doc = "Set package name, useful when you want to produce npm packages" in
Arg.(
Expand Down Expand Up @@ -477,7 +472,7 @@ module Compat = struct
end

let parse help include_dirs hidden_include_dirs alerts warnings output_name ppx
open_modules bs_package_output mel_module_system bs_syntax_only bs_g
open_modules bs_package_output mel_module_system bs_syntax_only
bs_package_name bs_module_name as_ppx as_pp no_alias_deps bs_gentype
unboxed_types bs_unsafe_empty_array nostdlib color bs_eval bs_cmi_only
bs_no_version_header bs_cross_module_opt bs_diagnose where verbose keep_locs
Expand All @@ -498,7 +493,6 @@ let parse help include_dirs hidden_include_dirs alerts warnings output_name ppx
bs_package_output;
mel_module_system;
bs_syntax_only;
bs_g;
bs_package_name;
bs_module_name;
as_ppx;
Expand Down Expand Up @@ -557,7 +551,7 @@ let cmd =
Term.(
const parse $ help $ include_dirs $ hidden_include_dirs $ alerts $ warnings
$ output_name $ ppx $ open_modules $ Internal.bs_package_output
$ Internal.mel_module_system $ bs_syntax_only $ bs_g $ bs_package_name
$ Internal.mel_module_system $ bs_syntax_only $ bs_package_name
$ bs_module_name $ Internal.as_ppx $ Internal.as_pp $ Internal.no_alias_deps
$ Internal.bs_gentype $ unboxed_types $ Internal.bs_unsafe_empty_array
$ Internal.nostdlib $ color $ Internal.bs_eval $ Internal.bs_cmi_only
Expand Down
1 change: 0 additions & 1 deletion jscomp/core/js_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ let diagnose = ref false
let tool_name = "Melange"
let check_div_by_zero = ref true
let syntax_only = ref false
let debug = ref false
let cmi_only = ref false
let cmj_only = ref false
let js_stdout = ref true
Expand Down
1 change: 0 additions & 1 deletion jscomp/core/js_config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ val check_div_by_zero : bool ref

val tool_name : string
val syntax_only : bool ref
val debug : bool ref

val cmi_only : bool ref
(** stop after generating cmi *)
Expand Down
10 changes: 2 additions & 8 deletions jscomp/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -801,10 +801,8 @@ and expression_desc cxt ~(level : int) x : cxt =
| Caml_block { fields = el; tag; tag_info = Blk_record_inlined p; _ } ->
let objs =
let tails =
List.map_combine_array_append p.fields el
~init:(if !Js_config.debug then [ (Js_op.Symbol_name, E.str p.name) ]
else [])
~f:(fun i -> Js_op.Lit i)
List.map_combine_array_append p.fields el ~init:[] ~f:(fun i ->
Js_op.Lit i)
in
let as_value =
Lam_constant_convert.modifier ~name:p.name p.attributes
Expand Down Expand Up @@ -833,10 +831,6 @@ and expression_desc cxt ~(level : int) x : cxt =
~f:(fun i e ->
(Js_op.Lit (E.variant_pos ~constr:p.name (Int32.of_int i)), e))
el
@
if !Js_config.debug && not is_cons then
[ (Symbol_name, E.str p.name) ]
else []
in
if is_cons && p.num_nonconst = 1 then tails
else
Expand Down
10 changes: 0 additions & 10 deletions jscomp/test/debug_mode_value.ml

This file was deleted.

11 changes: 0 additions & 11 deletions jscomp/test/gpr_4407_test.ml

This file was deleted.

Loading
0