From a4e272d2c8dce821852f1068b48817e1d6fba470 Mon Sep 17 00:00:00 2001 From: Bastiaan van der Plaat Date: Fri, 15 Sep 2023 19:49:07 +0200 Subject: [PATCH] GMLCompiler: Fix bug where backslash in escaped sequence was preserved --- Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp index bdcd1f4005..06c84b7b21 100644 --- a/Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp @@ -145,10 +145,10 @@ static ErrorOr escape_string(JsonValue to_escape) // All C++ simple escape sequences; see https://en.cppreference.com/w/cpp/language/escape // Other commonly-escaped characters are hard-to-type Unicode and therefore fine to include verbatim in UTF-8 coded strings. static HashMap escape_sequences = { + { "\\"sv, "\\\\"sv }, // This needs to be the first because otherwise the the backslashes of other items will be double escaped { "\0"sv, "\\0"sv }, { "\'"sv, "\\'"sv }, { "\""sv, "\\\""sv }, - { "\\"sv, "\\\\"sv }, { "\a"sv, "\\a"sv }, { "\b"sv, "\\b"sv }, { "\f"sv, "\\f"sv },