Browse Source

cppparser: fix escaping of string literals in preprocessor mode

[skip ci]
rdb 1 year ago
parent
commit
bddb7cb262
1 changed files with 5 additions and 1 deletions
  1. 5 1
      dtool/src/cppparser/cppToken.cxx

+ 5 - 1
dtool/src/cppparser/cppToken.cxx

@@ -736,7 +736,11 @@ output_code(std::ostream &out) const {
         break;
 
       case '\'':
-        out << "\\\'";
+        out << (_token == CHAR_TOK ? "\\\'" : "'");
+        break;
+
+      case '"':
+        out << (_token == CHAR_TOK ? "\"" : "\\\"");
         break;
 
       case '\\':