From: Ulya Trofimovich Date: Fri, 26 Sep 2014 16:14:20 +0000 (+0100) Subject: Fixed bug #47: Dot output label escaped characters. X-Git-Tag: 0.14~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94874fd70cc8dc122b794782f9e9b8fc66747f9e;p=re2c Fixed bug #47: Dot output label escaped characters. Double-escape special characters for dot. Example: 17 -> 18 [label="\n"] results in an "unlabeled" arrow in the rendered graph, but 17 -> 18 [label="\\n"] is ok. --- diff --git a/re2c/print.cc b/re2c/print.cc index 22aa7c7c..8394cc4d 100644 --- a/re2c/print.cc +++ b/re2c/print.cc @@ -75,35 +75,35 @@ void prtCh(std::ostream& o, uint c) break; case '\n': - o << "\\n"; + o << (DFlag ? "\\\\n" : "\\n"); break; case '\t': - o << "\\t"; + o << (DFlag ? "\\\\t" : "\\t"); break; case '\v': - o << "\\v"; + o << (DFlag ? "\\\\v" : "\\v"); break; case '\b': - o << "\\b"; + o << (DFlag ? "\\\\b" : "\\b"); break; case '\r': - o << "\\r"; + o << (DFlag ? "\\\\r" : "\\r"); break; case '\f': - o << "\\f"; + o << (DFlag ? "\\\\f" : "\\f"); break; case '\a': - o << "\\a"; + o << (DFlag ? "\\\\a" :"\\a"); break; case '\\': - o << "\\\\"; + o << (DFlag ? "\\\\\\\\" : "\\\\"); break; default: