Skip to content
Snippets Groups Projects
Commit 0b6079aa authored by Andre Maroneze's avatar Andre Maroneze Committed by David Bühler
Browse files

[pretty_utils] add pp_escaped

parent 130c2249
No related branches found
No related tags found
No related merge requests found
......@@ -132,6 +132,10 @@ let pp_pair
let escape_underscores = Str.global_replace (Str.regexp_string "_") "__"
let pp_escaped pp fmt e =
let s = Format.asprintf "%a" pp e in
Format.fprintf fmt "%s" (String.escaped s)
let pp_flowlist ?(left=format_of_string "(") ?(sep=format_of_string ",") ?(right=format_of_string ")") f out =
function
| [] -> Format.fprintf out "%(%)%(%)" left right
......
......@@ -143,6 +143,10 @@ val pp_trail : 'a formatter -> 'a formatter
(** pretty-prints its contents inside an '(** ... **)' horizontal block trailed
with '*' *)
val pp_escaped: 'a formatter -> 'a formatter
(** [pp_escaped pp e] pretty-prints [e] with [String.escaped].
@since Frama-C+dev *)
(* ********************************************************************** *)
(** {2 Description Lists (margins)} *)
(* ********************************************************************** *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment