1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

json2: unescape characters (#6836)

This commit is contained in:
Anton Zavodchikov
2020-11-15 17:58:17 +05:00
committed by GitHub
parent c8b7cfc297
commit fe3d2a9aba
3 changed files with 71 additions and 12 deletions

View File

@@ -7,7 +7,11 @@ import strings
fn write_value(v Any, i int, len int, mut wr strings.Builder) {
str := v.str()
wr.write(if v is string { '"$str"' } else { str })
if v is string {
wr.write('"$str"')
} else {
wr.write(str)
}
if i >= len-1 { return }
wr.write_b(`,`)
}