Uh oh!
There was an error while loading. Please reload this page.
builtin: Implement builtin_ascii - #66
Conversation
corona10
commented
Jul 26, 2019
@ncw |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## master #66 +/- ##
==========================================
+ Coverage 68.45% 68.63% +0.18%
==========================================
Files 59 59 Lines 10495 10512 +17 ==========================================
+ Hits 7184 7215 +31 + Misses 2804 2789 -15 - Partials 507 508 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ncw
left a comment
There was a problem hiding this comment.
See inline for adapting an existing function to do this
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
corona10
commented
Jul 28, 2019
@ncw |
corona10
commented
Jul 28, 2019
I've found this code does not work well. >>>ascii('\U+10001')
"'\\U00010001'" |
corona10
commented
Jul 31, 2019
@ncw If there is something I missed. Please let me know! funcstringEscape(a py.String) string {
s:=string(a)
varout bytes.Bufferfor_, c:=ranges {
switch {
casec<0x20:
switchc {
case'\t':
out.WriteString(`\t`)
case'\n':
out.WriteString(`\n`)
case'\r':
out.WriteString(`\r`)
default:
out.WriteRune(c)
}
casec<0x100:
out.WriteRune(c)
casec<0x10000:
fmt.Fprintf(&out, "\\u%04x", c)
default:
fmt.Fprintf(&out, "\\U%08x", c)
}
}
returnout.String()
} |
ncw
commented
Aug 4, 2019
LGTM - thank you - please merge :-) |
Implement builtin_ascii