Skip to content

Fix deprecation warnings in bsb #5875

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
Dec 7, 2022
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
14 changes: 7 additions & 7 deletions jscomp/bsb/bsb_log.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ let get_color_enabled () =
in
colorful

let color_functions : Format.formatter_tag_functions =
let color_functions : Format.formatter_stag_functions =
{
mark_open_tag =
mark_open_stag =
(fun s ->
if get_color_enabled () then Ext_color.ansi_of_tag s
else Ext_string.empty);
mark_close_tag =
mark_close_stag =
(fun _ ->
if get_color_enabled () then Ext_color.reset_lit else Ext_string.empty);
print_open_tag = (fun _ -> ());
print_close_tag = (fun _ -> ());
print_open_stag = (fun _ -> ());
print_close_stag = (fun _ -> ());
}

(* let set_color ppf =
Expand All @@ -56,8 +56,8 @@ let color_functions : Format.formatter_tag_functions =
let setup () =
Format.pp_set_mark_tags Format.std_formatter true;
Format.pp_set_mark_tags Format.err_formatter true;
Format.pp_set_formatter_tag_functions Format.std_formatter color_functions;
Format.pp_set_formatter_tag_functions Format.err_formatter color_functions
Format.pp_set_formatter_stag_functions Format.std_formatter color_functions;
Format.pp_set_formatter_stag_functions Format.err_formatter color_functions

type level = Debug | Info | Warn | Error

Expand Down
2 changes: 1 addition & 1 deletion jscomp/bsb/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name bsb)
(wrapped false)
(flags
(:standard -w +a-d-4-9-40-41-42-70))
(:standard -w +a-4-9-40-41-42-70))
(libraries common ext str unix))
2 changes: 1 addition & 1 deletion jscomp/bsb_exe/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name rescript_main)
(public_name rescript)
(flags
(:standard -w +a-d-4-9-40-41-42-70))
(:standard -w +a-4-9-40-41-42-70))
(libraries bsb common ext str unix))
10 changes: 5 additions & 5 deletions jscomp/ext/ext_color.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ let code_of_style = function
(** TODO: add more styles later *)
let style_of_tag s =
match s with
| "error" -> [ Bold; FG Red ]
| "warning" -> [ Bold; FG Magenta ]
| "info" -> [ Bold; FG Yellow ]
| "dim" -> [ Dim ]
| "filename" -> [ FG Cyan ]
| Format.String_tag "error" -> [ Bold; FG Red ]
| Format.String_tag "warning" -> [ Bold; FG Magenta ]
| Format.String_tag "info" -> [ Bold; FG Yellow ]
| Format.String_tag "dim" -> [ Dim ]
| Format.String_tag "filename" -> [ FG Cyan ]
| _ -> []

let ansi_of_tag s =
Expand Down
2 changes: 1 addition & 1 deletion jscomp/ext/ext_color.mli
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type color = Black | Red | Green | Yellow | Blue | Magenta | Cyan | White

type style = FG of color | BG of color | Bold | Dim

val ansi_of_tag : string -> string
val ansi_of_tag : Format.stag -> string
(** Input is the tag for example `@{<warning>@}` return escape code *)

val reset_lit : string