(fix) propery escape backslashes in embed Wren source inside C (#112)

This commit is contained in:
Josh Goebel
2021-05-21 16:09:05 -07:00
committed by GitHub
parent 9c6b693372
commit 961003d7e4
3 changed files with 21 additions and 20 deletions
+1
View File
@@ -24,6 +24,7 @@ static const char* {1}ModuleSource =
def wren_to_c_string(input_path, wren_source_lines, module):
wren_source = ""
for line in wren_source_lines:
line = line.replace("\\", "\\\\")
line = line.replace('"', "\\\"")
line = line.replace("\n", "\\n\"")
if wren_source: wren_source += "\n"