From d19e4eaf86bf85831f225a74524cf0046c2f75d2 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Thu, 16 Feb 2017 09:18:37 -0800 Subject: [PATCH] [debug html] Escape type names in html output Summary: In C++ there are types that contain `<>` in their names (templates). When printing type to `html` those should be escaped Reviewed By: jeremydubreil Differential Revision: D4572506 fbshipit-source-id: a180537 --- infer/src/IR/Typ.re | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/infer/src/IR/Typ.re b/infer/src/IR/Typ.re index 2e31eaef2..5b17ebb3c 100644 --- a/infer/src/IR/Typ.re +++ b/infer/src/IR/Typ.re @@ -149,7 +149,12 @@ let array_sensitive_compare t1 t2 => /** Pretty print a type with all the details, using the C syntax. */ let rec pp_full pe f => fun - | Tstruct tname => F.fprintf f "%s" (Typename.to_string tname) + | Tstruct tname => + if (Pp.equal_print_kind pe.Pp.kind Pp.HTML) { + F.fprintf f "%s" (Typename.to_string tname |> Escape.escape_xml) + } else { + F.fprintf f "%s" (Typename.to_string tname) + } | Tint ik => F.fprintf f "%s" (ikind_to_string ik) | Tfloat fk => F.fprintf f "%s" (fkind_to_string fk) | Tvoid => F.fprintf f "void"