We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82cdb3f commit 63c0a27Copy full SHA for 63c0a27
include/cql2cpp/tree_dot.h
@@ -11,6 +11,7 @@
11
#pragma once
12
13
#include <ostream>
14
+#include <regex>
15
16
#include "ast_node.h"
17
@@ -34,9 +35,11 @@ class Tree2Dot {
34
35
return true;
36
}
37
- static bool GenerateDot(std::ostream& ous, const AstNodePtr node, const std::string& title) {
38
+ static bool GenerateDot(std::ostream& ous, const AstNodePtr node,
39
+ const std::string& title) {
40
ous << "digraph G {" << std::endl;
- ous << "label=\"" << title << "\";";
41
+ ous << "label=\"" << std::regex_replace(title, std::regex("\""), "\\\"")
42
+ << "\";";
43
ous << "labelloc = top;";
44
GenerateDotNode(ous, node);
45
ous << std::endl;
0 commit comments