Skip to content

Commit

Permalink
wip: try to fix escaping of identifiers in TPTP output (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Oct 17, 2022
1 parent 5792fc3 commit 9d33336
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/Util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,12 @@ let pp_list0 ?(sep=" ") pp_x out = function
let tstp_needs_escaping s =
assert (s<>"");
s.[0] = '_' ||
CCString.exists (function ' ' | '#' | '$' | '+' | '-' | '/' -> true | _ -> false) s
CCString.exists
(function
| ' ' | '#' | '$' | '+' | '-' | '/' | '\n'
| '\t' | '\r' | '<' | '>' -> true
| _ -> false)
s

let pp_str_tstp out s =
CCFormat.string out (if tstp_needs_escaping s then "'" ^ String.escaped s ^ "'" else s)
Expand Down

0 comments on commit 9d33336

Please sign in to comment.