Fixed Issue #6929 Escape unicode when inspecting a Str (#7411)

* Fixed Issue #6929 Escape unicode when inspecting Str

added AUTHORS

improved comment

* update generated mono tests

* fixed formatting

* fixed merge conflicts
This commit is contained in:
Timon 2025-01-06 18:52:50 +01:00 committed by GitHub
parent 89ef225f5b
commit 716374cfc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 3380 additions and 1070 deletions

View file

@ -258,7 +258,14 @@ dbgStr = \s ->
custom \f0 ->
f0
|> dbgWrite "\""
|> dbgWrite s # TODO: Should we be escaping strings for dbg/logging?
|> \f1 ->
# escape invisible unicode characters as in fmt_str_body crates/compiler/fmt/src/expr.rs
escapeS =
Str.replaceEach s "\u(feff)" "\\u(feff)"
|> Str.replaceEach "\u(200b)" "\\u(200b)"
|> Str.replaceEach "\u(200c)" "\\u(200c)"
|> Str.replaceEach "\u(200d)" "\\u(200d)"
dbgWrite f1 escapeS
|> dbgWrite "\""
dbgOpaque : * -> Inspector DbgFormatter