diff --git a/jscomp/bsb/bsb_log.ml b/jscomp/bsb/bsb_log.ml index 74ed068d8c..06401aaa69 100644 --- a/jscomp/bsb/bsb_log.ml +++ b/jscomp/bsb/bsb_log.ml @@ -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 = @@ -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 diff --git a/jscomp/bsb/dune b/jscomp/bsb/dune index 0c27d4e033..bdf0b9f031 100644 --- a/jscomp/bsb/dune +++ b/jscomp/bsb/dune @@ -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)) diff --git a/jscomp/bsb_exe/dune b/jscomp/bsb_exe/dune index 3e057d3f5c..e75592a479 100644 --- a/jscomp/bsb_exe/dune +++ b/jscomp/bsb_exe/dune @@ -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)) diff --git a/jscomp/ext/ext_color.ml b/jscomp/ext/ext_color.ml index 5a34e5c67f..d5ed3bb166 100644 --- a/jscomp/ext/ext_color.ml +++ b/jscomp/ext/ext_color.ml @@ -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 = diff --git a/jscomp/ext/ext_color.mli b/jscomp/ext/ext_color.mli index 200d011a26..d2aa148455 100644 --- a/jscomp/ext/ext_color.mli +++ b/jscomp/ext/ext_color.mli @@ -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 `@{@}` return escape code *) val reset_lit : string