Commit c93b6a4b authored by Kirill Smelkov's avatar Kirill Smelkov

xfmt += Qpycb - quote byte as Python would do for a single-character string

This continues c0bbd06e (xfmt: Qpy & friends to quote string the way
Python would do).
parent 79e328c5
...@@ -118,3 +118,11 @@ func (b *Buffer) Qpyb(x []byte) *Buffer { ...@@ -118,3 +118,11 @@ func (b *Buffer) Qpyb(x []byte) *Buffer {
*b = AppendQuotePyBytes(*b, x) *b = AppendQuotePyBytes(*b, x)
return b return b
} }
// TODO Qpyc?
// Qpycb appends byte quoted as Python would do for a single-character string
func (b *Buffer) Qpycb(c byte) *Buffer {
*b = AppendQuotePyBytes(*b, []byte{c}) // does not escape
return b
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment