decompiler: Use single quotes

This commit is contained in:
James Westman 2023-09-28 14:51:16 -05:00
parent ea92838cf3
commit 3d5a5521aa
15 changed files with 49 additions and 41 deletions

View file

@ -109,11 +109,14 @@ class UnescapeError(Exception):
def escape_quote(string: str) -> str:
return (
string.replace("\\", "\\\\")
.replace("'", "\\'")
.replace('"', '\\"')
.replace("\n", "\\n")
.replace("\t", "\\t")
"'"
+ (
string.replace("\\", "\\\\")
.replace("'", "\\'")
.replace("\n", "\\n")
.replace("\t", "\\t")
)
+ "'"
)