mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
decompiler: Use single quotes
This commit is contained in:
parent
ea92838cf3
commit
3d5a5521aa
15 changed files with 49 additions and 41 deletions
|
@ -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")
|
||||
)
|
||||
+ "'"
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue