go-json/encode_vm_escaped_indent.go

7943 lines
217 KiB
Go
Raw Normal View History

2021-01-10 23:16:37 +03:00
package json
import (
"bytes"
"encoding"
"fmt"
"math"
"reflect"
"sort"
"unsafe"
)
func (e *Encoder) runEscapedIndent(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte, error) {
recursiveLevel := 0
var seenPtr map[uintptr]struct{}
ptrOffset := uintptr(0)
ctxptr := ctx.ptr()
for {
switch code.op {
default:
return nil, fmt.Errorf("failed to handle opcode. doesn't implement %s", code.op)
2021-01-11 13:05:06 +03:00
case opPtr:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
code = code.next
store(ctxptr, code.idx, e.ptrToPtr(ptr))
2021-01-11 13:05:06 +03:00
case opInt:
2021-01-10 23:16:37 +03:00
b = appendInt(b, int64(e.ptrToInt(load(ctxptr, code.idx))))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInt8:
2021-01-10 23:16:37 +03:00
b = appendInt(b, int64(e.ptrToInt8(load(ctxptr, code.idx))))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInt16:
2021-01-10 23:16:37 +03:00
b = appendInt(b, int64(e.ptrToInt16(load(ctxptr, code.idx))))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInt32:
2021-01-10 23:16:37 +03:00
b = appendInt(b, int64(e.ptrToInt32(load(ctxptr, code.idx))))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInt64:
2021-01-10 23:16:37 +03:00
b = appendInt(b, e.ptrToInt64(load(ctxptr, code.idx)))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint:
2021-01-10 23:16:37 +03:00
b = appendUint(b, uint64(e.ptrToUint(load(ctxptr, code.idx))))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint8:
2021-01-10 23:16:37 +03:00
b = appendUint(b, uint64(e.ptrToUint8(load(ctxptr, code.idx))))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint16:
2021-01-10 23:16:37 +03:00
b = appendUint(b, uint64(e.ptrToUint16(load(ctxptr, code.idx))))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint32:
2021-01-10 23:16:37 +03:00
b = appendUint(b, uint64(e.ptrToUint32(load(ctxptr, code.idx))))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint64:
2021-01-10 23:16:37 +03:00
b = appendUint(b, e.ptrToUint64(load(ctxptr, code.idx)))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opIntString:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt(load(ctxptr, code.idx))))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInt8String:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt8(load(ctxptr, code.idx))))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInt16String:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt16(load(ctxptr, code.idx))))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInt32String:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt32(load(ctxptr, code.idx))))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInt64String:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendInt(b, e.ptrToInt64(load(ctxptr, code.idx)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUintString:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint(load(ctxptr, code.idx))))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint8String:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint8(load(ctxptr, code.idx))))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint16String:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint16(load(ctxptr, code.idx))))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint32String:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint32(load(ctxptr, code.idx))))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opUint64String:
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = appendUint(b, e.ptrToUint64(load(ctxptr, code.idx)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opFloat32:
2021-01-10 23:16:37 +03:00
b = encodeFloat32(b, e.ptrToFloat32(load(ctxptr, code.idx)))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opFloat64:
2021-01-10 23:16:37 +03:00
v := e.ptrToFloat64(load(ctxptr, code.idx))
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opString:
2021-01-10 23:16:37 +03:00
b = encodeEscapedString(b, e.ptrToString(load(ctxptr, code.idx)))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opBool:
2021-01-10 23:16:37 +03:00
b = encodeBool(b, e.ptrToBool(load(ctxptr, code.idx)))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opBytes:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
slice := e.ptrToSlice(ptr)
if ptr == 0 || uintptr(slice.data) == 0 {
b = encodeNull(b)
} else {
b = encodeByteSlice(b, e.ptrToBytes(ptr))
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opInterface:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.next
break
}
if seenPtr == nil {
seenPtr = map[uintptr]struct{}{}
}
if _, exists := seenPtr[ptr]; exists {
return nil, errUnsupportedValue(code, ptr)
}
seenPtr[ptr] = struct{}{}
v := e.ptrToInterface(code, ptr)
ctx.keepRefs = append(ctx.keepRefs, unsafe.Pointer(&v))
rv := reflect.ValueOf(v)
if rv.IsNil() {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.next
break
}
vv := rv.Interface()
header := (*interfaceHeader)(unsafe.Pointer(&vv))
typ := header.typ
if typ.Kind() == reflect.Ptr {
typ = typ.Elem()
}
var c *opcode
if typ.Kind() == reflect.Map {
code, err := e.compileMap(&encodeCompileContext{
typ: typ,
root: code.root,
indent: code.indent,
structTypeToCompiledCode: map[uintptr]*compiledCode{},
}, false)
if err != nil {
return nil, err
}
c = code
} else {
code, err := e.compile(&encodeCompileContext{
typ: typ,
root: code.root,
indent: code.indent,
structTypeToCompiledCode: map[uintptr]*compiledCode{},
})
if err != nil {
return nil, err
}
c = code
}
beforeLastCode := c.beforeLastCode()
lastCode := beforeLastCode.next
lastCode.idx = beforeLastCode.idx + uintptrSize
totalLength := uintptr(code.totalLength())
nextTotalLength := uintptr(c.totalLength())
curlen := uintptr(len(ctx.ptrs))
offsetNum := ptrOffset / uintptrSize
oldOffset := ptrOffset
ptrOffset += totalLength * uintptrSize
newLen := offsetNum + totalLength + nextTotalLength
if curlen < newLen {
ctx.ptrs = append(ctx.ptrs, make([]uintptr, newLen-curlen)...)
}
ctxptr = ctx.ptr() + ptrOffset // assign new ctxptr
store(ctxptr, 0, uintptr(header.ptr))
store(ctxptr, lastCode.idx, oldOffset)
// link lastCode ( opInterfaceEnd ) => code.next
2021-01-11 13:05:06 +03:00
lastCode.op = opInterfaceEnd
2021-01-10 23:16:37 +03:00
lastCode.next = code.next
code = c
recursiveLevel++
2021-01-11 13:05:06 +03:00
case opInterfaceEnd:
2021-01-10 23:16:37 +03:00
recursiveLevel--
// restore ctxptr
offset := load(ctxptr, code.idx)
ctxptr = ctx.ptr() + offset
ptrOffset = offset
code = code.next
2021-01-11 13:05:06 +03:00
case opMarshalJSON:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
v := e.ptrToInterface(code, ptr)
bb, err := v.(Marshaler).MarshalJSON()
if err != nil {
return nil, errMarshaler(code, err)
}
if len(bb) == 0 {
return nil, errUnexpectedEndOfJSON(
fmt.Sprintf("error calling MarshalJSON for type %s", code.typ),
0,
)
}
var buf bytes.Buffer
if err := encodeWithIndent(
&buf,
bb,
string(e.prefix)+string(bytes.Repeat(e.indentStr, code.indent)),
string(e.indentStr),
); err != nil {
return nil, err
}
b = append(b, buf.Bytes()...)
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:05:06 +03:00
case opMarshalText:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
isPtr := code.typ.Kind() == reflect.Ptr
p := e.ptrToUnsafePtr(ptr)
if p == nil {
b = encodeNull(b)
b = encodeIndentComma(b)
} else if isPtr && *(*unsafe.Pointer)(p) == nil {
b = append(b, '"', '"', ',', '\n')
} else {
if isPtr && code.typ.Elem().Implements(marshalTextType) {
p = *(*unsafe.Pointer)(p)
}
v := *(*interface{})(unsafe.Pointer(&interfaceHeader{
typ: code.typ,
ptr: p,
}))
bytes, err := v.(encoding.TextMarshaler).MarshalText()
if err != nil {
return nil, errMarshaler(code, err)
}
b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
b = encodeIndentComma(b)
}
code = code.next
2021-01-11 13:05:06 +03:00
case opSliceHead:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
slice := e.ptrToSlice(p)
store(ctxptr, code.elemIdx, 0)
store(ctxptr, code.length, uintptr(slice.len))
store(ctxptr, code.idx, uintptr(slice.data))
if slice.len > 0 {
b = append(b, '[', '\n')
b = e.encodeIndent(b, code.indent+1)
code = code.next
store(ctxptr, code.idx, uintptr(slice.data))
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '[', ']', '\n')
code = code.end.next
}
}
2021-01-11 13:05:06 +03:00
case opRootSliceHead:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
slice := e.ptrToSlice(p)
store(ctxptr, code.elemIdx, 0)
store(ctxptr, code.length, uintptr(slice.len))
store(ctxptr, code.idx, uintptr(slice.data))
if slice.len > 0 {
b = append(b, '[', '\n')
b = e.encodeIndent(b, code.indent+1)
code = code.next
store(ctxptr, code.idx, uintptr(slice.data))
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '[', ']', ',', '\n')
code = code.end.next
}
}
2021-01-11 13:05:06 +03:00
case opSliceElem:
2021-01-10 23:16:37 +03:00
idx := load(ctxptr, code.elemIdx)
length := load(ctxptr, code.length)
idx++
if idx < length {
b = e.encodeIndent(b, code.indent+1)
store(ctxptr, code.elemIdx, idx)
data := load(ctxptr, code.headIdx)
size := code.size
code = code.next
store(ctxptr, code.idx, data+idx*size)
} else {
b = b[:len(b)-2]
b = append(b, '\n')
b = e.encodeIndent(b, code.indent)
b = append(b, ']', ',', '\n')
code = code.end.next
}
2021-01-11 13:05:06 +03:00
case opRootSliceElem:
2021-01-10 23:16:37 +03:00
idx := load(ctxptr, code.elemIdx)
length := load(ctxptr, code.length)
idx++
if idx < length {
b = e.encodeIndent(b, code.indent+1)
store(ctxptr, code.elemIdx, idx)
code = code.next
data := load(ctxptr, code.headIdx)
store(ctxptr, code.idx, data+idx*code.size)
} else {
b = append(b, '\n')
b = e.encodeIndent(b, code.indent)
b = append(b, ']')
code = code.end.next
}
2021-01-11 13:05:06 +03:00
case opArrayHead:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
if code.length > 0 {
b = append(b, '[', '\n')
b = e.encodeIndent(b, code.indent+1)
store(ctxptr, code.elemIdx, 0)
code = code.next
store(ctxptr, code.idx, p)
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '[', ']', ',', '\n')
code = code.end.next
}
}
2021-01-11 13:05:06 +03:00
case opArrayElem:
2021-01-10 23:16:37 +03:00
idx := load(ctxptr, code.elemIdx)
idx++
if idx < code.length {
b = e.encodeIndent(b, code.indent+1)
store(ctxptr, code.elemIdx, idx)
p := load(ctxptr, code.headIdx)
size := code.size
code = code.next
store(ctxptr, code.idx, p+idx*size)
} else {
b = b[:len(b)-2]
b = append(b, '\n')
b = e.encodeIndent(b, code.indent)
b = append(b, ']', ',', '\n')
code = code.end.next
}
2021-01-11 13:05:06 +03:00
case opMapHead:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
uptr := e.ptrToUnsafePtr(ptr)
mlen := maplen(uptr)
if mlen > 0 {
b = append(b, '{', '\n')
iter := mapiterinit(code.typ, uptr)
ctx.keepRefs = append(ctx.keepRefs, iter)
store(ctxptr, code.elemIdx, 0)
store(ctxptr, code.length, uintptr(mlen))
store(ctxptr, code.mapIter, uintptr(iter))
if !e.unorderedMap {
pos := make([]int, 0, mlen)
pos = append(pos, len(b))
posPtr := unsafe.Pointer(&pos)
ctx.keepRefs = append(ctx.keepRefs, posPtr)
store(ctxptr, code.end.mapPos, uintptr(posPtr))
} else {
b = e.encodeIndent(b, code.next.indent)
}
key := mapiterkey(iter)
store(ctxptr, code.next.idx, uintptr(key))
code = code.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '}', ',', '\n')
code = code.end.next
}
}
2021-01-11 13:05:06 +03:00
case opMapHeadLoad:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
code = code.end.next
} else {
// load pointer
ptr = e.ptrToPtr(ptr)
uptr := e.ptrToUnsafePtr(ptr)
if uintptr(uptr) == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
mlen := maplen(uptr)
if mlen > 0 {
b = append(b, '{', '\n')
iter := mapiterinit(code.typ, uptr)
ctx.keepRefs = append(ctx.keepRefs, iter)
store(ctxptr, code.elemIdx, 0)
store(ctxptr, code.length, uintptr(mlen))
store(ctxptr, code.mapIter, uintptr(iter))
key := mapiterkey(iter)
store(ctxptr, code.next.idx, uintptr(key))
if !e.unorderedMap {
pos := make([]int, 0, mlen)
pos = append(pos, len(b))
posPtr := unsafe.Pointer(&pos)
ctx.keepRefs = append(ctx.keepRefs, posPtr)
store(ctxptr, code.end.mapPos, uintptr(posPtr))
} else {
b = e.encodeIndent(b, code.next.indent)
}
code = code.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '}', ',', '\n')
code = code.end.next
}
}
2021-01-11 13:05:06 +03:00
case opMapKey:
2021-01-10 23:16:37 +03:00
idx := load(ctxptr, code.elemIdx)
length := load(ctxptr, code.length)
idx++
if e.unorderedMap {
if idx < length {
b = e.encodeIndent(b, code.indent)
store(ctxptr, code.elemIdx, idx)
ptr := load(ctxptr, code.mapIter)
iter := e.ptrToUnsafePtr(ptr)
key := mapiterkey(iter)
store(ctxptr, code.next.idx, uintptr(key))
code = code.next
} else {
last := len(b) - 1
b[last] = '\n'
b = e.encodeIndent(b, code.indent-1)
b = append(b, '}', ',', '\n')
code = code.end.next
}
} else {
ptr := load(ctxptr, code.end.mapPos)
posPtr := (*[]int)(*(*unsafe.Pointer)(unsafe.Pointer(&ptr)))
*posPtr = append(*posPtr, len(b))
if idx < length {
ptr := load(ctxptr, code.mapIter)
iter := e.ptrToUnsafePtr(ptr)
store(ctxptr, code.elemIdx, idx)
key := mapiterkey(iter)
store(ctxptr, code.next.idx, uintptr(key))
code = code.next
} else {
code = code.end
}
}
2021-01-11 13:05:06 +03:00
case opMapValue:
2021-01-10 23:16:37 +03:00
if e.unorderedMap {
b = append(b, ':', ' ')
} else {
ptr := load(ctxptr, code.end.mapPos)
posPtr := (*[]int)(*(*unsafe.Pointer)(unsafe.Pointer(&ptr)))
*posPtr = append(*posPtr, len(b))
}
ptr := load(ctxptr, code.mapIter)
iter := e.ptrToUnsafePtr(ptr)
value := mapitervalue(iter)
store(ctxptr, code.next.idx, uintptr(value))
mapiternext(iter)
code = code.next
2021-01-11 13:05:06 +03:00
case opMapEnd:
2021-01-10 23:16:37 +03:00
// this operation only used by sorted map
length := int(load(ctxptr, code.length))
type mapKV struct {
key string
value string
}
kvs := make([]mapKV, 0, length)
ptr := load(ctxptr, code.mapPos)
pos := *(*[]int)(*(*unsafe.Pointer)(unsafe.Pointer(&ptr)))
for i := 0; i < length; i++ {
startKey := pos[i*2]
startValue := pos[i*2+1]
var endValue int
if i+1 < length {
endValue = pos[i*2+2]
} else {
endValue = len(b)
}
kvs = append(kvs, mapKV{
key: string(b[startKey:startValue]),
value: string(b[startValue:endValue]),
})
}
sort.Slice(kvs, func(i, j int) bool {
return kvs[i].key < kvs[j].key
})
buf := b[pos[0]:]
buf = buf[:0]
for _, kv := range kvs {
buf = append(buf, e.prefix...)
buf = append(buf, bytes.Repeat(e.indentStr, code.indent+1)...)
buf = append(buf, []byte(kv.key)...)
buf[len(buf)-2] = ':'
buf[len(buf)-1] = ' '
buf = append(buf, []byte(kv.value)...)
}
buf = buf[:len(buf)-2]
buf = append(buf, '\n')
buf = append(buf, e.prefix...)
buf = append(buf, bytes.Repeat(e.indentStr, code.indent)...)
buf = append(buf, '}', ',', '\n')
b = b[:pos[0]]
b = append(b, buf...)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHead:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHead:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else if code.next == code.end {
// not exists fields
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '}', ',', '\n')
code = code.end.next
store(ctxptr, code.idx, ptr)
} else {
b = append(b, '{', '\n')
if !code.anonymousKey {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
}
p := ptr + code.offset
code = code.next
store(ctxptr, code.idx, p)
}
2021-01-13 18:02:58 +03:00
case opStructFieldPtrHeadOmitEmpty:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmpty:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '\n')
p := ptr + code.offset
if p == 0 || *(*uintptr)(*(*unsafe.Pointer)(unsafe.Pointer(&p))) == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
code = code.next
store(ctxptr, code.idx, p)
}
}
case opStructFieldHeadOnly, opStructFieldHeadStringTagOnly:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if !code.anonymousKey {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
}
p := ptr + code.offset
code = code.next
store(ctxptr, code.idx, p)
2021-01-13 18:02:58 +03:00
case opStructFieldHeadOmitEmptyOnly:
ptr := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if !code.anonymousKey && ptr != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p := ptr + code.offset
code = code.next
store(ctxptr, code.idx, p)
} else {
code = code.nextField
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadOmitEmptyInt:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyInt:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToInt(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagInt:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagInt:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadIntOnly, opStructFieldHeadIntOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt(p)))
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyIntOnly, opStructFieldHeadOmitEmptyIntOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := int64(e.ptrToInt(p))
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagIntOnly, opStructFieldHeadStringTagIntOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt(p)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadIntPtr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadIntPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyIntPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyIntPtr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt(p)))
b = encodeIndentComma(b)
}
code = code.next
}
case opStructFieldPtrHeadStringTagIntPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagIntPtr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
2021-01-13 18:02:58 +03:00
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
b = append(b, '"')
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadIntPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadIntPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyIntPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyIntPtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagIntPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagIntPtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
2021-01-13 18:02:58 +03:00
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldHeadIntNPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-13 18:02:58 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadIntOnly, opStructFieldAnonymousHeadIntOnly:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-13 18:02:58 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyIntOnly, opStructFieldAnonymousHeadOmitEmptyIntOnly:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagIntOnly, opStructFieldAnonymousHeadStringTagIntOnly:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadIntPtr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadIntPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-13 18:02:58 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyIntPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyIntPtr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt(p)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagIntPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagIntPtr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadIntPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadIntPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-13 18:02:58 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyIntPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyIntPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagIntPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagIntPtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt8:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt8:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(ptr)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-16 20:53:54 +03:00
case opStructFieldPtrHeadOmitEmptyInt8:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyInt8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToInt8(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagInt8:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagInt8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt8Only, opStructFieldHeadInt8Only:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(p)))
b = encodeIndentComma(b)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructFieldPtrHeadOmitEmptyInt8Only, opStructFieldHeadOmitEmptyInt8Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := int64(e.ptrToInt8(p))
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagInt8Only, opStructFieldHeadStringTagInt8Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt8(p)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt8Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt8Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructFieldPtrHeadOmitEmptyInt8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyInt8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(p)))
b = encodeIndentComma(b)
}
code = code.next
}
case opStructFieldPtrHeadStringTagInt8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagInt8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
b = append(b, '"')
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt8PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt8PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructFieldPtrHeadOmitEmptyInt8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyInt8PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagInt8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagInt8PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt8NPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt8:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt8:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-16 20:53:54 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt8:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt8(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt8:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt8Only, opStructFieldAnonymousHeadInt8Only:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-16 20:53:54 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt8Only, opStructFieldAnonymousHeadOmitEmptyInt8Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt8(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt8Only, opStructFieldAnonymousHeadStringTagInt8Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt8Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt8Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(p)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagInt8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt8PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt8PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagInt8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagInt8PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt8(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt16:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt16:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(ptr)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-17 16:06:16 +03:00
case opStructFieldPtrHeadOmitEmptyInt16:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyInt16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToInt16(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagInt16:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagInt16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt16Only, opStructFieldHeadInt16Only:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(p)))
b = encodeIndentComma(b)
code = code.next
2021-01-17 16:06:16 +03:00
case opStructFieldPtrHeadOmitEmptyInt16Only, opStructFieldHeadOmitEmptyInt16Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := int64(e.ptrToInt16(p))
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagInt16Only, opStructFieldHeadStringTagInt16Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt16(p)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt16Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt16Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-17 16:06:16 +03:00
case opStructFieldPtrHeadOmitEmptyInt16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyInt16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(p)))
b = encodeIndentComma(b)
}
code = code.next
}
case opStructFieldPtrHeadStringTagInt16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagInt16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
b = append(b, '"')
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt16PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt16PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-17 16:06:16 +03:00
case opStructFieldPtrHeadOmitEmptyInt16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyInt16PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagInt16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagInt16PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt16NPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt16:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt16:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-17 16:06:16 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt16:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt16(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt16:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt16Only, opStructFieldAnonymousHeadInt16Only:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-17 16:06:16 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt16Only, opStructFieldAnonymousHeadOmitEmptyInt16Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt16(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt16Only, opStructFieldAnonymousHeadStringTagInt16Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt16Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt16Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-17 16:06:16 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(p)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagInt16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt16PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt16PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-17 16:06:16 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagInt16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagInt16PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt16(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt32:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(ptr)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-18 15:50:52 +03:00
case opStructFieldPtrHeadOmitEmptyInt32:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyInt32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToInt32(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagInt32:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagInt32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt32Only, opStructFieldHeadInt32Only:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(p)))
b = encodeIndentComma(b)
code = code.next
2021-01-18 15:50:52 +03:00
case opStructFieldPtrHeadOmitEmptyInt32Only, opStructFieldHeadOmitEmptyInt32Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := int64(e.ptrToInt32(p))
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagInt32Only, opStructFieldHeadStringTagInt32Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt32(p)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt32Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt32Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-18 15:50:52 +03:00
case opStructFieldPtrHeadOmitEmptyInt32Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyInt32Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(p)))
b = encodeIndentComma(b)
}
code = code.next
}
case opStructFieldPtrHeadStringTagInt32Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagInt32Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
b = append(b, '"')
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-18 15:50:52 +03:00
case opStructFieldPtrHeadOmitEmptyInt32PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyInt32PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagInt32PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagInt32PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt32NPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt32:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-18 15:50:52 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt32:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt32(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt32:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt32Only, opStructFieldAnonymousHeadInt32Only:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-18 15:50:52 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt32Only, opStructFieldAnonymousHeadOmitEmptyInt32Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt32(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt32Only, opStructFieldAnonymousHeadStringTagInt32Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt32Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt32Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-18 15:50:52 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt32Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt32Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(p)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagInt32Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt32Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
2021-01-18 15:50:52 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt32PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt32PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagInt32PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagInt32PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt32(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt64:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(ptr))
b = encodeIndentComma(b)
code = code.next
}
2021-01-18 16:35:10 +03:00
case opStructFieldPtrHeadOmitEmptyInt64:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyInt64:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToInt64(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagInt64:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagInt64:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt64Only, opStructFieldHeadInt64Only:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(p))
b = encodeIndentComma(b)
code = code.next
2021-01-18 16:35:10 +03:00
case opStructFieldPtrHeadOmitEmptyInt64Only, opStructFieldHeadOmitEmptyInt64Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := e.ptrToInt64(p)
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagInt64Only, opStructFieldHeadStringTagInt64Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, e.ptrToInt64(p))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt64Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt64Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, e.ptrToInt64(p+code.offset))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-18 16:35:10 +03:00
case opStructFieldPtrHeadOmitEmptyInt64Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyInt64Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(p))
b = encodeIndentComma(b)
}
code = code.next
}
case opStructFieldPtrHeadStringTagInt64Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagInt64Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, e.ptrToInt64(p+code.offset))
b = append(b, '"')
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadInt64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, e.ptrToInt64(p+code.offset))
}
b = encodeIndentComma(b)
code = code.next
2021-01-18 16:35:10 +03:00
case opStructFieldPtrHeadOmitEmptyInt64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyInt64PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(p+code.offset))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagInt64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagInt64PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, e.ptrToInt64(p+code.offset))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldHeadInt64NPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, e.ptrToInt64(p+code.offset))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt64:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
}
2021-01-18 16:35:10 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt64:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt64:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt64(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt64:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt64:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt64Only, opStructFieldAnonymousHeadInt64Only:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
}
2021-01-18 16:35:10 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt64Only, opStructFieldAnonymousHeadOmitEmptyInt64Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToInt64(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagInt64Only, opStructFieldAnonymousHeadStringTagInt64Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt64Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt64Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, e.ptrToInt64(p+code.offset))
}
b = encodeIndentComma(b)
code = code.next
2021-01-18 16:35:10 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt64Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt64Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(p))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagInt64Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagInt64Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, e.ptrToInt64(p+code.offset))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadInt64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadInt64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, e.ptrToInt64(p+code.offset))
}
b = encodeIndentComma(b)
code = code.next
2021-01-18 16:35:10 +03:00
case opStructFieldPtrAnonymousHeadOmitEmptyInt64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyInt64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(p+code.offset))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagInt64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagInt64PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, e.ptrToInt64(p+code.offset))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadUint:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadUint:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadOmitEmptyUint:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyUint:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToUint(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagUint:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagUint:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadUintOnly, opStructFieldHeadUintOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(p)))
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUintOnly, opStructFieldHeadOmitEmptyUintOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := uint64(e.ptrToUint(p))
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagUintOnly, opStructFieldHeadStringTagUintOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint(p)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadUintPtr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadUintPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUintPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyUintPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(p)))
b = encodeIndentComma(b)
}
code = code.next
2021-01-10 23:16:37 +03:00
}
case opStructFieldPtrHeadStringTagUintPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagUintPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
2021-01-10 23:16:37 +03:00
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
2021-01-10 23:16:37 +03:00
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUintPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadUintPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
2021-01-10 23:16:37 +03:00
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUintPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyUintPtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
case opStructFieldPtrHeadStringTagUintPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagUintPtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldHeadUintNPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
2021-01-10 23:16:37 +03:00
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadUint:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadUint:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUint:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
2021-01-10 23:16:37 +03:00
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadUintOnly, opStructFieldAnonymousHeadUintOnly:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUintOnly, opStructFieldAnonymousHeadOmitEmptyUintOnly:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUintOnly, opStructFieldAnonymousHeadStringTagUintOnly:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadUintPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadUintPtr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUintPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUintPtr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(p)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUintPtr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUintPtr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadUintPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadUintPtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUintPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUintPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUintPtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagUintPtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint8:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadUint8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(ptr)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadOmitEmptyUint8:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyUint8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToUint8(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagUint8:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagUint8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadUint8Only, opStructFieldHeadUint8Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(p)))
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint8Only, opStructFieldHeadOmitEmptyUint8Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := uint64(e.ptrToUint8(p))
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagUint8Only, opStructFieldHeadStringTagUint8Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint8(p)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadUint8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyUint8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(p)))
b = encodeIndentComma(b)
}
code = code.next
}
case opStructFieldPtrHeadStringTagUint8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagUint8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
b = append(b, '"')
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadUint8PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyUint8PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagUint8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagUint8PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldHeadUint8NPtr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadUint8:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadUint8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint8:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint8(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint8:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUint8:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadUint8Only, opStructFieldAnonymousHeadUint8Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint8Only, opStructFieldAnonymousHeadOmitEmptyUint8Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint8(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint8Only, opStructFieldAnonymousHeadStringTagUint8Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadUint8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadUint8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUint8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(p)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUint8Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUint8Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadUint8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadUint8PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUint8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUint8PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagUint8PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint8(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint16:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadUint16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(ptr)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadOmitEmptyUint16:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyUint16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToUint16(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagUint16:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagUint16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadUint16Only, opStructFieldHeadUint16Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(p)))
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint16Only, opStructFieldHeadOmitEmptyUint16Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := uint64(e.ptrToUint16(p))
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagUint16Only, opStructFieldHeadStringTagUint16Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint16(p)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadUint16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyUint16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(p)))
b = encodeIndentComma(b)
}
code = code.next
}
case opStructFieldPtrHeadStringTagUint16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagUint16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
b = append(b, '"')
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadUint16PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyUint16PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagUint16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagUint16PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldHeadUint16NPtr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadUint16:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadUint16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint16:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint16(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint16:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
2021-01-10 23:16:37 +03:00
fallthrough
case opStructFieldAnonymousHeadStringTagUint16:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadUint16Only, opStructFieldAnonymousHeadUint16Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint16Only, opStructFieldAnonymousHeadOmitEmptyUint16Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint16(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint16Only, opStructFieldAnonymousHeadStringTagUint16Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadUint16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadUint16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUint16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(p)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUint16Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUint16Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadUint16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadUint16PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUint16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint16PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUint16PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagUint16PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint16(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint32:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadUint32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(ptr)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadOmitEmptyUint32:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyUint32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToUint32(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrHeadStringTagUint32:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagUint32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadUint32Only, opStructFieldHeadUint32Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(p)))
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint32Only, opStructFieldHeadOmitEmptyUint32Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := uint64(e.ptrToUint32(p))
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldPtrHeadStringTagUint32Only, opStructFieldHeadStringTagUint32Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
2021-01-10 23:16:37 +03:00
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint32(p)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint32Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadUint32Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
}
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint32Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
2021-01-10 23:16:37 +03:00
fallthrough
case opStructFieldHeadOmitEmptyUint32Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
2021-01-10 23:16:37 +03:00
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(p)))
b = encodeIndentComma(b)
}
code = code.next
2021-01-10 23:16:37 +03:00
}
case opStructFieldPtrHeadStringTagUint32Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagUint32Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
2021-01-10 23:16:37 +03:00
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
2021-01-10 23:16:37 +03:00
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
b = append(b, '"')
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint32PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.end.next
break
2021-01-10 23:16:37 +03:00
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadUint32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
}
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyUint32PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
case opStructFieldPtrHeadStringTagUint32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagUint32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldHeadUint32NPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
2021-01-10 23:16:37 +03:00
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadUint32:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadUint32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint32:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint32(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint32:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUint32:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadUint32Only, opStructFieldAnonymousHeadUint32Only:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint32Only, opStructFieldAnonymousHeadOmitEmptyUint32Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint32(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint32Only, opStructFieldAnonymousHeadStringTagUint32Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadUint32Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadUint32Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUint32Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint32Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(p)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUint32Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUint32Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadUint32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadUint32PtrOnly:
p := load(ctxptr, code.idx)
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUint32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint32PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUint32PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagUint32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint32(p+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint64:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadUint64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(ptr))
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrHeadOmitEmptyUint64:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
2021-01-10 23:16:37 +03:00
fallthrough
case opStructFieldHeadOmitEmptyUint64:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
2021-01-10 23:16:37 +03:00
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToUint64(ptr + code.offset)
if v == 0 {
code = code.nextField
2021-01-10 23:16:37 +03:00
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
code = code.next
2021-01-10 23:16:37 +03:00
}
}
case opStructFieldPtrHeadStringTagUint64:
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTagUint64:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
2021-01-10 23:16:37 +03:00
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-10 23:16:37 +03:00
}
case opStructFieldPtrHeadUint64Only, opStructFieldHeadUint64Only:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(p))
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint64Only, opStructFieldHeadOmitEmptyUint64Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
v := e.ptrToUint64(p)
if v != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
case opStructFieldPtrHeadStringTagUint64Only, opStructFieldHeadStringTagUint64Only:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, e.ptrToUint64(p))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint64Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadUint64Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
2021-01-10 23:16:37 +03:00
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
2021-01-10 23:16:37 +03:00
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, e.ptrToUint64(p+code.offset))
2021-01-10 23:16:37 +03:00
}
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint64Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadOmitEmptyUint64Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p = e.ptrToPtr(p)
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(p))
b = encodeIndentComma(b)
}
2021-01-10 23:16:37 +03:00
code = code.next
}
case opStructFieldPtrHeadStringTagUint64Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldHeadStringTagUint64Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, e.ptrToUint64(p+code.offset))
b = append(b, '"')
}
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadUint64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadUint64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
2021-01-10 23:16:37 +03:00
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, e.ptrToUint64(p+code.offset))
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadOmitEmptyUint64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadOmitEmptyUint64PtrOnly:
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
if p != 0 {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(p+code.offset))
b = encodeIndentComma(b)
}
2021-01-10 23:16:37 +03:00
code = code.next
case opStructFieldPtrHeadStringTagUint64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldHeadStringTagUint64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = appendUint(b, e.ptrToUint64(p+code.offset))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldHeadUint64NPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, e.ptrToUint64(p+code.offset))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadUint64:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadUint64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint64:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint64:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint64(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint64:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUint64:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.key...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadUint64Only, opStructFieldAnonymousHeadUint64Only:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadOmitEmptyUint64Only, opStructFieldAnonymousHeadOmitEmptyUint64Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
v := e.ptrToUint64(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
code = code.next
}
}
case opStructFieldPtrAnonymousHeadStringTagUint64Only, opStructFieldAnonymousHeadStringTagUint64Only:
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = append(b, '"')
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadUint64Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadUint64Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, e.ptrToUint64(p+code.offset))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUint64Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint64Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
p = e.ptrToPtr(p)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(p))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUint64Ptr:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
case opStructFieldAnonymousHeadStringTagUint64Ptr:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, e.ptrToUint64(p+code.offset))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadUint64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadUint64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, e.ptrToUint64(p+code.offset))
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadOmitEmptyUint64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadOmitEmptyUint64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(p+code.offset))
b = encodeIndentComma(b)
code = code.next
}
case opStructFieldPtrAnonymousHeadStringTagUint64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
case opStructFieldAnonymousHeadStringTagUint64PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, e.ptrToUint64(p+code.offset))
b = append(b, '"')
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadFloat32:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadFloat32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat32(b, e.ptrToFloat32(ptr))
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadFloat32Only, opStructFieldHeadFloat32Only:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat32(b, e.ptrToFloat32(p))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadFloat32Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadFloat32Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = encodeFloat32(b, e.ptrToFloat32(p))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadFloat32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadFloat32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = encodeFloat32(b, e.ptrToFloat32(p))
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldHeadFloat32NPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
b = encodeFloat32(b, e.ptrToFloat32(p))
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadFloat32:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadFloat32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat32(b, e.ptrToFloat32(ptr))
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadFloat32Only, opStructFieldAnonymousHeadFloat32Only:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat32(b, e.ptrToFloat32(ptr))
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadFloat32Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadFloat32Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
b = encodeFloat32(b, e.ptrToFloat32(p))
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadFloat32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadFloat32PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
b = encodeFloat32(b, e.ptrToFloat32(p))
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadFloat64:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadFloat64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
v := e.ptrToFloat64(ptr)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat64(b, v)
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadFloat64Only, opStructFieldHeadFloat64Only:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
v := e.ptrToFloat64(p)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadFloat64Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadFloat64Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
} else {
v := e.ptrToFloat64(p)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadFloat64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
break
}
store(ctxptr, code.idx, e.ptrToPtr(p))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadFloat64PtrOnly:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = encodeNull(b)
} else {
v := e.ptrToFloat64(p)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldHeadFloat64NPtr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
for i := 0; i < code.ptrNum; i++ {
if p == 0 {
break
}
p = e.ptrToPtr(p)
}
if p == 0 {
b = encodeNull(b)
} else {
v := e.ptrToFloat64(p)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
}
}
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadFloat64:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadFloat64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
v := e.ptrToFloat64(ptr)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadFloat64Only, opStructFieldAnonymousHeadFloat64Only:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
v := e.ptrToFloat64(ptr)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrAnonymousHeadFloat64Ptr:
2021-01-10 23:16:37 +03:00
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldAnonymousHeadFloat64Ptr:
2021-01-10 23:16:37 +03:00
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p = e.ptrToPtr(p)
if p == 0 {
b = encodeNull(b)
2021-01-10 23:16:37 +03:00
} else {
v := e.ptrToFloat64(p)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
2021-01-10 23:16:37 +03:00
}
b = encodeFloat64(b, v)
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrAnonymousHeadFloat64PtrOnly:
p := load(ctxptr, code.idx)
if p == 0 {
code = code.end.next
break
2021-01-10 23:16:37 +03:00
}
store(ctxptr, code.idx, e.ptrToPtr(p))
2021-01-10 23:16:37 +03:00
fallthrough
case opStructFieldAnonymousHeadFloat64PtrOnly:
p := load(ctxptr, code.idx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
2021-01-10 23:16:37 +03:00
b = encodeNull(b)
} else {
v := e.ptrToFloat64(p)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
2021-01-10 23:16:37 +03:00
}
b = encodeFloat64(b, v)
2021-01-10 23:16:37 +03:00
}
b = encodeIndentComma(b)
code = code.next
case opStructFieldPtrHeadString:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
2021-01-10 23:16:37 +03:00
fallthrough
case opStructFieldHeadString:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeEscapedString(b, e.ptrToString(ptr))
b = encodeIndentComma(b)
code = code.next
2021-01-10 23:16:37 +03:00
}
case opStructFieldPtrHeadBool:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
2021-01-10 23:16:37 +03:00
fallthrough
case opStructFieldHeadBool:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeBool(b, e.ptrToBool(ptr))
b = encodeIndentComma(b)
code = code.next
2021-01-10 23:16:37 +03:00
}
case opStructFieldPtrHeadBytes:
store(ctxptr, code.idx, e.ptrToPtr(load(ctxptr, code.idx)))
2021-01-10 23:16:37 +03:00
fallthrough
case opStructFieldHeadBytes:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeByteSlice(b, e.ptrToBytes(ptr))
b = encodeIndentComma(b)
code = code.next
2021-01-10 23:16:37 +03:00
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadOmitEmptyFloat32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadOmitEmptyFloat32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '\n')
v := e.ptrToFloat32(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat32(b, v)
b = encodeIndentComma(b)
code = code.next
}
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadOmitEmptyFloat64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadOmitEmptyFloat64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '\n')
v := e.ptrToFloat64(ptr + code.offset)
if v == 0 {
code = code.nextField
} else {
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat64(b, v)
b = encodeIndentComma(b)
code = code.next
}
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadOmitEmptyString:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadOmitEmptyString:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '\n')
v := e.ptrToString(ptr + code.offset)
if v == "" {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeEscapedString(b, v)
b = encodeIndentComma(b)
code = code.next
}
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadOmitEmptyBool:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadOmitEmptyBool:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, '{', '\n')
v := e.ptrToBool(ptr + code.offset)
if !v {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeBool(b, v)
b = encodeIndentComma(b)
code = code.next
}
2021-01-10 23:16:37 +03:00
}
case opStructFieldPtrHeadOmitEmptyBytes:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadOmitEmptyBytes:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = e.encodeIndent(b, code.indent)
2021-01-10 23:16:37 +03:00
b = append(b, '{', '\n')
v := e.ptrToBytes(ptr + code.offset)
if len(v) == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeByteSlice(b, v)
b = encodeIndentComma(b)
code = code.next
}
2021-01-10 23:16:37 +03:00
}
case opStructFieldPtrHeadStringTag:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
case opStructFieldHeadStringTag:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
p := ptr + code.offset
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-10 23:16:37 +03:00
code = code.next
store(ctxptr, code.idx, p)
2021-01-10 23:16:37 +03:00
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadStringTagFloat32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadStringTagFloat32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = encodeFloat32(b, e.ptrToFloat32(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadStringTagFloat64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadStringTagFloat64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
v := e.ptrToFloat64(ptr + code.offset)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = encodeFloat64(b, v)
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadStringTagString:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadStringTagString:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
s := e.ptrToString(ptr + code.offset)
b = encodeEscapedString(b, string(encodeEscapedString([]byte{}, s)))
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadStringTagBool:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadStringTagBool:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = encodeBool(b, e.ptrToBool(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldPtrHeadStringTagBytes:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr != 0 {
store(ctxptr, code.idx, e.ptrToPtr(ptr))
}
fallthrough
2021-01-11 13:21:30 +03:00
case opStructFieldHeadStringTagBytes:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.idx)
if ptr == 0 {
b = e.encodeIndent(b, code.indent)
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.end.next
} else {
b = append(b, '{', '\n')
b = e.encodeIndent(b, code.indent+1)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeByteSlice(b, e.ptrToBytes(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructField:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
code = code.next
store(ctxptr, code.idx, p)
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmpty:
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
if p == 0 || **(**uintptr)(unsafe.Pointer(&p)) == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
code = code.next
store(ctxptr, code.idx, p)
}
case opStructFieldStringTag:
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
code = code.next
store(ctxptr, code.idx, p)
2021-01-11 13:21:30 +03:00
case opStructFieldInt:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructFieldOmitEmptyInt:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToInt(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagInt:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldInt8:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructFieldOmitEmptyInt8:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToInt8(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagInt8:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldInt16:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyInt16:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToInt16(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagInt16:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldInt32:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyInt32:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToInt32(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagInt32:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldInt64:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyInt64:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToInt64(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagInt64:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldUint:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyUint:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToUint(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagUint:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldUint8:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyUint8:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToUint8(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagUint8:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldUint16:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyUint16:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToUint16(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagUint16:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldUint32:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyUint32:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToUint32(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagUint32:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldUint64:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyUint64:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToUint64(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagUint64:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldFloat32:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = encodeFloat32(b, e.ptrToFloat32(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyFloat32:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToFloat32(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat32(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagFloat32:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = encodeFloat32(b, e.ptrToFloat32(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldFloat64:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
v := e.ptrToFloat64(ptr + code.offset)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyFloat64:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToFloat64(ptr + code.offset)
if v != 0 {
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat64(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagFloat64:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToFloat64(ptr + code.offset)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = encodeFloat64(b, v)
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldString:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = encodeEscapedString(b, e.ptrToString(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyString:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToString(ptr + code.offset)
if v != "" {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeEscapedString(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagString:
ptr := load(ctxptr, code.headIdx)
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-17 09:49:34 +03:00
s := e.ptrToString(ptr + code.offset)
b = encodeEscapedString(b, string(encodeEscapedString([]byte{}, s)))
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldBool:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = encodeBool(b, e.ptrToBool(ptr+code.offset))
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyBool:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToBool(ptr + code.offset)
if v {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeBool(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagBool:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = encodeBool(b, e.ptrToBool(ptr+code.offset))
b = append(b, '"')
b = encodeIndentComma(b)
code = code.next
case opStructFieldBytes:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = encodeByteSlice(b, e.ptrToBytes(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
case opStructFieldOmitEmptyBytes:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToBytes(ptr + code.offset)
if len(v) > 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeByteSlice(b, v)
b = encodeIndentComma(b)
}
code = code.next
case opStructFieldStringTagBytes:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeByteSlice(b, e.ptrToBytes(ptr+code.offset))
b = encodeIndentComma(b)
code = code.next
case opStructFieldMarshalJSON:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
v := e.ptrToInterface(code, p)
2021-01-10 23:16:37 +03:00
bb, err := v.(Marshaler).MarshalJSON()
if err != nil {
return nil, errMarshaler(code, err)
}
var buf bytes.Buffer
if err := compact(&buf, bb, e.enabledHTMLEscape); err != nil {
return nil, err
}
b = append(b, buf.Bytes()...)
b = encodeIndentComma(b)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructFieldStringTagMarshalJSON:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p := ptr + code.offset
v := e.ptrToInterface(code, p)
bb, err := v.(Marshaler).MarshalJSON()
if err != nil {
return nil, errMarshaler(code, err)
}
var buf bytes.Buffer
if err := compact(&buf, bb, e.enabledHTMLEscape); err != nil {
return nil, err
}
b = encodeEscapedString(b, buf.String())
b = encodeIndentComma(b)
code = code.next
case opStructFieldStringTagMarshalText:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p := ptr + code.offset
v := e.ptrToInterface(code, p)
bytes, err := v.(encoding.TextMarshaler).MarshalText()
if err != nil {
return nil, errMarshaler(code, err)
}
b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
b = encodeIndentComma(b)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructFieldArray:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
array := e.ptrToSlice(p)
if p == 0 || uintptr(array.data) == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.nextField
} else {
code = code.next
}
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyArray:
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
array := e.ptrToSlice(p)
if p == 0 || uintptr(array.data) == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldSlice:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
slice := e.ptrToSlice(p)
if p == 0 || uintptr(slice.data) == 0 {
b = encodeNull(b)
b = encodeIndentComma(b)
code = code.nextField
} else {
code = code.next
}
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptySlice:
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
slice := e.ptrToSlice(p)
if p == 0 || uintptr(slice.data) == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
code = code.next
}
2021-01-11 13:21:30 +03:00
case opStructFieldMap:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
if p == 0 {
b = encodeNull(b)
code = code.nextField
} else {
p = e.ptrToPtr(p)
mlen := maplen(e.ptrToUnsafePtr(p))
if mlen == 0 {
b = append(b, '{', '}', ',', '\n')
mapCode := code.next
code = mapCode.end.next
} else {
code = code.next
}
}
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyMap:
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
if p == 0 {
code = code.nextField
} else {
mlen := maplen(**(**unsafe.Pointer)(unsafe.Pointer(&p)))
if mlen == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
code = code.next
}
}
2021-01-11 13:21:30 +03:00
case opStructFieldMapLoad:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
if p == 0 {
b = encodeNull(b)
code = code.nextField
} else {
p = e.ptrToPtr(p)
mlen := maplen(e.ptrToUnsafePtr(p))
if mlen == 0 {
b = append(b, '{', '}', ',', '\n')
code = code.nextField
} else {
code = code.next
}
}
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyMapLoad:
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
if p == 0 {
code = code.nextField
} else {
mlen := maplen(**(**unsafe.Pointer)(unsafe.Pointer(&p)))
if mlen == 0 {
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
code = code.next
}
}
2021-01-11 13:21:30 +03:00
case opStructFieldStruct:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
if p == 0 {
b = append(b, '{', '}', ',', '\n')
code = code.nextField
} else {
headCode := code.next
if headCode.next == headCode.end {
// not exists fields
b = append(b, '{', '}', ',', '\n')
code = code.nextField
} else {
code = code.next
store(ctxptr, code.idx, p)
}
}
2021-01-17 09:49:34 +03:00
case opStructFieldOmitEmptyStruct:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
2021-01-17 09:49:34 +03:00
if p == 0 {
2021-01-10 23:16:37 +03:00
code = code.nextField
} else {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-17 09:49:34 +03:00
headCode := code.next
if headCode.next == headCode.end {
// not exists fields
b = append(b, '{', '}', ',', '\n')
code = code.nextField
} else {
code = code.next
store(ctxptr, code.idx, p)
}
2021-01-10 23:16:37 +03:00
}
2021-01-17 09:49:34 +03:00
case opStructAnonymousEnd:
code = code.next
case opStructEnd:
last := len(b) - 1
if b[last-1] == '{' {
b[last] = '}'
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
2021-01-17 09:49:34 +03:00
code = code.next
break
}
if b[last] == '\n' {
// to remove ',' and '\n' characters
b = b[:len(b)-2]
2021-01-10 23:16:37 +03:00
}
2021-01-17 09:49:34 +03:00
b = append(b, '\n')
b = e.encodeIndent(b, code.indent)
b = append(b, '}')
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndInt:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
case opStructEndOmitEmptyInt:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToInt(ptr + code.offset)
2021-01-10 23:16:37 +03:00
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
2021-01-17 09:49:34 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagInt:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt(ptr+code.offset)))
b = append(b, '"')
b = e.appendStructEndIndent(b, code.indent-1)
2021-01-10 23:16:37 +03:00
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndIntPtr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt(p)))
2021-01-10 23:16:37 +03:00
}
2021-01-17 09:49:34 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
2021-01-10 23:16:37 +03:00
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyIntPtr:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-17 09:49:34 +03:00
b = appendInt(b, int64(e.ptrToInt(p)))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
2021-01-10 23:16:37 +03:00
b = encodeIndentComma(b)
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagIntPtr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
2021-01-13 18:02:58 +03:00
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt(p)))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructEndInt8:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructEndOmitEmptyInt8:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToInt8(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagInt8:
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt8(ptr+code.offset)))
b = append(b, '"')
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructEndInt8Ptr:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt8(p)))
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-16 20:53:54 +03:00
case opStructEndOmitEmptyInt8Ptr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt8(p)))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagInt8Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt8(p)))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndInt16:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
case opStructEndOmitEmptyInt16:
ptr := load(ctxptr, code.headIdx)
v := e.ptrToInt16(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
2021-01-17 16:06:16 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
2021-01-17 09:49:34 +03:00
}
code = code.next
case opStructEndStringTagInt16:
ptr := load(ctxptr, code.headIdx)
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ', '"')
2021-01-10 23:16:37 +03:00
b = appendInt(b, int64(e.ptrToInt16(ptr+code.offset)))
2021-01-17 09:49:34 +03:00
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructEndInt16Ptr:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = appendInt(b, int64(e.ptrToInt16(p)))
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 16:06:16 +03:00
case opStructEndOmitEmptyInt16Ptr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt16(p)))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagInt16Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt16(p)))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructEndInt32:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyInt32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToInt32(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(v))
2021-01-18 15:50:52 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagInt32:
ptr := load(ctxptr, code.headIdx)
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ', '"')
b = appendInt(b, int64(e.ptrToInt32(ptr+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndInt32Ptr:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
2021-01-17 09:49:34 +03:00
b = appendInt(b, int64(e.ptrToInt32(p)))
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
2021-01-18 15:50:52 +03:00
code = code.next
case opStructEndOmitEmptyInt32Ptr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, int64(e.ptrToInt32(p)))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagInt32Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, int64(e.ptrToInt32(p)))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
2021-01-10 23:16:37 +03:00
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndInt64:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyInt64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToInt64(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, v)
2021-01-18 16:35:10 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagInt64:
ptr := load(ctxptr, code.headIdx)
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ', '"')
b = appendInt(b, e.ptrToInt64(ptr+code.offset))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndInt64Ptr:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
2021-01-17 09:49:34 +03:00
b = appendInt(b, e.ptrToInt64(p))
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-18 16:35:10 +03:00
case opStructEndOmitEmptyInt64Ptr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendInt(b, e.ptrToInt64(p))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagInt64Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendInt(b, e.ptrToInt64(p))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyUint:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToUint(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagUint:
ptr := load(ctxptr, code.headIdx)
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint(ptr+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUintPtr:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
2021-01-17 09:49:34 +03:00
b = appendUint(b, uint64(e.ptrToUint(p)))
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
case opStructEndOmitEmptyUintPtr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint(p)))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagUintPtr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint(p)))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint8:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyUint8:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToUint8(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagUint8:
ptr := load(ctxptr, code.headIdx)
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint8(ptr+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint8Ptr:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
2021-01-17 09:49:34 +03:00
b = appendUint(b, uint64(e.ptrToUint8(p)))
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
case opStructEndOmitEmptyUint8Ptr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint8(p)))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagUint8Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint8(p)))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint16:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyUint16:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToUint16(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(v))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagUint16:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint16(ptr+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint16Ptr:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint16(p)))
}
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
case opStructEndOmitEmptyUint16Ptr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint16(p)))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagUint16Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint16(p)))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint32:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyUint32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToUint32(ptr + code.offset)
2021-01-10 23:16:37 +03:00
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-17 09:49:34 +03:00
b = appendUint(b, uint64(v))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagUint32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, uint64(e.ptrToUint32(ptr+code.offset)))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint32Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, uint64(e.ptrToUint32(p)))
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
case opStructEndOmitEmptyUint32Ptr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, uint64(e.ptrToUint32(p)))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagUint32Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, uint64(e.ptrToUint32(p)))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint64:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyUint64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToUint64(ptr + code.offset)
2021-01-10 23:16:37 +03:00
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-17 09:49:34 +03:00
b = appendUint(b, v)
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
2021-01-10 23:16:37 +03:00
}
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagUint64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = appendUint(b, e.ptrToUint64(ptr+code.offset))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndUint64Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = appendUint(b, e.ptrToUint64(p))
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
case opStructEndOmitEmptyUint64Ptr:
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = appendUint(b, e.ptrToUint64(p))
b = e.appendStructEndIndent(b, code.indent-1)
} else {
last := len(b) - 1
if b[last-1] == '{' {
// doesn't exist any fields
b[last] = '}'
} else {
b = append(b, '}')
}
b = encodeIndentComma(b)
}
code = code.next
case opStructEndStringTagUint64Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = append(b, '"')
b = appendUint(b, e.ptrToUint64(p))
b = append(b, '"')
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndFloat32:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = encodeFloat32(b, e.ptrToFloat32(ptr+code.offset))
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructEndOmitEmptyFloat32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
v := e.ptrToFloat32(ptr + code.offset)
if v != 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeFloat32(b, v)
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagFloat32:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
b = encodeFloat32(b, e.ptrToFloat32(ptr+code.offset))
b = append(b, '"')
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndFloat32Ptr:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
b = encodeFloat32(b, e.ptrToFloat32(p))
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndFloat64:
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToFloat64(ptr + code.offset)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
2021-01-10 23:16:37 +03:00
}
2021-01-17 09:49:34 +03:00
b = encodeFloat64(b, v)
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyFloat64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToFloat64(ptr + code.offset)
if v != 0 {
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-17 09:49:34 +03:00
b = encodeFloat64(b, v)
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagFloat64:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToFloat64(ptr + code.offset)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
2021-01-17 09:49:34 +03:00
b = encodeFloat64(b, v)
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndFloat64Ptr:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
p := e.ptrToPtr(ptr + code.offset)
if p == 0 {
b = encodeNull(b)
} else {
v := e.ptrToFloat64(p)
if math.IsInf(v, 0) || math.IsNaN(v) {
return nil, errUnsupportedFloat(v)
}
b = encodeFloat64(b, v)
}
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndString:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = encodeEscapedString(b, e.ptrToString(ptr+code.offset))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyString:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToString(ptr + code.offset)
if v != "" {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeEscapedString(b, v)
}
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagString:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ')
s := e.ptrToString(ptr + code.offset)
b = encodeEscapedString(b, string(encodeEscapedString([]byte{}, s)))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndBool:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = encodeBool(b, e.ptrToBool(ptr+code.offset))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyBool:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToBool(ptr + code.offset)
if v {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeBool(b, v)
}
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagBool:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ', '"')
2021-01-17 09:49:34 +03:00
b = encodeBool(b, e.ptrToBool(ptr+code.offset))
2021-01-10 23:16:37 +03:00
b = append(b, '"')
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndBytes:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
2021-01-17 09:49:34 +03:00
b = append(b, ' ')
ptr := load(ctxptr, code.headIdx)
b = encodeByteSlice(b, e.ptrToBytes(ptr+code.offset))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndOmitEmptyBytes:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
2021-01-17 09:49:34 +03:00
v := e.ptrToBytes(ptr + code.offset)
if len(v) > 0 {
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
b = encodeByteSlice(b, v)
2021-01-10 23:16:37 +03:00
}
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndStringTagBytes:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-17 09:49:34 +03:00
b = encodeByteSlice(b, e.ptrToBytes(ptr+code.offset))
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-17 09:49:34 +03:00
case opStructEndMarshalJSON:
2021-01-10 23:16:37 +03:00
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
2021-01-17 09:49:34 +03:00
ptr := load(ctxptr, code.headIdx)
p := ptr + code.offset
v := e.ptrToInterface(code, p)
bb, err := v.(Marshaler).MarshalJSON()
if err != nil {
return nil, errMarshaler(code, err)
}
var buf bytes.Buffer
if err := compact(&buf, bb, e.enabledHTMLEscape); err != nil {
return nil, err
}
b = append(b, buf.Bytes()...)
2021-01-10 23:16:37 +03:00
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructEndStringTagMarshalJSON:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p := ptr + code.offset
v := e.ptrToInterface(code, p)
bb, err := v.(Marshaler).MarshalJSON()
if err != nil {
return nil, errMarshaler(code, err)
}
var buf bytes.Buffer
if err := compact(&buf, bb, e.enabledHTMLEscape); err != nil {
return nil, err
}
b = encodeEscapedString(b, buf.String())
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
2021-01-11 13:21:30 +03:00
case opStructEndStringTagMarshalText:
2021-01-10 23:16:37 +03:00
ptr := load(ctxptr, code.headIdx)
b = e.encodeIndent(b, code.indent)
b = append(b, code.escapedKey...)
b = append(b, ' ')
p := ptr + code.offset
v := e.ptrToInterface(code, p)
bytes, err := v.(encoding.TextMarshaler).MarshalText()
if err != nil {
return nil, errMarshaler(code, err)
}
b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
b = e.appendStructEndIndent(b, code.indent-1)
code = code.next
case opEnd:
goto END
}
}
END:
return b, nil
}