diff --git a/cmd/generator/main.go b/cmd/generator/main.go index c9a19ed..4bd38c8 100644 --- a/cmd/generator/main.go +++ b/cmd/generator/main.go @@ -281,6 +281,7 @@ func (t opType) fieldToStringTagField() opType { "array", "map", "mapLoad", "slice", "struct", "MarshalJSON", "MarshalText", "recursive", "intString", "uintString", "intPtr", "uintPtr", "float32Ptr", "float64Ptr", "boolPtr", "stringPtr", "bytesPtr", + "arrayPtr", "slicePtr", "mapPtr", "intNPtr", "uintNPtr", "float32NPtr", "float64NPtr", "boolNPtr", "stringNPtr", "bytesNPtr", } primitiveTypesUpper := []string{} diff --git a/cover_helper_test.go b/cover_helper_test.go index 8094230..2106513 100644 --- a/cover_helper_test.go +++ b/cover_helper_test.go @@ -19,6 +19,7 @@ func float32ptr(v float32) *float32 { return &v } func float64ptr(v float64) *float64 { return &v } func stringptr(v string) *string { return &v } func boolptr(v bool) *bool { return &v } +func sliceptr(v []int) *[]int { return &v } func encodeByEncodingJSON(data interface{}, indent, escape bool) string { var buf bytes.Buffer diff --git a/cover_slice_test.go b/cover_slice_test.go new file mode 100644 index 0000000..c4c5078 --- /dev/null +++ b/cover_slice_test.go @@ -0,0 +1,1807 @@ +package json_test + +import ( + "bytes" + "fmt" + "testing" + + "github.com/goccy/go-json" +) + +func TestCoverSlice(t *testing.T) { + type structSlice struct { + A []int `json:"a"` + } + type structSliceOmitEmpty struct { + A []int `json:"a,omitempty"` + } + type structSliceString struct { + A []int `json:"a,string"` + } + type structSlicePtr struct { + A *[]int `json:"a"` + } + type structSlicePtrOmitEmpty struct { + A *[]int `json:"a,omitempty"` + } + type structSlicePtrString struct { + A *[]int `json:"a,string"` + } + + type structSlicePtrContent struct { + A []*int `json:"a"` + } + type structSliceOmitEmptyPtrContent struct { + A []*int `json:"a,omitempty"` + } + type structSliceStringPtrContent struct { + A []*int `json:"a,string"` + } + type structSlicePtrPtrContent struct { + A *[]*int `json:"a"` + } + type structSlicePtrOmitEmptyPtrContent struct { + A *[]*int `json:"a,omitempty"` + } + type structSlicePtrStringPtrContent struct { + A *[]*int `json:"a,string"` + } + + tests := []struct { + name string + data interface{} + }{ + // HeadSliceZero + { + name: "HeadSliceZero", + data: struct { + A []int `json:"a"` + }{}, + }, + { + name: "HeadSliceZeroOmitEmpty", + data: struct { + A []int `json:"a,omitempty"` + }{}, + }, + { + name: "HeadSliceZeroString", + data: struct { + A []int `json:"a,string"` + }{}, + }, + + // HeadSlice + { + name: "HeadSlice", + data: struct { + A []int `json:"a"` + }{A: []int{-1}}, + }, + { + name: "HeadSliceOmitEmpty", + data: struct { + A []int `json:"a,omitempty"` + }{A: []int{-1}}, + }, + { + name: "HeadSliceString", + data: struct { + A []int `json:"a,string"` + }{A: []int{-1}}, + }, + + // HeadSlicePtr + { + name: "HeadSlicePtr", + data: struct { + A *[]int `json:"a"` + }{A: sliceptr([]int{-1})}, + }, + { + name: "HeadSlicePtrOmitEmpty", + data: struct { + A *[]int `json:"a,omitempty"` + }{A: sliceptr([]int{-1})}, + }, + { + name: "HeadSlicePtrString", + data: struct { + A *[]int `json:"a,string"` + }{A: sliceptr([]int{-1})}, + }, + + // HeadSlicePtrNil + { + name: "HeadSlicePtrNil", + data: struct { + A *[]int `json:"a"` + }{A: nil}, + }, + { + name: "HeadSlicePtrNilOmitEmpty", + data: struct { + A *[]int `json:"a,omitempty"` + }{A: nil}, + }, + { + name: "HeadSlicePtrNilString", + data: struct { + A *[]int `json:"a,string"` + }{A: nil}, + }, + + // PtrHeadSliceZero + { + name: "PtrHeadSliceZero", + data: &struct { + A []int `json:"a"` + }{}, + }, + { + name: "PtrHeadSliceZeroOmitEmpty", + data: &struct { + A []int `json:"a,omitempty"` + }{}, + }, + { + name: "PtrHeadSliceZeroString", + data: &struct { + A []int `json:"a,string"` + }{}, + }, + + // PtrHeadSlice + { + name: "PtrHeadSlice", + data: &struct { + A []int `json:"a"` + }{A: []int{-1}}, + }, + { + name: "PtrHeadSliceOmitEmpty", + data: &struct { + A []int `json:"a,omitempty"` + }{A: []int{-1}}, + }, + { + name: "PtrHeadSliceString", + data: &struct { + A []int `json:"a,string"` + }{A: []int{-1}}, + }, + + // PtrHeadSlicePtr + { + name: "PtrHeadSlicePtr", + data: &struct { + A *[]int `json:"a"` + }{A: sliceptr([]int{-1})}, + }, + { + name: "PtrHeadSlicePtrOmitEmpty", + data: &struct { + A *[]int `json:"a,omitempty"` + }{A: sliceptr([]int{-1})}, + }, + { + name: "PtrHeadSlicePtrString", + data: &struct { + A *[]int `json:"a,string"` + }{A: sliceptr([]int{-1})}, + }, + + // PtrHeadSlicePtrNil + { + name: "PtrHeadSlicePtrNil", + data: &struct { + A *[]int `json:"a"` + }{A: nil}, + }, + { + name: "PtrHeadSlicePtrNilOmitEmpty", + data: &struct { + A *[]int `json:"a,omitempty"` + }{A: nil}, + }, + { + name: "PtrHeadSlicePtrNilString", + data: &struct { + A *[]int `json:"a,string"` + }{A: nil}, + }, + + // PtrHeadSliceNil + { + name: "PtrHeadSliceNil", + data: (*struct { + A *[]int `json:"a"` + })(nil), + }, + { + name: "PtrHeadSliceNilOmitEmpty", + data: (*struct { + A *[]int `json:"a,omitempty"` + })(nil), + }, + { + name: "PtrHeadSliceNilString", + data: (*struct { + A *[]int `json:"a,string"` + })(nil), + }, + + // HeadSliceZeroMultiFields + { + name: "HeadSliceZeroMultiFields", + data: struct { + A []int `json:"a"` + B []int `json:"b"` + C []int `json:"c"` + }{}, + }, + { + name: "HeadSliceZeroMultiFieldsOmitEmpty", + data: struct { + A []int `json:"a,omitempty"` + B []int `json:"b,omitempty"` + C []int `json:"c,omitempty"` + }{}, + }, + { + name: "HeadSliceZeroMultiFields", + data: struct { + A []int `json:"a,string"` + B []int `json:"b,string"` + C []int `json:"c,string"` + }{}, + }, + + // HeadSliceMultiFields + { + name: "HeadSliceMultiFields", + data: struct { + A []int `json:"a"` + B []int `json:"b"` + C []int `json:"c"` + }{A: []int{-1}, B: []int{-2}, C: []int{-3}}, + }, + { + name: "HeadSliceMultiFieldsOmitEmpty", + data: struct { + A []int `json:"a,omitempty"` + B []int `json:"b,omitempty"` + C []int `json:"c,omitempty"` + }{A: []int{-1}, B: []int{-2}, C: []int{-3}}, + }, + { + name: "HeadSliceMultiFieldsString", + data: struct { + A []int `json:"a,string"` + B []int `json:"b,string"` + C []int `json:"c,string"` + }{A: []int{-1}, B: []int{-2}, C: []int{-3}}, + }, + + // HeadSlicePtrMultiFields + { + name: "HeadSlicePtrMultiFields", + data: struct { + A *[]int `json:"a"` + B *[]int `json:"b"` + C *[]int `json:"c"` + }{A: sliceptr([]int{-1}), B: sliceptr([]int{-2}), C: sliceptr([]int{-3})}, + }, + { + name: "HeadSlicePtrMultiFieldsOmitEmpty", + data: struct { + A *[]int `json:"a,omitempty"` + B *[]int `json:"b,omitempty"` + C *[]int `json:"c,omitempty"` + }{A: sliceptr([]int{-1}), B: sliceptr([]int{-2}), C: sliceptr([]int{-3})}, + }, + { + name: "HeadSlicePtrMultiFieldsString", + data: struct { + A *[]int `json:"a,string"` + B *[]int `json:"b,string"` + C *[]int `json:"c,string"` + }{A: sliceptr([]int{-1}), B: sliceptr([]int{-2}), C: sliceptr([]int{-3})}, + }, + + // HeadSlicePtrNilMultiFields + { + name: "HeadSlicePtrNilMultiFields", + data: struct { + A *[]int `json:"a"` + B *[]int `json:"b"` + C *[]int `json:"c"` + }{A: nil, B: nil, C: nil}, + }, + { + name: "HeadSlicePtrNilMultiFieldsOmitEmpty", + data: struct { + A *[]int `json:"a,omitempty"` + B *[]int `json:"b,omitempty"` + C *[]int `json:"c,omitempty"` + }{A: nil, B: nil, C: nil}, + }, + { + name: "HeadSlicePtrNilMultiFieldsString", + data: struct { + A *[]int `json:"a,string"` + B *[]int `json:"b,string"` + C *[]int `json:"c,string"` + }{A: nil, B: nil, C: nil}, + }, + + // PtrHeadSliceZeroMultiFields + { + name: "PtrHeadSliceZeroMultiFields", + data: &struct { + A []int `json:"a"` + B []int `json:"b"` + }{}, + }, + { + name: "PtrHeadSliceZeroMultiFieldsOmitEmpty", + data: &struct { + A []int `json:"a,omitempty"` + B []int `json:"b,omitempty"` + }{}, + }, + { + name: "PtrHeadSliceZeroMultiFieldsString", + data: &struct { + A []int `json:"a,string"` + B []int `json:"b,string"` + }{}, + }, + + // PtrHeadSliceMultiFields + { + name: "PtrHeadSliceMultiFields", + data: &struct { + A []int `json:"a"` + B []int `json:"b"` + }{A: []int{-1}, B: nil}, + }, + { + name: "PtrHeadSliceMultiFieldsOmitEmpty", + data: &struct { + A []int `json:"a,omitempty"` + B []int `json:"b,omitempty"` + }{A: []int{-1}, B: nil}, + }, + { + name: "PtrHeadSliceMultiFieldsString", + data: &struct { + A []int `json:"a,string"` + B []int `json:"b,string"` + }{A: []int{-1}, B: nil}, + }, + + // PtrHeadSlicePtrMultiFields + { + name: "PtrHeadSlicePtrMultiFields", + data: &struct { + A *[]int `json:"a"` + B *[]int `json:"b"` + }{A: sliceptr([]int{-1}), B: sliceptr([]int{-2})}, + }, + { + name: "PtrHeadSlicePtrMultiFieldsOmitEmpty", + data: &struct { + A *[]int `json:"a,omitempty"` + B *[]int `json:"b,omitempty"` + }{A: sliceptr([]int{-1}), B: sliceptr([]int{-2})}, + }, + { + name: "PtrHeadSlicePtrMultiFieldsString", + data: &struct { + A *[]int `json:"a,string"` + B *[]int `json:"b,string"` + }{A: sliceptr([]int{-1}), B: sliceptr([]int{-2})}, + }, + + // PtrHeadSlicePtrNilMultiFields + { + name: "PtrHeadSlicePtrNilMultiFields", + data: &struct { + A *[]int `json:"a"` + B *[]int `json:"b"` + }{A: nil, B: nil}, + }, + { + name: "PtrHeadSlicePtrNilMultiFieldsOmitEmpty", + data: &struct { + A *[]int `json:"a,omitempty"` + B *[]int `json:"b,omitempty"` + }{A: nil, B: nil}, + }, + { + name: "PtrHeadSlicePtrNilMultiFieldsString", + data: &struct { + A *[]int `json:"a,string"` + B *[]int `json:"b,string"` + }{A: nil, B: nil}, + }, + + // PtrHeadSliceNilMultiFields + { + name: "PtrHeadSliceNilMultiFields", + data: (*struct { + A *[]int `json:"a"` + B *[]int `json:"b"` + })(nil), + }, + { + name: "PtrHeadSliceNilMultiFieldsOmitEmpty", + data: (*struct { + A *[]int `json:"a,omitempty"` + B *[]int `json:"b,omitempty"` + })(nil), + }, + { + name: "PtrHeadSliceNilMultiFieldsString", + data: (*struct { + A *[]int `json:"a,string"` + B *[]int `json:"b,string"` + })(nil), + }, + + // HeadSliceZeroNotRoot + { + name: "HeadSliceZeroNotRoot", + data: struct { + A struct { + A []int `json:"a"` + } + }{}, + }, + { + name: "HeadSliceZeroNotRootOmitEmpty", + data: struct { + A struct { + A []int `json:"a,omitempty"` + } + }{}, + }, + { + name: "HeadSliceZeroNotRootString", + data: struct { + A struct { + A []int `json:"a,string"` + } + }{}, + }, + + // HeadSliceNotRoot + { + name: "HeadSliceNotRoot", + data: struct { + A struct { + A []int `json:"a"` + } + }{A: struct { + A []int `json:"a"` + }{A: true}}, + }, + { + name: "HeadSliceNotRootOmitEmpty", + data: struct { + A struct { + A []int `json:"a,omitempty"` + } + }{A: struct { + A []int `json:"a,omitempty"` + }{A: true}}, + }, + { + name: "HeadSliceNotRootString", + data: struct { + A struct { + A []int `json:"a,string"` + } + }{A: struct { + A []int `json:"a,string"` + }{A: true}}, + }, + + // HeadSlicePtrNotRoot + { + name: "HeadSlicePtrNotRoot", + data: struct { + A struct { + A *[]int `json:"a"` + } + }{A: struct { + A *[]int `json:"a"` + }{sliceptr(-1)}}, + }, + { + name: "HeadSlicePtrNotRootOmitEmpty", + data: struct { + A struct { + A *[]int `json:"a,omitempty"` + } + }{A: struct { + A *[]int `json:"a,omitempty"` + }{sliceptr(-1)}}, + }, + { + name: "HeadSlicePtrNotRootString", + data: struct { + A struct { + A *[]int `json:"a,string"` + } + }{A: struct { + A *[]int `json:"a,string"` + }{sliceptr(-1)}}, + }, + + // HeadSlicePtrNilNotRoot + { + name: "HeadSlicePtrNilNotRoot", + data: struct { + A struct { + A *[]int `json:"a"` + } + }{}, + }, + { + name: "HeadSlicePtrNilNotRootOmitEmpty", + data: struct { + A struct { + A *[]int `json:"a,omitempty"` + } + }{}, + }, + { + name: "HeadSlicePtrNilNotRootString", + data: struct { + A struct { + A *[]int `json:"a,string"` + } + }{}, + }, + + // PtrHeadSliceZeroNotRoot + { + name: "PtrHeadBoolZeroNotRoot", + data: struct { + A *struct { + A bool `json:"a"` + } + }{A: new(struct { + A bool `json:"a"` + })}, + }, + { + name: "PtrHeadBoolZeroNotRootOmitEmpty", + data: struct { + A *struct { + A bool `json:"a,omitempty"` + } + }{A: new(struct { + A bool `json:"a,omitempty"` + })}, + }, + { + name: "PtrHeadBoolZeroNotRootString", + data: struct { + A *struct { + A bool `json:"a,string"` + } + }{A: new(struct { + A bool `json:"a,string"` + })}, + }, + + // PtrHeadBoolNotRoot + { + name: "PtrHeadBoolNotRoot", + data: struct { + A *struct { + A bool `json:"a"` + } + }{A: &(struct { + A bool `json:"a"` + }{A: true})}, + }, + { + name: "PtrHeadBoolNotRootOmitEmpty", + data: struct { + A *struct { + A bool `json:"a,omitempty"` + } + }{A: &(struct { + A bool `json:"a,omitempty"` + }{A: true})}, + }, + { + name: "PtrHeadBoolNotRootString", + data: struct { + A *struct { + A bool `json:"a,string"` + } + }{A: &(struct { + A bool `json:"a,string"` + }{A: true})}, + }, + + // PtrHeadBoolPtrNotRoot + { + name: "PtrHeadBoolPtrNotRoot", + data: struct { + A *struct { + A *bool `json:"a"` + } + }{A: &(struct { + A *bool `json:"a"` + }{A: boolptr(true)})}, + }, + { + name: "PtrHeadBoolPtrNotRootOmitEmpty", + data: struct { + A *struct { + A *bool `json:"a,omitempty"` + } + }{A: &(struct { + A *bool `json:"a,omitempty"` + }{A: boolptr(true)})}, + }, + { + name: "PtrHeadBoolPtrNotRootString", + data: struct { + A *struct { + A *bool `json:"a,string"` + } + }{A: &(struct { + A *bool `json:"a,string"` + }{A: boolptr(true)})}, + }, + + // PtrHeadBoolPtrNilNotRoot + { + name: "PtrHeadBoolPtrNilNotRoot", + data: struct { + A *struct { + A *bool `json:"a"` + } + }{A: &(struct { + A *bool `json:"a"` + }{A: nil})}, + }, + { + name: "PtrHeadBoolPtrNilNotRootOmitEmpty", + data: struct { + A *struct { + A *bool `json:"a,omitempty"` + } + }{A: &(struct { + A *bool `json:"a,omitempty"` + }{A: nil})}, + }, + { + name: "PtrHeadBoolPtrNilNotRootString", + data: struct { + A *struct { + A *bool `json:"a,string"` + } + }{A: &(struct { + A *bool `json:"a,string"` + }{A: nil})}, + }, + + // PtrHeadBoolNilNotRoot + { + name: "PtrHeadBoolNilNotRoot", + data: struct { + A *struct { + A *bool `json:"a"` + } + }{A: nil}, + }, + { + name: "PtrHeadBoolNilNotRootOmitEmpty", + data: struct { + A *struct { + A *bool `json:"a,omitempty"` + } `json:",omitempty"` + }{A: nil}, + }, + { + name: "PtrHeadBoolNilNotRootString", + data: struct { + A *struct { + A *bool `json:"a,string"` + } `json:",string"` + }{A: nil}, + }, + + // HeadBoolZeroMultiFieldsNotRoot + { + name: "HeadBoolZeroMultiFieldsNotRoot", + data: struct { + A struct { + A bool `json:"a"` + } + B struct { + B bool `json:"b"` + } + }{}, + }, + { + name: "HeadBoolZeroMultiFieldsNotRootOmitEmpty", + data: struct { + A struct { + A bool `json:"a,omitempty"` + } + B struct { + B bool `json:"b,omitempty"` + } + }{}, + }, + { + name: "HeadBoolZeroMultiFieldsNotRootString", + data: struct { + A struct { + A bool `json:"a,string"` + } + B struct { + B bool `json:"b,string"` + } + }{}, + }, + + // HeadBoolMultiFieldsNotRoot + { + name: "HeadBoolMultiFieldsNotRoot", + data: struct { + A struct { + A bool `json:"a"` + } + B struct { + B bool `json:"b"` + } + }{A: struct { + A bool `json:"a"` + }{A: true}, B: struct { + B bool `json:"b"` + }{B: false}}, + }, + { + name: "HeadBoolMultiFieldsNotRootOmitEmpty", + data: struct { + A struct { + A bool `json:"a,omitempty"` + } + B struct { + B bool `json:"b,omitempty"` + } + }{A: struct { + A bool `json:"a,omitempty"` + }{A: true}, B: struct { + B bool `json:"b,omitempty"` + }{B: false}}, + }, + { + name: "HeadBoolMultiFieldsNotRootString", + data: struct { + A struct { + A bool `json:"a,string"` + } + B struct { + B bool `json:"b,string"` + } + }{A: struct { + A bool `json:"a,string"` + }{A: true}, B: struct { + B bool `json:"b,string"` + }{B: false}}, + }, + + // HeadBoolPtrMultiFieldsNotRoot + { + name: "HeadBoolPtrMultiFieldsNotRoot", + data: struct { + A struct { + A *bool `json:"a"` + } + B struct { + B *bool `json:"b"` + } + }{A: struct { + A *bool `json:"a"` + }{A: boolptr(true)}, B: struct { + B *bool `json:"b"` + }{B: boolptr(false)}}, + }, + { + name: "HeadBoolPtrMultiFieldsNotRootOmitEmpty", + data: struct { + A struct { + A *bool `json:"a,omitempty"` + } + B struct { + B *bool `json:"b,omitempty"` + } + }{A: struct { + A *bool `json:"a,omitempty"` + }{A: boolptr(true)}, B: struct { + B *bool `json:"b,omitempty"` + }{B: boolptr(false)}}, + }, + { + name: "HeadBoolPtrMultiFieldsNotRootString", + data: struct { + A struct { + A *bool `json:"a,string"` + } + B struct { + B *bool `json:"b,string"` + } + }{A: struct { + A *bool `json:"a,string"` + }{A: boolptr(true)}, B: struct { + B *bool `json:"b,string"` + }{B: boolptr(false)}}, + }, + + // HeadBoolPtrNilMultiFieldsNotRoot + { + name: "HeadBoolPtrNilMultiFieldsNotRoot", + data: struct { + A struct { + A *bool `json:"a"` + } + B struct { + B *bool `json:"b"` + } + }{A: struct { + A *bool `json:"a"` + }{A: nil}, B: struct { + B *bool `json:"b"` + }{B: nil}}, + }, + { + name: "HeadBoolPtrNilMultiFieldsNotRootOmitEmpty", + data: struct { + A struct { + A *bool `json:"a,omitempty"` + } + B struct { + B *bool `json:"b,omitempty"` + } + }{A: struct { + A *bool `json:"a,omitempty"` + }{A: nil}, B: struct { + B *bool `json:"b,omitempty"` + }{B: nil}}, + }, + { + name: "HeadBoolPtrNilMultiFieldsNotRootString", + data: struct { + A struct { + A *bool `json:"a,string"` + } + B struct { + B *bool `json:"b,string"` + } + }{A: struct { + A *bool `json:"a,string"` + }{A: nil}, B: struct { + B *bool `json:"b,string"` + }{B: nil}}, + }, + + // PtrHeadBoolZeroMultiFieldsNotRoot + { + name: "PtrHeadBoolZeroMultiFieldsNotRoot", + data: &struct { + A struct { + A bool `json:"a"` + } + B struct { + B bool `json:"b"` + } + }{}, + }, + { + name: "PtrHeadBoolZeroMultiFieldsNotRootOmitEmpty", + data: &struct { + A struct { + A bool `json:"a,omitempty"` + } + B struct { + B bool `json:"b,omitempty"` + } + }{}, + }, + { + name: "PtrHeadBoolZeroMultiFieldsNotRootString", + data: &struct { + A struct { + A bool `json:"a,string"` + } + B struct { + B bool `json:"b,string"` + } + }{}, + }, + + // PtrHeadBoolMultiFieldsNotRoot + { + name: "PtrHeadBoolMultiFieldsNotRoot", + data: &struct { + A struct { + A bool `json:"a"` + } + B struct { + B bool `json:"b"` + } + }{A: struct { + A bool `json:"a"` + }{A: true}, B: struct { + B bool `json:"b"` + }{B: false}}, + }, + { + name: "PtrHeadBoolMultiFieldsNotRootOmitEmpty", + data: &struct { + A struct { + A bool `json:"a,omitempty"` + } + B struct { + B bool `json:"b,omitempty"` + } + }{A: struct { + A bool `json:"a,omitempty"` + }{A: true}, B: struct { + B bool `json:"b,omitempty"` + }{B: false}}, + }, + { + name: "PtrHeadBoolMultiFieldsNotRootString", + data: &struct { + A struct { + A bool `json:"a,string"` + } + B struct { + B bool `json:"b,string"` + } + }{A: struct { + A bool `json:"a,string"` + }{A: true}, B: struct { + B bool `json:"b,string"` + }{B: false}}, + }, + + // PtrHeadBoolPtrMultiFieldsNotRoot + { + name: "PtrHeadBoolPtrMultiFieldsNotRoot", + data: &struct { + A *struct { + A *bool `json:"a"` + } + B *struct { + B *bool `json:"b"` + } + }{A: &(struct { + A *bool `json:"a"` + }{A: boolptr(true)}), B: &(struct { + B *bool `json:"b"` + }{B: boolptr(false)})}, + }, + { + name: "PtrHeadBoolPtrMultiFieldsNotRootOmitEmpty", + data: &struct { + A *struct { + A *bool `json:"a,omitempty"` + } + B *struct { + B *bool `json:"b,omitempty"` + } + }{A: &(struct { + A *bool `json:"a,omitempty"` + }{A: boolptr(true)}), B: &(struct { + B *bool `json:"b,omitempty"` + }{B: boolptr(false)})}, + }, + { + name: "PtrHeadBoolPtrMultiFieldsNotRootString", + data: &struct { + A *struct { + A *bool `json:"a,string"` + } + B *struct { + B *bool `json:"b,string"` + } + }{A: &(struct { + A *bool `json:"a,string"` + }{A: boolptr(true)}), B: &(struct { + B *bool `json:"b,string"` + }{B: boolptr(false)})}, + }, + + // PtrHeadBoolPtrNilMultiFieldsNotRoot + { + name: "PtrHeadBoolPtrNilMultiFieldsNotRoot", + data: &struct { + A *struct { + A *bool `json:"a"` + } + B *struct { + B *bool `json:"b"` + } + }{A: nil, B: nil}, + }, + { + name: "PtrHeadBoolPtrNilMultiFieldsNotRootOmitEmpty", + data: &struct { + A *struct { + A *bool `json:"a,omitempty"` + } `json:",omitempty"` + B *struct { + B *bool `json:"b,omitempty"` + } `json:",omitempty"` + }{A: nil, B: nil}, + }, + { + name: "PtrHeadBoolPtrNilMultiFieldsNotRootString", + data: &struct { + A *struct { + A *bool `json:"a,string"` + } `json:",string"` + B *struct { + B *bool `json:"b,string"` + } `json:",string"` + }{A: nil, B: nil}, + }, + + // PtrHeadBoolNilMultiFieldsNotRoot + { + name: "PtrHeadBoolNilMultiFieldsNotRoot", + data: (*struct { + A *struct { + A *bool `json:"a"` + } + B *struct { + B *bool `json:"b"` + } + })(nil), + }, + { + name: "PtrHeadBoolNilMultiFieldsNotRootOmitEmpty", + data: (*struct { + A *struct { + A *bool `json:"a,omitempty"` + } + B *struct { + B *bool `json:"b,omitempty"` + } + })(nil), + }, + { + name: "PtrHeadBoolNilMultiFieldsNotRootString", + data: (*struct { + A *struct { + A *bool `json:"a,string"` + } + B *struct { + B *bool `json:"b,string"` + } + })(nil), + }, + + // PtrHeadBoolDoubleMultiFieldsNotRoot + { + name: "PtrHeadBoolDoubleMultiFieldsNotRoot", + data: &struct { + A *struct { + A bool `json:"a"` + B bool `json:"b"` + } + B *struct { + A bool `json:"a"` + B bool `json:"b"` + } + }{A: &(struct { + A bool `json:"a"` + B bool `json:"b"` + }{A: true, B: false}), B: &(struct { + A bool `json:"a"` + B bool `json:"b"` + }{A: true, B: false})}, + }, + { + name: "PtrHeadBoolDoubleMultiFieldsNotRootOmitEmpty", + data: &struct { + A *struct { + A bool `json:"a,omitempty"` + B bool `json:"b,omitempty"` + } + B *struct { + A bool `json:"a,omitempty"` + B bool `json:"b,omitempty"` + } + }{A: &(struct { + A bool `json:"a,omitempty"` + B bool `json:"b,omitempty"` + }{A: true, B: false}), B: &(struct { + A bool `json:"a,omitempty"` + B bool `json:"b,omitempty"` + }{A: true, B: false})}, + }, + { + name: "PtrHeadBoolDoubleMultiFieldsNotRootString", + data: &struct { + A *struct { + A bool `json:"a,string"` + B bool `json:"b,string"` + } + B *struct { + A bool `json:"a,string"` + B bool `json:"b,string"` + } + }{A: &(struct { + A bool `json:"a,string"` + B bool `json:"b,string"` + }{A: true, B: false}), B: &(struct { + A bool `json:"a,string"` + B bool `json:"b,string"` + }{A: true, B: false})}, + }, + + // PtrHeadBoolNilDoubleMultiFieldsNotRoot + { + name: "PtrHeadBoolNilDoubleMultiFieldsNotRoot", + data: &struct { + A *struct { + A bool `json:"a"` + B bool `json:"b"` + } + B *struct { + A bool `json:"a"` + B bool `json:"b"` + } + }{A: nil, B: nil}, + }, + { + name: "PtrHeadBoolNilDoubleMultiFieldsNotRootOmitEmpty", + data: &struct { + A *struct { + A bool `json:"a,omitempty"` + B bool `json:"b,omitempty"` + } `json:",omitempty"` + B *struct { + A bool `json:"a,omitempty"` + B bool `json:"b,omitempty"` + } `json:",omitempty"` + }{A: nil, B: nil}, + }, + { + name: "PtrHeadBoolNilDoubleMultiFieldsNotRootString", + data: &struct { + A *struct { + A bool `json:"a,string"` + B bool `json:"b,string"` + } + B *struct { + A bool `json:"a,string"` + B bool `json:"b,string"` + } + }{A: nil, B: nil}, + }, + + // PtrHeadBoolNilDoubleMultiFieldsNotRoot + { + name: "PtrHeadBoolNilDoubleMultiFieldsNotRoot", + data: (*struct { + A *struct { + A bool `json:"a"` + B bool `json:"b"` + } + B *struct { + A bool `json:"a"` + B bool `json:"b"` + } + })(nil), + }, + { + name: "PtrHeadBoolNilDoubleMultiFieldsNotRootOmitEmpty", + data: (*struct { + A *struct { + A bool `json:"a,omitempty"` + B bool `json:"b,omitempty"` + } + B *struct { + A bool `json:"a,omitempty"` + B bool `json:"b,omitempty"` + } + })(nil), + }, + { + name: "PtrHeadBoolNilDoubleMultiFieldsNotRootString", + data: (*struct { + A *struct { + A bool `json:"a,string"` + B bool `json:"b,string"` + } + B *struct { + A bool `json:"a,string"` + B bool `json:"b,string"` + } + })(nil), + }, + + // PtrHeadBoolPtrDoubleMultiFieldsNotRoot + { + name: "PtrHeadBoolPtrDoubleMultiFieldsNotRoot", + data: &struct { + A *struct { + A *bool `json:"a"` + B *bool `json:"b"` + } + B *struct { + A *bool `json:"a"` + B *bool `json:"b"` + } + }{A: &(struct { + A *bool `json:"a"` + B *bool `json:"b"` + }{A: boolptr(true), B: boolptr(false)}), B: &(struct { + A *bool `json:"a"` + B *bool `json:"b"` + }{A: boolptr(true), B: boolptr(false)})}, + }, + { + name: "PtrHeadBoolPtrDoubleMultiFieldsNotRootOmitEmpty", + data: &struct { + A *struct { + A *bool `json:"a,omitempty"` + B *bool `json:"b,omitempty"` + } + B *struct { + A *bool `json:"a,omitempty"` + B *bool `json:"b,omitempty"` + } + }{A: &(struct { + A *bool `json:"a,omitempty"` + B *bool `json:"b,omitempty"` + }{A: boolptr(true), B: boolptr(false)}), B: &(struct { + A *bool `json:"a,omitempty"` + B *bool `json:"b,omitempty"` + }{A: boolptr(true), B: boolptr(false)})}, + }, + { + name: "PtrHeadBoolPtrDoubleMultiFieldsNotRootString", + data: &struct { + A *struct { + A *bool `json:"a,string"` + B *bool `json:"b,string"` + } + B *struct { + A *bool `json:"a,string"` + B *bool `json:"b,string"` + } + }{A: &(struct { + A *bool `json:"a,string"` + B *bool `json:"b,string"` + }{A: boolptr(true), B: boolptr(false)}), B: &(struct { + A *bool `json:"a,string"` + B *bool `json:"b,string"` + }{A: boolptr(true), B: boolptr(false)})}, + }, + + // PtrHeadBoolPtrNilDoubleMultiFieldsNotRoot + { + name: "PtrHeadBoolPtrNilDoubleMultiFieldsNotRoot", + data: &struct { + A *struct { + A *bool `json:"a"` + B *bool `json:"b"` + } + B *struct { + A *bool `json:"a"` + B *bool `json:"b"` + } + }{A: nil, B: nil}, + }, + { + name: "PtrHeadBoolPtrNilDoubleMultiFieldsNotRootOmitEmpty", + data: &struct { + A *struct { + A *bool `json:"a,omitempty"` + B *bool `json:"b,omitempty"` + } `json:",omitempty"` + B *struct { + A *bool `json:"a,omitempty"` + B *bool `json:"b,omitempty"` + } `json:",omitempty"` + }{A: nil, B: nil}, + }, + { + name: "PtrHeadBoolPtrNilDoubleMultiFieldsNotRootString", + data: &struct { + A *struct { + A *bool `json:"a,string"` + B *bool `json:"b,string"` + } + B *struct { + A *bool `json:"a,string"` + B *bool `json:"b,string"` + } + }{A: nil, B: nil}, + }, + + // PtrHeadBoolPtrNilDoubleMultiFieldsNotRoot + { + name: "PtrHeadBoolPtrNilDoubleMultiFieldsNotRoot", + data: (*struct { + A *struct { + A *bool `json:"a"` + B *bool `json:"b"` + } + B *struct { + A *bool `json:"a"` + B *bool `json:"b"` + } + })(nil), + }, + { + name: "PtrHeadBoolPtrNilDoubleMultiFieldsNotRootOmitEmpty", + data: (*struct { + A *struct { + A *bool `json:"a,omitempty"` + B *bool `json:"b,omitempty"` + } + B *struct { + A *bool `json:"a,omitempty"` + B *bool `json:"b,omitempty"` + } + })(nil), + }, + { + name: "PtrHeadBoolPtrNilDoubleMultiFieldsNotRootString", + data: (*struct { + A *struct { + A *bool `json:"a,string"` + B *bool `json:"b,string"` + } + B *struct { + A *bool `json:"a,string"` + B *bool `json:"b,string"` + } + })(nil), + }, + /* + // AnonymousHeadBool + { + name: "AnonymousHeadBool", + data: struct { + structBool + B bool `json:"b"` + }{ + structBool: structBool{A: true}, + B: false, + }, + }, + { + name: "AnonymousHeadBoolOmitEmpty", + data: struct { + structBoolOmitEmpty + B bool `json:"b,omitempty"` + }{ + structBoolOmitEmpty: structBoolOmitEmpty{A: true}, + B: false, + }, + }, + { + name: "AnonymousHeadBoolString", + data: struct { + structBoolString + B bool `json:"b,string"` + }{ + structBoolString: structBoolString{A: true}, + B: false, + }, + }, + + // PtrAnonymousHeadBool + { + name: "PtrAnonymousHeadBool", + data: struct { + *structBool + B bool `json:"b"` + }{ + structBool: &structBool{A: true}, + B: false, + }, + }, + { + name: "PtrAnonymousHeadBoolOmitEmpty", + data: struct { + *structBoolOmitEmpty + B bool `json:"b,omitempty"` + }{ + structBoolOmitEmpty: &structBoolOmitEmpty{A: true}, + B: false, + }, + }, + { + name: "PtrAnonymousHeadBoolString", + data: struct { + *structBoolString + B bool `json:"b,string"` + }{ + structBoolString: &structBoolString{A: true}, + B: false, + }, + }, + + // NilPtrAnonymousHeadBool + { + name: "NilPtrAnonymousHeadBool", + data: struct { + *structBool + B bool `json:"b"` + }{ + structBool: nil, + B: true, + }, + }, + { + name: "NilPtrAnonymousHeadBoolOmitEmpty", + data: struct { + *structBoolOmitEmpty + B bool `json:"b,omitempty"` + }{ + structBoolOmitEmpty: nil, + B: true, + }, + }, + { + name: "NilPtrAnonymousHeadBoolString", + data: struct { + *structBoolString + B bool `json:"b,string"` + }{ + structBoolString: nil, + B: true, + }, + }, + + // AnonymousHeadBoolPtr + { + name: "AnonymousHeadBoolPtr", + data: struct { + structBoolPtr + B *bool `json:"b"` + }{ + structBoolPtr: structBoolPtr{A: boolptr(true)}, + B: boolptr(false), + }, + }, + { + name: "AnonymousHeadBoolPtrOmitEmpty", + data: struct { + structBoolPtrOmitEmpty + B *bool `json:"b,omitempty"` + }{ + structBoolPtrOmitEmpty: structBoolPtrOmitEmpty{A: boolptr(true)}, + B: boolptr(false), + }, + }, + { + name: "AnonymousHeadBoolPtrString", + data: struct { + structBoolPtrString + B *bool `json:"b,string"` + }{ + structBoolPtrString: structBoolPtrString{A: boolptr(true)}, + B: boolptr(false), + }, + }, + + // AnonymousHeadBoolPtrNil + { + name: "AnonymousHeadBoolPtrNil", + data: struct { + structBoolPtr + B *bool `json:"b"` + }{ + structBoolPtr: structBoolPtr{A: nil}, + B: boolptr(true), + }, + }, + { + name: "AnonymousHeadBoolPtrNilOmitEmpty", + data: struct { + structBoolPtrOmitEmpty + B *bool `json:"b,omitempty"` + }{ + structBoolPtrOmitEmpty: structBoolPtrOmitEmpty{A: nil}, + B: boolptr(true), + }, + }, + { + name: "AnonymousHeadBoolPtrNilString", + data: struct { + structBoolPtrString + B *bool `json:"b,string"` + }{ + structBoolPtrString: structBoolPtrString{A: nil}, + B: boolptr(true), + }, + }, + + // PtrAnonymousHeadBoolPtr + { + name: "PtrAnonymousHeadBoolPtr", + data: struct { + *structBoolPtr + B *bool `json:"b"` + }{ + structBoolPtr: &structBoolPtr{A: boolptr(true)}, + B: boolptr(false), + }, + }, + { + name: "PtrAnonymousHeadBoolPtrOmitEmpty", + data: struct { + *structBoolPtrOmitEmpty + B *bool `json:"b,omitempty"` + }{ + structBoolPtrOmitEmpty: &structBoolPtrOmitEmpty{A: boolptr(true)}, + B: boolptr(false), + }, + }, + { + name: "PtrAnonymousHeadBoolPtrString", + data: struct { + *structBoolPtrString + B *bool `json:"b,string"` + }{ + structBoolPtrString: &structBoolPtrString{A: boolptr(true)}, + B: boolptr(false), + }, + }, + + // NilPtrAnonymousHeadBoolPtr + { + name: "NilPtrAnonymousHeadBoolPtr", + data: struct { + *structBoolPtr + B *bool `json:"b"` + }{ + structBoolPtr: nil, + B: boolptr(true), + }, + }, + { + name: "NilPtrAnonymousHeadBoolPtrOmitEmpty", + data: struct { + *structBoolPtrOmitEmpty + B *bool `json:"b,omitempty"` + }{ + structBoolPtrOmitEmpty: nil, + B: boolptr(true), + }, + }, + { + name: "NilPtrAnonymousHeadBoolPtrString", + data: struct { + *structBoolPtrString + B *bool `json:"b,string"` + }{ + structBoolPtrString: nil, + B: boolptr(true), + }, + }, + + // AnonymousHeadBoolOnly + { + name: "AnonymousHeadBoolOnly", + data: struct { + structBool + }{ + structBool: structBool{A: true}, + }, + }, + { + name: "AnonymousHeadBoolOnlyOmitEmpty", + data: struct { + structBoolOmitEmpty + }{ + structBoolOmitEmpty: structBoolOmitEmpty{A: true}, + }, + }, + { + name: "AnonymousHeadBoolOnlyString", + data: struct { + structBoolString + }{ + structBoolString: structBoolString{A: true}, + }, + }, + + // PtrAnonymousHeadBoolOnly + { + name: "PtrAnonymousHeadBoolOnly", + data: struct { + *structBool + }{ + structBool: &structBool{A: true}, + }, + }, + { + name: "PtrAnonymousHeadBoolOnlyOmitEmpty", + data: struct { + *structBoolOmitEmpty + }{ + structBoolOmitEmpty: &structBoolOmitEmpty{A: true}, + }, + }, + { + name: "PtrAnonymousHeadBoolOnlyString", + data: struct { + *structBoolString + }{ + structBoolString: &structBoolString{A: true}, + }, + }, + + // NilPtrAnonymousHeadBoolOnly + { + name: "NilPtrAnonymousHeadBoolOnly", + data: struct { + *structBool + }{ + structBool: nil, + }, + }, + { + name: "NilPtrAnonymousHeadBoolOnlyOmitEmpty", + data: struct { + *structBoolOmitEmpty + }{ + structBoolOmitEmpty: nil, + }, + }, + { + name: "NilPtrAnonymousHeadBoolOnlyString", + data: struct { + *structBoolString + }{ + structBoolString: nil, + }, + }, + + // AnonymousHeadBoolPtrOnly + { + name: "AnonymousHeadBoolPtrOnly", + data: struct { + structBoolPtr + }{ + structBoolPtr: structBoolPtr{A: boolptr(true)}, + }, + }, + { + name: "AnonymousHeadBoolPtrOnlyOmitEmpty", + data: struct { + structBoolPtrOmitEmpty + }{ + structBoolPtrOmitEmpty: structBoolPtrOmitEmpty{A: boolptr(true)}, + }, + }, + { + name: "AnonymousHeadBoolPtrOnlyString", + data: struct { + structBoolPtrString + }{ + structBoolPtrString: structBoolPtrString{A: boolptr(true)}, + }, + }, + + // AnonymousHeadBoolPtrNilOnly + { + name: "AnonymousHeadBoolPtrNilOnly", + data: struct { + structBoolPtr + }{ + structBoolPtr: structBoolPtr{A: nil}, + }, + }, + { + name: "AnonymousHeadBoolPtrNilOnlyOmitEmpty", + data: struct { + structBoolPtrOmitEmpty + }{ + structBoolPtrOmitEmpty: structBoolPtrOmitEmpty{A: nil}, + }, + }, + { + name: "AnonymousHeadBoolPtrNilOnlyString", + data: struct { + structBoolPtrString + }{ + structBoolPtrString: structBoolPtrString{A: nil}, + }, + }, + + // PtrAnonymousHeadBoolPtrOnly + { + name: "PtrAnonymousHeadBoolPtrOnly", + data: struct { + *structBoolPtr + }{ + structBoolPtr: &structBoolPtr{A: boolptr(true)}, + }, + }, + { + name: "PtrAnonymousHeadBoolPtrOnlyOmitEmpty", + data: struct { + *structBoolPtrOmitEmpty + }{ + structBoolPtrOmitEmpty: &structBoolPtrOmitEmpty{A: boolptr(true)}, + }, + }, + { + name: "PtrAnonymousHeadBoolPtrOnlyString", + data: struct { + *structBoolPtrString + }{ + structBoolPtrString: &structBoolPtrString{A: boolptr(true)}, + }, + }, + + // NilPtrAnonymousHeadBoolPtrOnly + { + name: "NilPtrAnonymousHeadBoolPtrOnly", + data: struct { + *structBoolPtr + }{ + structBoolPtr: nil, + }, + }, + { + name: "NilPtrAnonymousHeadBoolPtrOnlyOmitEmpty", + data: struct { + *structBoolPtrOmitEmpty + }{ + structBoolPtrOmitEmpty: nil, + }, + }, + { + name: "NilPtrAnonymousHeadBoolPtrOnlyString", + data: struct { + *structBoolPtrString + }{ + structBoolPtrString: nil, + }, + }, + */ + } + for _, test := range tests { + for _, indent := range []bool{false} { + for _, htmlEscape := range []bool{false} { + fmt.Println(test.name) + var buf bytes.Buffer + enc := json.NewEncoder(&buf) + enc.SetEscapeHTML(htmlEscape) + if indent { + enc.SetIndent("", " ") + } + if err := enc.Encode(test.data); err != nil { + t.Fatalf("%s(htmlEscape:%v,indent:%v): %+v: %s", test.name, htmlEscape, indent, test.data, err) + } + stdresult := encodeByEncodingJSON(test.data, indent, htmlEscape) + if buf.String() != stdresult { + t.Errorf("%s(htmlEscape:%v,indent:%v): doesn't compatible with encoding/json. expected %q but got %q", test.name, htmlEscape, indent, stdresult, buf.String()) + } + } + } + } +} diff --git a/encode.go b/encode.go index 1d13270..2bd13c7 100644 --- a/encode.go +++ b/encode.go @@ -2,9 +2,12 @@ package json import ( "bytes" + "encoding" "encoding/base64" + "fmt" "io" "math" + "reflect" "strconv" "sync" "unsafe" @@ -362,3 +365,32 @@ func appendIndent(ctx *encodeRuntimeContext, b []byte, indent int) []byte { b = append(b, ctx.prefix...) return append(b, bytes.Repeat(ctx.indentStr, ctx.baseIndent+indent)...) } + +func encodeMarshalJSON(b []byte, v interface{}) ([]byte, error) { + rv := reflect.ValueOf(v) + bb, err := rv.Interface().(Marshaler).MarshalJSON() + if err != nil { + return nil, &MarshalerError{Type: rv.Type(), Err: err} + } + if len(bb) == 0 { + return nil, errUnexpectedEndOfJSON( + fmt.Sprintf("error calling MarshalJSON for type %s", rv.Type()), + 0, + ) + } + buf := bytes.NewBuffer(b) + //TODO: we should validate buffer with `compact` + if err := compact(buf, bb, false); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +func encodeMarshalText(b []byte, v interface{}) ([]byte, error) { + rv := reflect.ValueOf(v) + bytes, err := rv.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return nil, &MarshalerError{Type: rv.Type(), Err: err} + } + return encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes))), nil +} diff --git a/encode_compile.go b/encode_compile.go index 81c62f4..b211bc1 100644 --- a/encode_compile.go +++ b/encode_compile.go @@ -167,7 +167,11 @@ func encodeOptimizeStructEnd(c *opcode) { switch code.op { case opStructEnd: prev := code.prevField - if strings.Contains(prev.op.String(), "Head") { + prevOp := prev.op.String() + if strings.Contains(prevOp, "Head") || + strings.Contains(prevOp, "Slice") || + strings.Contains(prevOp, "Array") || + strings.Contains(prevOp, "Map") { // not exists field code = code.next break @@ -751,6 +755,8 @@ func encodeTypeToHeaderType(ctx *encodeCompileContext, code *opcode) opType { return opStructFieldHeadStringPtr case opBool: return opStructFieldHeadBoolPtr + case opSliceHead: + return opStructFieldHeadSlicePtr } } case opInt: @@ -834,6 +840,8 @@ func encodeTypeToFieldType(ctx *encodeCompileContext, code *opcode) opType { return opStructFieldStringPtr case opBool: return opStructFieldBoolPtr + case opSliceHead: + return opStructFieldSlicePtr } } case opInt: @@ -919,12 +927,18 @@ func encodeStructHeader(ctx *encodeCompileContext, fieldCode *opcode, valueCode opStructFieldHeadStruct, opStructFieldHeadOmitEmpty, opStructFieldHeadOmitEmptySlice, + opStructFieldHeadStringTagSlice, opStructFieldHeadOmitEmptyArray, opStructFieldHeadOmitEmptyMap, opStructFieldHeadOmitEmptyMapLoad, opStructFieldHeadOmitEmptyStruct, opStructFieldHeadStringTag: return valueCode.beforeLastCode() + case opStructFieldHeadSlicePtr, + opStructFieldHeadOmitEmptySlicePtr, + opStructFieldHeadStringTagSlicePtr: + *valueCode = *valueCode.next + return valueCode.beforeLastCode() } ctx.decOpcodeIndex() return (*opcode)(unsafe.Pointer(fieldCode)) @@ -946,12 +960,19 @@ func encodeStructField(ctx *encodeCompileContext, fieldCode *opcode, valueCode * opStructFieldStruct, opStructFieldOmitEmpty, opStructFieldOmitEmptySlice, + opStructFieldStringTagSlice, opStructFieldOmitEmptyArray, + opStructFieldStringTagArray, opStructFieldOmitEmptyMap, opStructFieldOmitEmptyMapLoad, opStructFieldOmitEmptyStruct, opStructFieldStringTag: return valueCode.beforeLastCode() + case opStructFieldSlicePtr, + opStructFieldOmitEmptySlicePtr, + opStructFieldStringTagSlicePtr: + *valueCode = *valueCode.next + return valueCode.beforeLastCode() } ctx.decIndex() return code diff --git a/encode_optype.go b/encode_optype.go index 4ca52dd..896bae2 100644 --- a/encode_optype.go +++ b/encode_optype.go @@ -22,7 +22,7 @@ const ( codeStructEnd codeType = 11 ) -var opTypeStrings = [818]string{ +var opTypeStrings = [893]string{ "End", "Interface", "Ptr", @@ -66,6 +66,9 @@ var opTypeStrings = [818]string{ "BoolPtr", "StringPtr", "BytesPtr", + "ArrayPtr", + "SlicePtr", + "MapPtr", "IntNPtr", "UintNPtr", "Float32NPtr", @@ -505,6 +508,60 @@ var opTypeStrings = [818]string{ "StructFieldNPtrAnonymousHeadBytesPtr", "StructFieldNPtrAnonymousHeadOmitEmptyBytesPtr", "StructFieldNPtrAnonymousHeadStringTagBytesPtr", + "StructFieldHeadArrayPtr", + "StructFieldHeadOmitEmptyArrayPtr", + "StructFieldHeadStringTagArrayPtr", + "StructFieldAnonymousHeadArrayPtr", + "StructFieldAnonymousHeadOmitEmptyArrayPtr", + "StructFieldAnonymousHeadStringTagArrayPtr", + "StructFieldPtrHeadArrayPtr", + "StructFieldPtrHeadOmitEmptyArrayPtr", + "StructFieldPtrHeadStringTagArrayPtr", + "StructFieldPtrAnonymousHeadArrayPtr", + "StructFieldPtrAnonymousHeadOmitEmptyArrayPtr", + "StructFieldPtrAnonymousHeadStringTagArrayPtr", + "StructFieldNPtrHeadArrayPtr", + "StructFieldNPtrHeadOmitEmptyArrayPtr", + "StructFieldNPtrHeadStringTagArrayPtr", + "StructFieldNPtrAnonymousHeadArrayPtr", + "StructFieldNPtrAnonymousHeadOmitEmptyArrayPtr", + "StructFieldNPtrAnonymousHeadStringTagArrayPtr", + "StructFieldHeadSlicePtr", + "StructFieldHeadOmitEmptySlicePtr", + "StructFieldHeadStringTagSlicePtr", + "StructFieldAnonymousHeadSlicePtr", + "StructFieldAnonymousHeadOmitEmptySlicePtr", + "StructFieldAnonymousHeadStringTagSlicePtr", + "StructFieldPtrHeadSlicePtr", + "StructFieldPtrHeadOmitEmptySlicePtr", + "StructFieldPtrHeadStringTagSlicePtr", + "StructFieldPtrAnonymousHeadSlicePtr", + "StructFieldPtrAnonymousHeadOmitEmptySlicePtr", + "StructFieldPtrAnonymousHeadStringTagSlicePtr", + "StructFieldNPtrHeadSlicePtr", + "StructFieldNPtrHeadOmitEmptySlicePtr", + "StructFieldNPtrHeadStringTagSlicePtr", + "StructFieldNPtrAnonymousHeadSlicePtr", + "StructFieldNPtrAnonymousHeadOmitEmptySlicePtr", + "StructFieldNPtrAnonymousHeadStringTagSlicePtr", + "StructFieldHeadMapPtr", + "StructFieldHeadOmitEmptyMapPtr", + "StructFieldHeadStringTagMapPtr", + "StructFieldAnonymousHeadMapPtr", + "StructFieldAnonymousHeadOmitEmptyMapPtr", + "StructFieldAnonymousHeadStringTagMapPtr", + "StructFieldPtrHeadMapPtr", + "StructFieldPtrHeadOmitEmptyMapPtr", + "StructFieldPtrHeadStringTagMapPtr", + "StructFieldPtrAnonymousHeadMapPtr", + "StructFieldPtrAnonymousHeadOmitEmptyMapPtr", + "StructFieldPtrAnonymousHeadStringTagMapPtr", + "StructFieldNPtrHeadMapPtr", + "StructFieldNPtrHeadOmitEmptyMapPtr", + "StructFieldNPtrHeadStringTagMapPtr", + "StructFieldNPtrAnonymousHeadMapPtr", + "StructFieldNPtrAnonymousHeadOmitEmptyMapPtr", + "StructFieldNPtrAnonymousHeadStringTagMapPtr", "StructFieldHeadIntNPtr", "StructFieldHeadOmitEmptyIntNPtr", "StructFieldHeadStringTagIntNPtr", @@ -721,6 +778,15 @@ var opTypeStrings = [818]string{ "StructFieldBytesPtr", "StructFieldOmitEmptyBytesPtr", "StructFieldStringTagBytesPtr", + "StructFieldArrayPtr", + "StructFieldOmitEmptyArrayPtr", + "StructFieldStringTagArrayPtr", + "StructFieldSlicePtr", + "StructFieldOmitEmptySlicePtr", + "StructFieldStringTagSlicePtr", + "StructFieldMapPtr", + "StructFieldOmitEmptyMapPtr", + "StructFieldStringTagMapPtr", "StructFieldIntNPtr", "StructFieldOmitEmptyIntNPtr", "StructFieldStringTagIntNPtr", @@ -817,6 +883,15 @@ var opTypeStrings = [818]string{ "StructEndBytesPtr", "StructEndOmitEmptyBytesPtr", "StructEndStringTagBytesPtr", + "StructEndArrayPtr", + "StructEndOmitEmptyArrayPtr", + "StructEndStringTagArrayPtr", + "StructEndSlicePtr", + "StructEndOmitEmptySlicePtr", + "StructEndStringTagSlicePtr", + "StructEndMapPtr", + "StructEndOmitEmptyMapPtr", + "StructEndStringTagMapPtr", "StructEndIntNPtr", "StructEndOmitEmptyIntNPtr", "StructEndStringTagIntNPtr", @@ -889,785 +964,860 @@ const ( opBoolPtr opType = 40 opStringPtr opType = 41 opBytesPtr opType = 42 - opIntNPtr opType = 43 - opUintNPtr opType = 44 - opFloat32NPtr opType = 45 - opFloat64NPtr opType = 46 - opBoolNPtr opType = 47 - opStringNPtr opType = 48 - opBytesNPtr opType = 49 - opStructFieldHeadInt opType = 50 - opStructFieldHeadOmitEmptyInt opType = 51 - opStructFieldHeadStringTagInt opType = 52 - opStructFieldAnonymousHeadInt opType = 53 - opStructFieldAnonymousHeadOmitEmptyInt opType = 54 - opStructFieldAnonymousHeadStringTagInt opType = 55 - opStructFieldPtrHeadInt opType = 56 - opStructFieldPtrHeadOmitEmptyInt opType = 57 - opStructFieldPtrHeadStringTagInt opType = 58 - opStructFieldPtrAnonymousHeadInt opType = 59 - opStructFieldPtrAnonymousHeadOmitEmptyInt opType = 60 - opStructFieldPtrAnonymousHeadStringTagInt opType = 61 - opStructFieldNPtrHeadInt opType = 62 - opStructFieldNPtrHeadOmitEmptyInt opType = 63 - opStructFieldNPtrHeadStringTagInt opType = 64 - opStructFieldNPtrAnonymousHeadInt opType = 65 - opStructFieldNPtrAnonymousHeadOmitEmptyInt opType = 66 - opStructFieldNPtrAnonymousHeadStringTagInt opType = 67 - opStructFieldHeadUint opType = 68 - opStructFieldHeadOmitEmptyUint opType = 69 - opStructFieldHeadStringTagUint opType = 70 - opStructFieldAnonymousHeadUint opType = 71 - opStructFieldAnonymousHeadOmitEmptyUint opType = 72 - opStructFieldAnonymousHeadStringTagUint opType = 73 - opStructFieldPtrHeadUint opType = 74 - opStructFieldPtrHeadOmitEmptyUint opType = 75 - opStructFieldPtrHeadStringTagUint opType = 76 - opStructFieldPtrAnonymousHeadUint opType = 77 - opStructFieldPtrAnonymousHeadOmitEmptyUint opType = 78 - opStructFieldPtrAnonymousHeadStringTagUint opType = 79 - opStructFieldNPtrHeadUint opType = 80 - opStructFieldNPtrHeadOmitEmptyUint opType = 81 - opStructFieldNPtrHeadStringTagUint opType = 82 - opStructFieldNPtrAnonymousHeadUint opType = 83 - opStructFieldNPtrAnonymousHeadOmitEmptyUint opType = 84 - opStructFieldNPtrAnonymousHeadStringTagUint opType = 85 - opStructFieldHeadFloat32 opType = 86 - opStructFieldHeadOmitEmptyFloat32 opType = 87 - opStructFieldHeadStringTagFloat32 opType = 88 - opStructFieldAnonymousHeadFloat32 opType = 89 - opStructFieldAnonymousHeadOmitEmptyFloat32 opType = 90 - opStructFieldAnonymousHeadStringTagFloat32 opType = 91 - opStructFieldPtrHeadFloat32 opType = 92 - opStructFieldPtrHeadOmitEmptyFloat32 opType = 93 - opStructFieldPtrHeadStringTagFloat32 opType = 94 - opStructFieldPtrAnonymousHeadFloat32 opType = 95 - opStructFieldPtrAnonymousHeadOmitEmptyFloat32 opType = 96 - opStructFieldPtrAnonymousHeadStringTagFloat32 opType = 97 - opStructFieldNPtrHeadFloat32 opType = 98 - opStructFieldNPtrHeadOmitEmptyFloat32 opType = 99 - opStructFieldNPtrHeadStringTagFloat32 opType = 100 - opStructFieldNPtrAnonymousHeadFloat32 opType = 101 - opStructFieldNPtrAnonymousHeadOmitEmptyFloat32 opType = 102 - opStructFieldNPtrAnonymousHeadStringTagFloat32 opType = 103 - opStructFieldHeadFloat64 opType = 104 - opStructFieldHeadOmitEmptyFloat64 opType = 105 - opStructFieldHeadStringTagFloat64 opType = 106 - opStructFieldAnonymousHeadFloat64 opType = 107 - opStructFieldAnonymousHeadOmitEmptyFloat64 opType = 108 - opStructFieldAnonymousHeadStringTagFloat64 opType = 109 - opStructFieldPtrHeadFloat64 opType = 110 - opStructFieldPtrHeadOmitEmptyFloat64 opType = 111 - opStructFieldPtrHeadStringTagFloat64 opType = 112 - opStructFieldPtrAnonymousHeadFloat64 opType = 113 - opStructFieldPtrAnonymousHeadOmitEmptyFloat64 opType = 114 - opStructFieldPtrAnonymousHeadStringTagFloat64 opType = 115 - opStructFieldNPtrHeadFloat64 opType = 116 - opStructFieldNPtrHeadOmitEmptyFloat64 opType = 117 - opStructFieldNPtrHeadStringTagFloat64 opType = 118 - opStructFieldNPtrAnonymousHeadFloat64 opType = 119 - opStructFieldNPtrAnonymousHeadOmitEmptyFloat64 opType = 120 - opStructFieldNPtrAnonymousHeadStringTagFloat64 opType = 121 - opStructFieldHeadBool opType = 122 - opStructFieldHeadOmitEmptyBool opType = 123 - opStructFieldHeadStringTagBool opType = 124 - opStructFieldAnonymousHeadBool opType = 125 - opStructFieldAnonymousHeadOmitEmptyBool opType = 126 - opStructFieldAnonymousHeadStringTagBool opType = 127 - opStructFieldPtrHeadBool opType = 128 - opStructFieldPtrHeadOmitEmptyBool opType = 129 - opStructFieldPtrHeadStringTagBool opType = 130 - opStructFieldPtrAnonymousHeadBool opType = 131 - opStructFieldPtrAnonymousHeadOmitEmptyBool opType = 132 - opStructFieldPtrAnonymousHeadStringTagBool opType = 133 - opStructFieldNPtrHeadBool opType = 134 - opStructFieldNPtrHeadOmitEmptyBool opType = 135 - opStructFieldNPtrHeadStringTagBool opType = 136 - opStructFieldNPtrAnonymousHeadBool opType = 137 - opStructFieldNPtrAnonymousHeadOmitEmptyBool opType = 138 - opStructFieldNPtrAnonymousHeadStringTagBool opType = 139 - opStructFieldHeadString opType = 140 - opStructFieldHeadOmitEmptyString opType = 141 - opStructFieldHeadStringTagString opType = 142 - opStructFieldAnonymousHeadString opType = 143 - opStructFieldAnonymousHeadOmitEmptyString opType = 144 - opStructFieldAnonymousHeadStringTagString opType = 145 - opStructFieldPtrHeadString opType = 146 - opStructFieldPtrHeadOmitEmptyString opType = 147 - opStructFieldPtrHeadStringTagString opType = 148 - opStructFieldPtrAnonymousHeadString opType = 149 - opStructFieldPtrAnonymousHeadOmitEmptyString opType = 150 - opStructFieldPtrAnonymousHeadStringTagString opType = 151 - opStructFieldNPtrHeadString opType = 152 - opStructFieldNPtrHeadOmitEmptyString opType = 153 - opStructFieldNPtrHeadStringTagString opType = 154 - opStructFieldNPtrAnonymousHeadString opType = 155 - opStructFieldNPtrAnonymousHeadOmitEmptyString opType = 156 - opStructFieldNPtrAnonymousHeadStringTagString opType = 157 - opStructFieldHeadBytes opType = 158 - opStructFieldHeadOmitEmptyBytes opType = 159 - opStructFieldHeadStringTagBytes opType = 160 - opStructFieldAnonymousHeadBytes opType = 161 - opStructFieldAnonymousHeadOmitEmptyBytes opType = 162 - opStructFieldAnonymousHeadStringTagBytes opType = 163 - opStructFieldPtrHeadBytes opType = 164 - opStructFieldPtrHeadOmitEmptyBytes opType = 165 - opStructFieldPtrHeadStringTagBytes opType = 166 - opStructFieldPtrAnonymousHeadBytes opType = 167 - opStructFieldPtrAnonymousHeadOmitEmptyBytes opType = 168 - opStructFieldPtrAnonymousHeadStringTagBytes opType = 169 - opStructFieldNPtrHeadBytes opType = 170 - opStructFieldNPtrHeadOmitEmptyBytes opType = 171 - opStructFieldNPtrHeadStringTagBytes opType = 172 - opStructFieldNPtrAnonymousHeadBytes opType = 173 - opStructFieldNPtrAnonymousHeadOmitEmptyBytes opType = 174 - opStructFieldNPtrAnonymousHeadStringTagBytes opType = 175 - opStructFieldHeadArray opType = 176 - opStructFieldHeadOmitEmptyArray opType = 177 - opStructFieldHeadStringTagArray opType = 178 - opStructFieldAnonymousHeadArray opType = 179 - opStructFieldAnonymousHeadOmitEmptyArray opType = 180 - opStructFieldAnonymousHeadStringTagArray opType = 181 - opStructFieldPtrHeadArray opType = 182 - opStructFieldPtrHeadOmitEmptyArray opType = 183 - opStructFieldPtrHeadStringTagArray opType = 184 - opStructFieldPtrAnonymousHeadArray opType = 185 - opStructFieldPtrAnonymousHeadOmitEmptyArray opType = 186 - opStructFieldPtrAnonymousHeadStringTagArray opType = 187 - opStructFieldNPtrHeadArray opType = 188 - opStructFieldNPtrHeadOmitEmptyArray opType = 189 - opStructFieldNPtrHeadStringTagArray opType = 190 - opStructFieldNPtrAnonymousHeadArray opType = 191 - opStructFieldNPtrAnonymousHeadOmitEmptyArray opType = 192 - opStructFieldNPtrAnonymousHeadStringTagArray opType = 193 - opStructFieldHeadMap opType = 194 - opStructFieldHeadOmitEmptyMap opType = 195 - opStructFieldHeadStringTagMap opType = 196 - opStructFieldAnonymousHeadMap opType = 197 - opStructFieldAnonymousHeadOmitEmptyMap opType = 198 - opStructFieldAnonymousHeadStringTagMap opType = 199 - opStructFieldPtrHeadMap opType = 200 - opStructFieldPtrHeadOmitEmptyMap opType = 201 - opStructFieldPtrHeadStringTagMap opType = 202 - opStructFieldPtrAnonymousHeadMap opType = 203 - opStructFieldPtrAnonymousHeadOmitEmptyMap opType = 204 - opStructFieldPtrAnonymousHeadStringTagMap opType = 205 - opStructFieldNPtrHeadMap opType = 206 - opStructFieldNPtrHeadOmitEmptyMap opType = 207 - opStructFieldNPtrHeadStringTagMap opType = 208 - opStructFieldNPtrAnonymousHeadMap opType = 209 - opStructFieldNPtrAnonymousHeadOmitEmptyMap opType = 210 - opStructFieldNPtrAnonymousHeadStringTagMap opType = 211 - opStructFieldHeadMapLoad opType = 212 - opStructFieldHeadOmitEmptyMapLoad opType = 213 - opStructFieldHeadStringTagMapLoad opType = 214 - opStructFieldAnonymousHeadMapLoad opType = 215 - opStructFieldAnonymousHeadOmitEmptyMapLoad opType = 216 - opStructFieldAnonymousHeadStringTagMapLoad opType = 217 - opStructFieldPtrHeadMapLoad opType = 218 - opStructFieldPtrHeadOmitEmptyMapLoad opType = 219 - opStructFieldPtrHeadStringTagMapLoad opType = 220 - opStructFieldPtrAnonymousHeadMapLoad opType = 221 - opStructFieldPtrAnonymousHeadOmitEmptyMapLoad opType = 222 - opStructFieldPtrAnonymousHeadStringTagMapLoad opType = 223 - opStructFieldNPtrHeadMapLoad opType = 224 - opStructFieldNPtrHeadOmitEmptyMapLoad opType = 225 - opStructFieldNPtrHeadStringTagMapLoad opType = 226 - opStructFieldNPtrAnonymousHeadMapLoad opType = 227 - opStructFieldNPtrAnonymousHeadOmitEmptyMapLoad opType = 228 - opStructFieldNPtrAnonymousHeadStringTagMapLoad opType = 229 - opStructFieldHeadSlice opType = 230 - opStructFieldHeadOmitEmptySlice opType = 231 - opStructFieldHeadStringTagSlice opType = 232 - opStructFieldAnonymousHeadSlice opType = 233 - opStructFieldAnonymousHeadOmitEmptySlice opType = 234 - opStructFieldAnonymousHeadStringTagSlice opType = 235 - opStructFieldPtrHeadSlice opType = 236 - opStructFieldPtrHeadOmitEmptySlice opType = 237 - opStructFieldPtrHeadStringTagSlice opType = 238 - opStructFieldPtrAnonymousHeadSlice opType = 239 - opStructFieldPtrAnonymousHeadOmitEmptySlice opType = 240 - opStructFieldPtrAnonymousHeadStringTagSlice opType = 241 - opStructFieldNPtrHeadSlice opType = 242 - opStructFieldNPtrHeadOmitEmptySlice opType = 243 - opStructFieldNPtrHeadStringTagSlice opType = 244 - opStructFieldNPtrAnonymousHeadSlice opType = 245 - opStructFieldNPtrAnonymousHeadOmitEmptySlice opType = 246 - opStructFieldNPtrAnonymousHeadStringTagSlice opType = 247 - opStructFieldHeadStruct opType = 248 - opStructFieldHeadOmitEmptyStruct opType = 249 - opStructFieldHeadStringTagStruct opType = 250 - opStructFieldAnonymousHeadStruct opType = 251 - opStructFieldAnonymousHeadOmitEmptyStruct opType = 252 - opStructFieldAnonymousHeadStringTagStruct opType = 253 - opStructFieldPtrHeadStruct opType = 254 - opStructFieldPtrHeadOmitEmptyStruct opType = 255 - opStructFieldPtrHeadStringTagStruct opType = 256 - opStructFieldPtrAnonymousHeadStruct opType = 257 - opStructFieldPtrAnonymousHeadOmitEmptyStruct opType = 258 - opStructFieldPtrAnonymousHeadStringTagStruct opType = 259 - opStructFieldNPtrHeadStruct opType = 260 - opStructFieldNPtrHeadOmitEmptyStruct opType = 261 - opStructFieldNPtrHeadStringTagStruct opType = 262 - opStructFieldNPtrAnonymousHeadStruct opType = 263 - opStructFieldNPtrAnonymousHeadOmitEmptyStruct opType = 264 - opStructFieldNPtrAnonymousHeadStringTagStruct opType = 265 - opStructFieldHeadMarshalJSON opType = 266 - opStructFieldHeadOmitEmptyMarshalJSON opType = 267 - opStructFieldHeadStringTagMarshalJSON opType = 268 - opStructFieldAnonymousHeadMarshalJSON opType = 269 - opStructFieldAnonymousHeadOmitEmptyMarshalJSON opType = 270 - opStructFieldAnonymousHeadStringTagMarshalJSON opType = 271 - opStructFieldPtrHeadMarshalJSON opType = 272 - opStructFieldPtrHeadOmitEmptyMarshalJSON opType = 273 - opStructFieldPtrHeadStringTagMarshalJSON opType = 274 - opStructFieldPtrAnonymousHeadMarshalJSON opType = 275 - opStructFieldPtrAnonymousHeadOmitEmptyMarshalJSON opType = 276 - opStructFieldPtrAnonymousHeadStringTagMarshalJSON opType = 277 - opStructFieldNPtrHeadMarshalJSON opType = 278 - opStructFieldNPtrHeadOmitEmptyMarshalJSON opType = 279 - opStructFieldNPtrHeadStringTagMarshalJSON opType = 280 - opStructFieldNPtrAnonymousHeadMarshalJSON opType = 281 - opStructFieldNPtrAnonymousHeadOmitEmptyMarshalJSON opType = 282 - opStructFieldNPtrAnonymousHeadStringTagMarshalJSON opType = 283 - opStructFieldHeadMarshalText opType = 284 - opStructFieldHeadOmitEmptyMarshalText opType = 285 - opStructFieldHeadStringTagMarshalText opType = 286 - opStructFieldAnonymousHeadMarshalText opType = 287 - opStructFieldAnonymousHeadOmitEmptyMarshalText opType = 288 - opStructFieldAnonymousHeadStringTagMarshalText opType = 289 - opStructFieldPtrHeadMarshalText opType = 290 - opStructFieldPtrHeadOmitEmptyMarshalText opType = 291 - opStructFieldPtrHeadStringTagMarshalText opType = 292 - opStructFieldPtrAnonymousHeadMarshalText opType = 293 - opStructFieldPtrAnonymousHeadOmitEmptyMarshalText opType = 294 - opStructFieldPtrAnonymousHeadStringTagMarshalText opType = 295 - opStructFieldNPtrHeadMarshalText opType = 296 - opStructFieldNPtrHeadOmitEmptyMarshalText opType = 297 - opStructFieldNPtrHeadStringTagMarshalText opType = 298 - opStructFieldNPtrAnonymousHeadMarshalText opType = 299 - opStructFieldNPtrAnonymousHeadOmitEmptyMarshalText opType = 300 - opStructFieldNPtrAnonymousHeadStringTagMarshalText opType = 301 - opStructFieldHeadRecursive opType = 302 - opStructFieldHeadOmitEmptyRecursive opType = 303 - opStructFieldHeadStringTagRecursive opType = 304 - opStructFieldAnonymousHeadRecursive opType = 305 - opStructFieldAnonymousHeadOmitEmptyRecursive opType = 306 - opStructFieldAnonymousHeadStringTagRecursive opType = 307 - opStructFieldPtrHeadRecursive opType = 308 - opStructFieldPtrHeadOmitEmptyRecursive opType = 309 - opStructFieldPtrHeadStringTagRecursive opType = 310 - opStructFieldPtrAnonymousHeadRecursive opType = 311 - opStructFieldPtrAnonymousHeadOmitEmptyRecursive opType = 312 - opStructFieldPtrAnonymousHeadStringTagRecursive opType = 313 - opStructFieldNPtrHeadRecursive opType = 314 - opStructFieldNPtrHeadOmitEmptyRecursive opType = 315 - opStructFieldNPtrHeadStringTagRecursive opType = 316 - opStructFieldNPtrAnonymousHeadRecursive opType = 317 - opStructFieldNPtrAnonymousHeadOmitEmptyRecursive opType = 318 - opStructFieldNPtrAnonymousHeadStringTagRecursive opType = 319 - opStructFieldHeadIntString opType = 320 - opStructFieldHeadOmitEmptyIntString opType = 321 - opStructFieldHeadStringTagIntString opType = 322 - opStructFieldAnonymousHeadIntString opType = 323 - opStructFieldAnonymousHeadOmitEmptyIntString opType = 324 - opStructFieldAnonymousHeadStringTagIntString opType = 325 - opStructFieldPtrHeadIntString opType = 326 - opStructFieldPtrHeadOmitEmptyIntString opType = 327 - opStructFieldPtrHeadStringTagIntString opType = 328 - opStructFieldPtrAnonymousHeadIntString opType = 329 - opStructFieldPtrAnonymousHeadOmitEmptyIntString opType = 330 - opStructFieldPtrAnonymousHeadStringTagIntString opType = 331 - opStructFieldNPtrHeadIntString opType = 332 - opStructFieldNPtrHeadOmitEmptyIntString opType = 333 - opStructFieldNPtrHeadStringTagIntString opType = 334 - opStructFieldNPtrAnonymousHeadIntString opType = 335 - opStructFieldNPtrAnonymousHeadOmitEmptyIntString opType = 336 - opStructFieldNPtrAnonymousHeadStringTagIntString opType = 337 - opStructFieldHeadUintString opType = 338 - opStructFieldHeadOmitEmptyUintString opType = 339 - opStructFieldHeadStringTagUintString opType = 340 - opStructFieldAnonymousHeadUintString opType = 341 - opStructFieldAnonymousHeadOmitEmptyUintString opType = 342 - opStructFieldAnonymousHeadStringTagUintString opType = 343 - opStructFieldPtrHeadUintString opType = 344 - opStructFieldPtrHeadOmitEmptyUintString opType = 345 - opStructFieldPtrHeadStringTagUintString opType = 346 - opStructFieldPtrAnonymousHeadUintString opType = 347 - opStructFieldPtrAnonymousHeadOmitEmptyUintString opType = 348 - opStructFieldPtrAnonymousHeadStringTagUintString opType = 349 - opStructFieldNPtrHeadUintString opType = 350 - opStructFieldNPtrHeadOmitEmptyUintString opType = 351 - opStructFieldNPtrHeadStringTagUintString opType = 352 - opStructFieldNPtrAnonymousHeadUintString opType = 353 - opStructFieldNPtrAnonymousHeadOmitEmptyUintString opType = 354 - opStructFieldNPtrAnonymousHeadStringTagUintString opType = 355 - opStructFieldHeadIntPtr opType = 356 - opStructFieldHeadOmitEmptyIntPtr opType = 357 - opStructFieldHeadStringTagIntPtr opType = 358 - opStructFieldAnonymousHeadIntPtr opType = 359 - opStructFieldAnonymousHeadOmitEmptyIntPtr opType = 360 - opStructFieldAnonymousHeadStringTagIntPtr opType = 361 - opStructFieldPtrHeadIntPtr opType = 362 - opStructFieldPtrHeadOmitEmptyIntPtr opType = 363 - opStructFieldPtrHeadStringTagIntPtr opType = 364 - opStructFieldPtrAnonymousHeadIntPtr opType = 365 - opStructFieldPtrAnonymousHeadOmitEmptyIntPtr opType = 366 - opStructFieldPtrAnonymousHeadStringTagIntPtr opType = 367 - opStructFieldNPtrHeadIntPtr opType = 368 - opStructFieldNPtrHeadOmitEmptyIntPtr opType = 369 - opStructFieldNPtrHeadStringTagIntPtr opType = 370 - opStructFieldNPtrAnonymousHeadIntPtr opType = 371 - opStructFieldNPtrAnonymousHeadOmitEmptyIntPtr opType = 372 - opStructFieldNPtrAnonymousHeadStringTagIntPtr opType = 373 - opStructFieldHeadUintPtr opType = 374 - opStructFieldHeadOmitEmptyUintPtr opType = 375 - opStructFieldHeadStringTagUintPtr opType = 376 - opStructFieldAnonymousHeadUintPtr opType = 377 - opStructFieldAnonymousHeadOmitEmptyUintPtr opType = 378 - opStructFieldAnonymousHeadStringTagUintPtr opType = 379 - opStructFieldPtrHeadUintPtr opType = 380 - opStructFieldPtrHeadOmitEmptyUintPtr opType = 381 - opStructFieldPtrHeadStringTagUintPtr opType = 382 - opStructFieldPtrAnonymousHeadUintPtr opType = 383 - opStructFieldPtrAnonymousHeadOmitEmptyUintPtr opType = 384 - opStructFieldPtrAnonymousHeadStringTagUintPtr opType = 385 - opStructFieldNPtrHeadUintPtr opType = 386 - opStructFieldNPtrHeadOmitEmptyUintPtr opType = 387 - opStructFieldNPtrHeadStringTagUintPtr opType = 388 - opStructFieldNPtrAnonymousHeadUintPtr opType = 389 - opStructFieldNPtrAnonymousHeadOmitEmptyUintPtr opType = 390 - opStructFieldNPtrAnonymousHeadStringTagUintPtr opType = 391 - opStructFieldHeadFloat32Ptr opType = 392 - opStructFieldHeadOmitEmptyFloat32Ptr opType = 393 - opStructFieldHeadStringTagFloat32Ptr opType = 394 - opStructFieldAnonymousHeadFloat32Ptr opType = 395 - opStructFieldAnonymousHeadOmitEmptyFloat32Ptr opType = 396 - opStructFieldAnonymousHeadStringTagFloat32Ptr opType = 397 - opStructFieldPtrHeadFloat32Ptr opType = 398 - opStructFieldPtrHeadOmitEmptyFloat32Ptr opType = 399 - opStructFieldPtrHeadStringTagFloat32Ptr opType = 400 - opStructFieldPtrAnonymousHeadFloat32Ptr opType = 401 - opStructFieldPtrAnonymousHeadOmitEmptyFloat32Ptr opType = 402 - opStructFieldPtrAnonymousHeadStringTagFloat32Ptr opType = 403 - opStructFieldNPtrHeadFloat32Ptr opType = 404 - opStructFieldNPtrHeadOmitEmptyFloat32Ptr opType = 405 - opStructFieldNPtrHeadStringTagFloat32Ptr opType = 406 - opStructFieldNPtrAnonymousHeadFloat32Ptr opType = 407 - opStructFieldNPtrAnonymousHeadOmitEmptyFloat32Ptr opType = 408 - opStructFieldNPtrAnonymousHeadStringTagFloat32Ptr opType = 409 - opStructFieldHeadFloat64Ptr opType = 410 - opStructFieldHeadOmitEmptyFloat64Ptr opType = 411 - opStructFieldHeadStringTagFloat64Ptr opType = 412 - opStructFieldAnonymousHeadFloat64Ptr opType = 413 - opStructFieldAnonymousHeadOmitEmptyFloat64Ptr opType = 414 - opStructFieldAnonymousHeadStringTagFloat64Ptr opType = 415 - opStructFieldPtrHeadFloat64Ptr opType = 416 - opStructFieldPtrHeadOmitEmptyFloat64Ptr opType = 417 - opStructFieldPtrHeadStringTagFloat64Ptr opType = 418 - opStructFieldPtrAnonymousHeadFloat64Ptr opType = 419 - opStructFieldPtrAnonymousHeadOmitEmptyFloat64Ptr opType = 420 - opStructFieldPtrAnonymousHeadStringTagFloat64Ptr opType = 421 - opStructFieldNPtrHeadFloat64Ptr opType = 422 - opStructFieldNPtrHeadOmitEmptyFloat64Ptr opType = 423 - opStructFieldNPtrHeadStringTagFloat64Ptr opType = 424 - opStructFieldNPtrAnonymousHeadFloat64Ptr opType = 425 - opStructFieldNPtrAnonymousHeadOmitEmptyFloat64Ptr opType = 426 - opStructFieldNPtrAnonymousHeadStringTagFloat64Ptr opType = 427 - opStructFieldHeadBoolPtr opType = 428 - opStructFieldHeadOmitEmptyBoolPtr opType = 429 - opStructFieldHeadStringTagBoolPtr opType = 430 - opStructFieldAnonymousHeadBoolPtr opType = 431 - opStructFieldAnonymousHeadOmitEmptyBoolPtr opType = 432 - opStructFieldAnonymousHeadStringTagBoolPtr opType = 433 - opStructFieldPtrHeadBoolPtr opType = 434 - opStructFieldPtrHeadOmitEmptyBoolPtr opType = 435 - opStructFieldPtrHeadStringTagBoolPtr opType = 436 - opStructFieldPtrAnonymousHeadBoolPtr opType = 437 - opStructFieldPtrAnonymousHeadOmitEmptyBoolPtr opType = 438 - opStructFieldPtrAnonymousHeadStringTagBoolPtr opType = 439 - opStructFieldNPtrHeadBoolPtr opType = 440 - opStructFieldNPtrHeadOmitEmptyBoolPtr opType = 441 - opStructFieldNPtrHeadStringTagBoolPtr opType = 442 - opStructFieldNPtrAnonymousHeadBoolPtr opType = 443 - opStructFieldNPtrAnonymousHeadOmitEmptyBoolPtr opType = 444 - opStructFieldNPtrAnonymousHeadStringTagBoolPtr opType = 445 - opStructFieldHeadStringPtr opType = 446 - opStructFieldHeadOmitEmptyStringPtr opType = 447 - opStructFieldHeadStringTagStringPtr opType = 448 - opStructFieldAnonymousHeadStringPtr opType = 449 - opStructFieldAnonymousHeadOmitEmptyStringPtr opType = 450 - opStructFieldAnonymousHeadStringTagStringPtr opType = 451 - opStructFieldPtrHeadStringPtr opType = 452 - opStructFieldPtrHeadOmitEmptyStringPtr opType = 453 - opStructFieldPtrHeadStringTagStringPtr opType = 454 - opStructFieldPtrAnonymousHeadStringPtr opType = 455 - opStructFieldPtrAnonymousHeadOmitEmptyStringPtr opType = 456 - opStructFieldPtrAnonymousHeadStringTagStringPtr opType = 457 - opStructFieldNPtrHeadStringPtr opType = 458 - opStructFieldNPtrHeadOmitEmptyStringPtr opType = 459 - opStructFieldNPtrHeadStringTagStringPtr opType = 460 - opStructFieldNPtrAnonymousHeadStringPtr opType = 461 - opStructFieldNPtrAnonymousHeadOmitEmptyStringPtr opType = 462 - opStructFieldNPtrAnonymousHeadStringTagStringPtr opType = 463 - opStructFieldHeadBytesPtr opType = 464 - opStructFieldHeadOmitEmptyBytesPtr opType = 465 - opStructFieldHeadStringTagBytesPtr opType = 466 - opStructFieldAnonymousHeadBytesPtr opType = 467 - opStructFieldAnonymousHeadOmitEmptyBytesPtr opType = 468 - opStructFieldAnonymousHeadStringTagBytesPtr opType = 469 - opStructFieldPtrHeadBytesPtr opType = 470 - opStructFieldPtrHeadOmitEmptyBytesPtr opType = 471 - opStructFieldPtrHeadStringTagBytesPtr opType = 472 - opStructFieldPtrAnonymousHeadBytesPtr opType = 473 - opStructFieldPtrAnonymousHeadOmitEmptyBytesPtr opType = 474 - opStructFieldPtrAnonymousHeadStringTagBytesPtr opType = 475 - opStructFieldNPtrHeadBytesPtr opType = 476 - opStructFieldNPtrHeadOmitEmptyBytesPtr opType = 477 - opStructFieldNPtrHeadStringTagBytesPtr opType = 478 - opStructFieldNPtrAnonymousHeadBytesPtr opType = 479 - opStructFieldNPtrAnonymousHeadOmitEmptyBytesPtr opType = 480 - opStructFieldNPtrAnonymousHeadStringTagBytesPtr opType = 481 - opStructFieldHeadIntNPtr opType = 482 - opStructFieldHeadOmitEmptyIntNPtr opType = 483 - opStructFieldHeadStringTagIntNPtr opType = 484 - opStructFieldAnonymousHeadIntNPtr opType = 485 - opStructFieldAnonymousHeadOmitEmptyIntNPtr opType = 486 - opStructFieldAnonymousHeadStringTagIntNPtr opType = 487 - opStructFieldPtrHeadIntNPtr opType = 488 - opStructFieldPtrHeadOmitEmptyIntNPtr opType = 489 - opStructFieldPtrHeadStringTagIntNPtr opType = 490 - opStructFieldPtrAnonymousHeadIntNPtr opType = 491 - opStructFieldPtrAnonymousHeadOmitEmptyIntNPtr opType = 492 - opStructFieldPtrAnonymousHeadStringTagIntNPtr opType = 493 - opStructFieldNPtrHeadIntNPtr opType = 494 - opStructFieldNPtrHeadOmitEmptyIntNPtr opType = 495 - opStructFieldNPtrHeadStringTagIntNPtr opType = 496 - opStructFieldNPtrAnonymousHeadIntNPtr opType = 497 - opStructFieldNPtrAnonymousHeadOmitEmptyIntNPtr opType = 498 - opStructFieldNPtrAnonymousHeadStringTagIntNPtr opType = 499 - opStructFieldHeadUintNPtr opType = 500 - opStructFieldHeadOmitEmptyUintNPtr opType = 501 - opStructFieldHeadStringTagUintNPtr opType = 502 - opStructFieldAnonymousHeadUintNPtr opType = 503 - opStructFieldAnonymousHeadOmitEmptyUintNPtr opType = 504 - opStructFieldAnonymousHeadStringTagUintNPtr opType = 505 - opStructFieldPtrHeadUintNPtr opType = 506 - opStructFieldPtrHeadOmitEmptyUintNPtr opType = 507 - opStructFieldPtrHeadStringTagUintNPtr opType = 508 - opStructFieldPtrAnonymousHeadUintNPtr opType = 509 - opStructFieldPtrAnonymousHeadOmitEmptyUintNPtr opType = 510 - opStructFieldPtrAnonymousHeadStringTagUintNPtr opType = 511 - opStructFieldNPtrHeadUintNPtr opType = 512 - opStructFieldNPtrHeadOmitEmptyUintNPtr opType = 513 - opStructFieldNPtrHeadStringTagUintNPtr opType = 514 - opStructFieldNPtrAnonymousHeadUintNPtr opType = 515 - opStructFieldNPtrAnonymousHeadOmitEmptyUintNPtr opType = 516 - opStructFieldNPtrAnonymousHeadStringTagUintNPtr opType = 517 - opStructFieldHeadFloat32NPtr opType = 518 - opStructFieldHeadOmitEmptyFloat32NPtr opType = 519 - opStructFieldHeadStringTagFloat32NPtr opType = 520 - opStructFieldAnonymousHeadFloat32NPtr opType = 521 - opStructFieldAnonymousHeadOmitEmptyFloat32NPtr opType = 522 - opStructFieldAnonymousHeadStringTagFloat32NPtr opType = 523 - opStructFieldPtrHeadFloat32NPtr opType = 524 - opStructFieldPtrHeadOmitEmptyFloat32NPtr opType = 525 - opStructFieldPtrHeadStringTagFloat32NPtr opType = 526 - opStructFieldPtrAnonymousHeadFloat32NPtr opType = 527 - opStructFieldPtrAnonymousHeadOmitEmptyFloat32NPtr opType = 528 - opStructFieldPtrAnonymousHeadStringTagFloat32NPtr opType = 529 - opStructFieldNPtrHeadFloat32NPtr opType = 530 - opStructFieldNPtrHeadOmitEmptyFloat32NPtr opType = 531 - opStructFieldNPtrHeadStringTagFloat32NPtr opType = 532 - opStructFieldNPtrAnonymousHeadFloat32NPtr opType = 533 - opStructFieldNPtrAnonymousHeadOmitEmptyFloat32NPtr opType = 534 - opStructFieldNPtrAnonymousHeadStringTagFloat32NPtr opType = 535 - opStructFieldHeadFloat64NPtr opType = 536 - opStructFieldHeadOmitEmptyFloat64NPtr opType = 537 - opStructFieldHeadStringTagFloat64NPtr opType = 538 - opStructFieldAnonymousHeadFloat64NPtr opType = 539 - opStructFieldAnonymousHeadOmitEmptyFloat64NPtr opType = 540 - opStructFieldAnonymousHeadStringTagFloat64NPtr opType = 541 - opStructFieldPtrHeadFloat64NPtr opType = 542 - opStructFieldPtrHeadOmitEmptyFloat64NPtr opType = 543 - opStructFieldPtrHeadStringTagFloat64NPtr opType = 544 - opStructFieldPtrAnonymousHeadFloat64NPtr opType = 545 - opStructFieldPtrAnonymousHeadOmitEmptyFloat64NPtr opType = 546 - opStructFieldPtrAnonymousHeadStringTagFloat64NPtr opType = 547 - opStructFieldNPtrHeadFloat64NPtr opType = 548 - opStructFieldNPtrHeadOmitEmptyFloat64NPtr opType = 549 - opStructFieldNPtrHeadStringTagFloat64NPtr opType = 550 - opStructFieldNPtrAnonymousHeadFloat64NPtr opType = 551 - opStructFieldNPtrAnonymousHeadOmitEmptyFloat64NPtr opType = 552 - opStructFieldNPtrAnonymousHeadStringTagFloat64NPtr opType = 553 - opStructFieldHeadBoolNPtr opType = 554 - opStructFieldHeadOmitEmptyBoolNPtr opType = 555 - opStructFieldHeadStringTagBoolNPtr opType = 556 - opStructFieldAnonymousHeadBoolNPtr opType = 557 - opStructFieldAnonymousHeadOmitEmptyBoolNPtr opType = 558 - opStructFieldAnonymousHeadStringTagBoolNPtr opType = 559 - opStructFieldPtrHeadBoolNPtr opType = 560 - opStructFieldPtrHeadOmitEmptyBoolNPtr opType = 561 - opStructFieldPtrHeadStringTagBoolNPtr opType = 562 - opStructFieldPtrAnonymousHeadBoolNPtr opType = 563 - opStructFieldPtrAnonymousHeadOmitEmptyBoolNPtr opType = 564 - opStructFieldPtrAnonymousHeadStringTagBoolNPtr opType = 565 - opStructFieldNPtrHeadBoolNPtr opType = 566 - opStructFieldNPtrHeadOmitEmptyBoolNPtr opType = 567 - opStructFieldNPtrHeadStringTagBoolNPtr opType = 568 - opStructFieldNPtrAnonymousHeadBoolNPtr opType = 569 - opStructFieldNPtrAnonymousHeadOmitEmptyBoolNPtr opType = 570 - opStructFieldNPtrAnonymousHeadStringTagBoolNPtr opType = 571 - opStructFieldHeadStringNPtr opType = 572 - opStructFieldHeadOmitEmptyStringNPtr opType = 573 - opStructFieldHeadStringTagStringNPtr opType = 574 - opStructFieldAnonymousHeadStringNPtr opType = 575 - opStructFieldAnonymousHeadOmitEmptyStringNPtr opType = 576 - opStructFieldAnonymousHeadStringTagStringNPtr opType = 577 - opStructFieldPtrHeadStringNPtr opType = 578 - opStructFieldPtrHeadOmitEmptyStringNPtr opType = 579 - opStructFieldPtrHeadStringTagStringNPtr opType = 580 - opStructFieldPtrAnonymousHeadStringNPtr opType = 581 - opStructFieldPtrAnonymousHeadOmitEmptyStringNPtr opType = 582 - opStructFieldPtrAnonymousHeadStringTagStringNPtr opType = 583 - opStructFieldNPtrHeadStringNPtr opType = 584 - opStructFieldNPtrHeadOmitEmptyStringNPtr opType = 585 - opStructFieldNPtrHeadStringTagStringNPtr opType = 586 - opStructFieldNPtrAnonymousHeadStringNPtr opType = 587 - opStructFieldNPtrAnonymousHeadOmitEmptyStringNPtr opType = 588 - opStructFieldNPtrAnonymousHeadStringTagStringNPtr opType = 589 - opStructFieldHeadBytesNPtr opType = 590 - opStructFieldHeadOmitEmptyBytesNPtr opType = 591 - opStructFieldHeadStringTagBytesNPtr opType = 592 - opStructFieldAnonymousHeadBytesNPtr opType = 593 - opStructFieldAnonymousHeadOmitEmptyBytesNPtr opType = 594 - opStructFieldAnonymousHeadStringTagBytesNPtr opType = 595 - opStructFieldPtrHeadBytesNPtr opType = 596 - opStructFieldPtrHeadOmitEmptyBytesNPtr opType = 597 - opStructFieldPtrHeadStringTagBytesNPtr opType = 598 - opStructFieldPtrAnonymousHeadBytesNPtr opType = 599 - opStructFieldPtrAnonymousHeadOmitEmptyBytesNPtr opType = 600 - opStructFieldPtrAnonymousHeadStringTagBytesNPtr opType = 601 - opStructFieldNPtrHeadBytesNPtr opType = 602 - opStructFieldNPtrHeadOmitEmptyBytesNPtr opType = 603 - opStructFieldNPtrHeadStringTagBytesNPtr opType = 604 - opStructFieldNPtrAnonymousHeadBytesNPtr opType = 605 - opStructFieldNPtrAnonymousHeadOmitEmptyBytesNPtr opType = 606 - opStructFieldNPtrAnonymousHeadStringTagBytesNPtr opType = 607 - opStructFieldHead opType = 608 - opStructFieldHeadOmitEmpty opType = 609 - opStructFieldHeadStringTag opType = 610 - opStructFieldAnonymousHead opType = 611 - opStructFieldAnonymousHeadOmitEmpty opType = 612 - opStructFieldAnonymousHeadStringTag opType = 613 - opStructFieldPtrHead opType = 614 - opStructFieldPtrHeadOmitEmpty opType = 615 - opStructFieldPtrHeadStringTag opType = 616 - opStructFieldPtrAnonymousHead opType = 617 - opStructFieldPtrAnonymousHeadOmitEmpty opType = 618 - opStructFieldPtrAnonymousHeadStringTag opType = 619 - opStructFieldNPtrHead opType = 620 - opStructFieldNPtrHeadOmitEmpty opType = 621 - opStructFieldNPtrHeadStringTag opType = 622 - opStructFieldNPtrAnonymousHead opType = 623 - opStructFieldNPtrAnonymousHeadOmitEmpty opType = 624 - opStructFieldNPtrAnonymousHeadStringTag opType = 625 - opStructFieldInt opType = 626 - opStructFieldOmitEmptyInt opType = 627 - opStructFieldStringTagInt opType = 628 - opStructFieldUint opType = 629 - opStructFieldOmitEmptyUint opType = 630 - opStructFieldStringTagUint opType = 631 - opStructFieldFloat32 opType = 632 - opStructFieldOmitEmptyFloat32 opType = 633 - opStructFieldStringTagFloat32 opType = 634 - opStructFieldFloat64 opType = 635 - opStructFieldOmitEmptyFloat64 opType = 636 - opStructFieldStringTagFloat64 opType = 637 - opStructFieldBool opType = 638 - opStructFieldOmitEmptyBool opType = 639 - opStructFieldStringTagBool opType = 640 - opStructFieldString opType = 641 - opStructFieldOmitEmptyString opType = 642 - opStructFieldStringTagString opType = 643 - opStructFieldBytes opType = 644 - opStructFieldOmitEmptyBytes opType = 645 - opStructFieldStringTagBytes opType = 646 - opStructFieldArray opType = 647 - opStructFieldOmitEmptyArray opType = 648 - opStructFieldStringTagArray opType = 649 - opStructFieldMap opType = 650 - opStructFieldOmitEmptyMap opType = 651 - opStructFieldStringTagMap opType = 652 - opStructFieldMapLoad opType = 653 - opStructFieldOmitEmptyMapLoad opType = 654 - opStructFieldStringTagMapLoad opType = 655 - opStructFieldSlice opType = 656 - opStructFieldOmitEmptySlice opType = 657 - opStructFieldStringTagSlice opType = 658 - opStructFieldStruct opType = 659 - opStructFieldOmitEmptyStruct opType = 660 - opStructFieldStringTagStruct opType = 661 - opStructFieldMarshalJSON opType = 662 - opStructFieldOmitEmptyMarshalJSON opType = 663 - opStructFieldStringTagMarshalJSON opType = 664 - opStructFieldMarshalText opType = 665 - opStructFieldOmitEmptyMarshalText opType = 666 - opStructFieldStringTagMarshalText opType = 667 - opStructFieldRecursive opType = 668 - opStructFieldOmitEmptyRecursive opType = 669 - opStructFieldStringTagRecursive opType = 670 - opStructFieldIntString opType = 671 - opStructFieldOmitEmptyIntString opType = 672 - opStructFieldStringTagIntString opType = 673 - opStructFieldUintString opType = 674 - opStructFieldOmitEmptyUintString opType = 675 - opStructFieldStringTagUintString opType = 676 - opStructFieldIntPtr opType = 677 - opStructFieldOmitEmptyIntPtr opType = 678 - opStructFieldStringTagIntPtr opType = 679 - opStructFieldUintPtr opType = 680 - opStructFieldOmitEmptyUintPtr opType = 681 - opStructFieldStringTagUintPtr opType = 682 - opStructFieldFloat32Ptr opType = 683 - opStructFieldOmitEmptyFloat32Ptr opType = 684 - opStructFieldStringTagFloat32Ptr opType = 685 - opStructFieldFloat64Ptr opType = 686 - opStructFieldOmitEmptyFloat64Ptr opType = 687 - opStructFieldStringTagFloat64Ptr opType = 688 - opStructFieldBoolPtr opType = 689 - opStructFieldOmitEmptyBoolPtr opType = 690 - opStructFieldStringTagBoolPtr opType = 691 - opStructFieldStringPtr opType = 692 - opStructFieldOmitEmptyStringPtr opType = 693 - opStructFieldStringTagStringPtr opType = 694 - opStructFieldBytesPtr opType = 695 - opStructFieldOmitEmptyBytesPtr opType = 696 - opStructFieldStringTagBytesPtr opType = 697 - opStructFieldIntNPtr opType = 698 - opStructFieldOmitEmptyIntNPtr opType = 699 - opStructFieldStringTagIntNPtr opType = 700 - opStructFieldUintNPtr opType = 701 - opStructFieldOmitEmptyUintNPtr opType = 702 - opStructFieldStringTagUintNPtr opType = 703 - opStructFieldFloat32NPtr opType = 704 - opStructFieldOmitEmptyFloat32NPtr opType = 705 - opStructFieldStringTagFloat32NPtr opType = 706 - opStructFieldFloat64NPtr opType = 707 - opStructFieldOmitEmptyFloat64NPtr opType = 708 - opStructFieldStringTagFloat64NPtr opType = 709 - opStructFieldBoolNPtr opType = 710 - opStructFieldOmitEmptyBoolNPtr opType = 711 - opStructFieldStringTagBoolNPtr opType = 712 - opStructFieldStringNPtr opType = 713 - opStructFieldOmitEmptyStringNPtr opType = 714 - opStructFieldStringTagStringNPtr opType = 715 - opStructFieldBytesNPtr opType = 716 - opStructFieldOmitEmptyBytesNPtr opType = 717 - opStructFieldStringTagBytesNPtr opType = 718 - opStructField opType = 719 - opStructFieldOmitEmpty opType = 720 - opStructFieldStringTag opType = 721 - opStructEndInt opType = 722 - opStructEndOmitEmptyInt opType = 723 - opStructEndStringTagInt opType = 724 - opStructEndUint opType = 725 - opStructEndOmitEmptyUint opType = 726 - opStructEndStringTagUint opType = 727 - opStructEndFloat32 opType = 728 - opStructEndOmitEmptyFloat32 opType = 729 - opStructEndStringTagFloat32 opType = 730 - opStructEndFloat64 opType = 731 - opStructEndOmitEmptyFloat64 opType = 732 - opStructEndStringTagFloat64 opType = 733 - opStructEndBool opType = 734 - opStructEndOmitEmptyBool opType = 735 - opStructEndStringTagBool opType = 736 - opStructEndString opType = 737 - opStructEndOmitEmptyString opType = 738 - opStructEndStringTagString opType = 739 - opStructEndBytes opType = 740 - opStructEndOmitEmptyBytes opType = 741 - opStructEndStringTagBytes opType = 742 - opStructEndArray opType = 743 - opStructEndOmitEmptyArray opType = 744 - opStructEndStringTagArray opType = 745 - opStructEndMap opType = 746 - opStructEndOmitEmptyMap opType = 747 - opStructEndStringTagMap opType = 748 - opStructEndMapLoad opType = 749 - opStructEndOmitEmptyMapLoad opType = 750 - opStructEndStringTagMapLoad opType = 751 - opStructEndSlice opType = 752 - opStructEndOmitEmptySlice opType = 753 - opStructEndStringTagSlice opType = 754 - opStructEndStruct opType = 755 - opStructEndOmitEmptyStruct opType = 756 - opStructEndStringTagStruct opType = 757 - opStructEndMarshalJSON opType = 758 - opStructEndOmitEmptyMarshalJSON opType = 759 - opStructEndStringTagMarshalJSON opType = 760 - opStructEndMarshalText opType = 761 - opStructEndOmitEmptyMarshalText opType = 762 - opStructEndStringTagMarshalText opType = 763 - opStructEndRecursive opType = 764 - opStructEndOmitEmptyRecursive opType = 765 - opStructEndStringTagRecursive opType = 766 - opStructEndIntString opType = 767 - opStructEndOmitEmptyIntString opType = 768 - opStructEndStringTagIntString opType = 769 - opStructEndUintString opType = 770 - opStructEndOmitEmptyUintString opType = 771 - opStructEndStringTagUintString opType = 772 - opStructEndIntPtr opType = 773 - opStructEndOmitEmptyIntPtr opType = 774 - opStructEndStringTagIntPtr opType = 775 - opStructEndUintPtr opType = 776 - opStructEndOmitEmptyUintPtr opType = 777 - opStructEndStringTagUintPtr opType = 778 - opStructEndFloat32Ptr opType = 779 - opStructEndOmitEmptyFloat32Ptr opType = 780 - opStructEndStringTagFloat32Ptr opType = 781 - opStructEndFloat64Ptr opType = 782 - opStructEndOmitEmptyFloat64Ptr opType = 783 - opStructEndStringTagFloat64Ptr opType = 784 - opStructEndBoolPtr opType = 785 - opStructEndOmitEmptyBoolPtr opType = 786 - opStructEndStringTagBoolPtr opType = 787 - opStructEndStringPtr opType = 788 - opStructEndOmitEmptyStringPtr opType = 789 - opStructEndStringTagStringPtr opType = 790 - opStructEndBytesPtr opType = 791 - opStructEndOmitEmptyBytesPtr opType = 792 - opStructEndStringTagBytesPtr opType = 793 - opStructEndIntNPtr opType = 794 - opStructEndOmitEmptyIntNPtr opType = 795 - opStructEndStringTagIntNPtr opType = 796 - opStructEndUintNPtr opType = 797 - opStructEndOmitEmptyUintNPtr opType = 798 - opStructEndStringTagUintNPtr opType = 799 - opStructEndFloat32NPtr opType = 800 - opStructEndOmitEmptyFloat32NPtr opType = 801 - opStructEndStringTagFloat32NPtr opType = 802 - opStructEndFloat64NPtr opType = 803 - opStructEndOmitEmptyFloat64NPtr opType = 804 - opStructEndStringTagFloat64NPtr opType = 805 - opStructEndBoolNPtr opType = 806 - opStructEndOmitEmptyBoolNPtr opType = 807 - opStructEndStringTagBoolNPtr opType = 808 - opStructEndStringNPtr opType = 809 - opStructEndOmitEmptyStringNPtr opType = 810 - opStructEndStringTagStringNPtr opType = 811 - opStructEndBytesNPtr opType = 812 - opStructEndOmitEmptyBytesNPtr opType = 813 - opStructEndStringTagBytesNPtr opType = 814 - opStructEnd opType = 815 - opStructEndOmitEmpty opType = 816 - opStructEndStringTag opType = 817 + opArrayPtr opType = 43 + opSlicePtr opType = 44 + opMapPtr opType = 45 + opIntNPtr opType = 46 + opUintNPtr opType = 47 + opFloat32NPtr opType = 48 + opFloat64NPtr opType = 49 + opBoolNPtr opType = 50 + opStringNPtr opType = 51 + opBytesNPtr opType = 52 + opStructFieldHeadInt opType = 53 + opStructFieldHeadOmitEmptyInt opType = 54 + opStructFieldHeadStringTagInt opType = 55 + opStructFieldAnonymousHeadInt opType = 56 + opStructFieldAnonymousHeadOmitEmptyInt opType = 57 + opStructFieldAnonymousHeadStringTagInt opType = 58 + opStructFieldPtrHeadInt opType = 59 + opStructFieldPtrHeadOmitEmptyInt opType = 60 + opStructFieldPtrHeadStringTagInt opType = 61 + opStructFieldPtrAnonymousHeadInt opType = 62 + opStructFieldPtrAnonymousHeadOmitEmptyInt opType = 63 + opStructFieldPtrAnonymousHeadStringTagInt opType = 64 + opStructFieldNPtrHeadInt opType = 65 + opStructFieldNPtrHeadOmitEmptyInt opType = 66 + opStructFieldNPtrHeadStringTagInt opType = 67 + opStructFieldNPtrAnonymousHeadInt opType = 68 + opStructFieldNPtrAnonymousHeadOmitEmptyInt opType = 69 + opStructFieldNPtrAnonymousHeadStringTagInt opType = 70 + opStructFieldHeadUint opType = 71 + opStructFieldHeadOmitEmptyUint opType = 72 + opStructFieldHeadStringTagUint opType = 73 + opStructFieldAnonymousHeadUint opType = 74 + opStructFieldAnonymousHeadOmitEmptyUint opType = 75 + opStructFieldAnonymousHeadStringTagUint opType = 76 + opStructFieldPtrHeadUint opType = 77 + opStructFieldPtrHeadOmitEmptyUint opType = 78 + opStructFieldPtrHeadStringTagUint opType = 79 + opStructFieldPtrAnonymousHeadUint opType = 80 + opStructFieldPtrAnonymousHeadOmitEmptyUint opType = 81 + opStructFieldPtrAnonymousHeadStringTagUint opType = 82 + opStructFieldNPtrHeadUint opType = 83 + opStructFieldNPtrHeadOmitEmptyUint opType = 84 + opStructFieldNPtrHeadStringTagUint opType = 85 + opStructFieldNPtrAnonymousHeadUint opType = 86 + opStructFieldNPtrAnonymousHeadOmitEmptyUint opType = 87 + opStructFieldNPtrAnonymousHeadStringTagUint opType = 88 + opStructFieldHeadFloat32 opType = 89 + opStructFieldHeadOmitEmptyFloat32 opType = 90 + opStructFieldHeadStringTagFloat32 opType = 91 + opStructFieldAnonymousHeadFloat32 opType = 92 + opStructFieldAnonymousHeadOmitEmptyFloat32 opType = 93 + opStructFieldAnonymousHeadStringTagFloat32 opType = 94 + opStructFieldPtrHeadFloat32 opType = 95 + opStructFieldPtrHeadOmitEmptyFloat32 opType = 96 + opStructFieldPtrHeadStringTagFloat32 opType = 97 + opStructFieldPtrAnonymousHeadFloat32 opType = 98 + opStructFieldPtrAnonymousHeadOmitEmptyFloat32 opType = 99 + opStructFieldPtrAnonymousHeadStringTagFloat32 opType = 100 + opStructFieldNPtrHeadFloat32 opType = 101 + opStructFieldNPtrHeadOmitEmptyFloat32 opType = 102 + opStructFieldNPtrHeadStringTagFloat32 opType = 103 + opStructFieldNPtrAnonymousHeadFloat32 opType = 104 + opStructFieldNPtrAnonymousHeadOmitEmptyFloat32 opType = 105 + opStructFieldNPtrAnonymousHeadStringTagFloat32 opType = 106 + opStructFieldHeadFloat64 opType = 107 + opStructFieldHeadOmitEmptyFloat64 opType = 108 + opStructFieldHeadStringTagFloat64 opType = 109 + opStructFieldAnonymousHeadFloat64 opType = 110 + opStructFieldAnonymousHeadOmitEmptyFloat64 opType = 111 + opStructFieldAnonymousHeadStringTagFloat64 opType = 112 + opStructFieldPtrHeadFloat64 opType = 113 + opStructFieldPtrHeadOmitEmptyFloat64 opType = 114 + opStructFieldPtrHeadStringTagFloat64 opType = 115 + opStructFieldPtrAnonymousHeadFloat64 opType = 116 + opStructFieldPtrAnonymousHeadOmitEmptyFloat64 opType = 117 + opStructFieldPtrAnonymousHeadStringTagFloat64 opType = 118 + opStructFieldNPtrHeadFloat64 opType = 119 + opStructFieldNPtrHeadOmitEmptyFloat64 opType = 120 + opStructFieldNPtrHeadStringTagFloat64 opType = 121 + opStructFieldNPtrAnonymousHeadFloat64 opType = 122 + opStructFieldNPtrAnonymousHeadOmitEmptyFloat64 opType = 123 + opStructFieldNPtrAnonymousHeadStringTagFloat64 opType = 124 + opStructFieldHeadBool opType = 125 + opStructFieldHeadOmitEmptyBool opType = 126 + opStructFieldHeadStringTagBool opType = 127 + opStructFieldAnonymousHeadBool opType = 128 + opStructFieldAnonymousHeadOmitEmptyBool opType = 129 + opStructFieldAnonymousHeadStringTagBool opType = 130 + opStructFieldPtrHeadBool opType = 131 + opStructFieldPtrHeadOmitEmptyBool opType = 132 + opStructFieldPtrHeadStringTagBool opType = 133 + opStructFieldPtrAnonymousHeadBool opType = 134 + opStructFieldPtrAnonymousHeadOmitEmptyBool opType = 135 + opStructFieldPtrAnonymousHeadStringTagBool opType = 136 + opStructFieldNPtrHeadBool opType = 137 + opStructFieldNPtrHeadOmitEmptyBool opType = 138 + opStructFieldNPtrHeadStringTagBool opType = 139 + opStructFieldNPtrAnonymousHeadBool opType = 140 + opStructFieldNPtrAnonymousHeadOmitEmptyBool opType = 141 + opStructFieldNPtrAnonymousHeadStringTagBool opType = 142 + opStructFieldHeadString opType = 143 + opStructFieldHeadOmitEmptyString opType = 144 + opStructFieldHeadStringTagString opType = 145 + opStructFieldAnonymousHeadString opType = 146 + opStructFieldAnonymousHeadOmitEmptyString opType = 147 + opStructFieldAnonymousHeadStringTagString opType = 148 + opStructFieldPtrHeadString opType = 149 + opStructFieldPtrHeadOmitEmptyString opType = 150 + opStructFieldPtrHeadStringTagString opType = 151 + opStructFieldPtrAnonymousHeadString opType = 152 + opStructFieldPtrAnonymousHeadOmitEmptyString opType = 153 + opStructFieldPtrAnonymousHeadStringTagString opType = 154 + opStructFieldNPtrHeadString opType = 155 + opStructFieldNPtrHeadOmitEmptyString opType = 156 + opStructFieldNPtrHeadStringTagString opType = 157 + opStructFieldNPtrAnonymousHeadString opType = 158 + opStructFieldNPtrAnonymousHeadOmitEmptyString opType = 159 + opStructFieldNPtrAnonymousHeadStringTagString opType = 160 + opStructFieldHeadBytes opType = 161 + opStructFieldHeadOmitEmptyBytes opType = 162 + opStructFieldHeadStringTagBytes opType = 163 + opStructFieldAnonymousHeadBytes opType = 164 + opStructFieldAnonymousHeadOmitEmptyBytes opType = 165 + opStructFieldAnonymousHeadStringTagBytes opType = 166 + opStructFieldPtrHeadBytes opType = 167 + opStructFieldPtrHeadOmitEmptyBytes opType = 168 + opStructFieldPtrHeadStringTagBytes opType = 169 + opStructFieldPtrAnonymousHeadBytes opType = 170 + opStructFieldPtrAnonymousHeadOmitEmptyBytes opType = 171 + opStructFieldPtrAnonymousHeadStringTagBytes opType = 172 + opStructFieldNPtrHeadBytes opType = 173 + opStructFieldNPtrHeadOmitEmptyBytes opType = 174 + opStructFieldNPtrHeadStringTagBytes opType = 175 + opStructFieldNPtrAnonymousHeadBytes opType = 176 + opStructFieldNPtrAnonymousHeadOmitEmptyBytes opType = 177 + opStructFieldNPtrAnonymousHeadStringTagBytes opType = 178 + opStructFieldHeadArray opType = 179 + opStructFieldHeadOmitEmptyArray opType = 180 + opStructFieldHeadStringTagArray opType = 181 + opStructFieldAnonymousHeadArray opType = 182 + opStructFieldAnonymousHeadOmitEmptyArray opType = 183 + opStructFieldAnonymousHeadStringTagArray opType = 184 + opStructFieldPtrHeadArray opType = 185 + opStructFieldPtrHeadOmitEmptyArray opType = 186 + opStructFieldPtrHeadStringTagArray opType = 187 + opStructFieldPtrAnonymousHeadArray opType = 188 + opStructFieldPtrAnonymousHeadOmitEmptyArray opType = 189 + opStructFieldPtrAnonymousHeadStringTagArray opType = 190 + opStructFieldNPtrHeadArray opType = 191 + opStructFieldNPtrHeadOmitEmptyArray opType = 192 + opStructFieldNPtrHeadStringTagArray opType = 193 + opStructFieldNPtrAnonymousHeadArray opType = 194 + opStructFieldNPtrAnonymousHeadOmitEmptyArray opType = 195 + opStructFieldNPtrAnonymousHeadStringTagArray opType = 196 + opStructFieldHeadMap opType = 197 + opStructFieldHeadOmitEmptyMap opType = 198 + opStructFieldHeadStringTagMap opType = 199 + opStructFieldAnonymousHeadMap opType = 200 + opStructFieldAnonymousHeadOmitEmptyMap opType = 201 + opStructFieldAnonymousHeadStringTagMap opType = 202 + opStructFieldPtrHeadMap opType = 203 + opStructFieldPtrHeadOmitEmptyMap opType = 204 + opStructFieldPtrHeadStringTagMap opType = 205 + opStructFieldPtrAnonymousHeadMap opType = 206 + opStructFieldPtrAnonymousHeadOmitEmptyMap opType = 207 + opStructFieldPtrAnonymousHeadStringTagMap opType = 208 + opStructFieldNPtrHeadMap opType = 209 + opStructFieldNPtrHeadOmitEmptyMap opType = 210 + opStructFieldNPtrHeadStringTagMap opType = 211 + opStructFieldNPtrAnonymousHeadMap opType = 212 + opStructFieldNPtrAnonymousHeadOmitEmptyMap opType = 213 + opStructFieldNPtrAnonymousHeadStringTagMap opType = 214 + opStructFieldHeadMapLoad opType = 215 + opStructFieldHeadOmitEmptyMapLoad opType = 216 + opStructFieldHeadStringTagMapLoad opType = 217 + opStructFieldAnonymousHeadMapLoad opType = 218 + opStructFieldAnonymousHeadOmitEmptyMapLoad opType = 219 + opStructFieldAnonymousHeadStringTagMapLoad opType = 220 + opStructFieldPtrHeadMapLoad opType = 221 + opStructFieldPtrHeadOmitEmptyMapLoad opType = 222 + opStructFieldPtrHeadStringTagMapLoad opType = 223 + opStructFieldPtrAnonymousHeadMapLoad opType = 224 + opStructFieldPtrAnonymousHeadOmitEmptyMapLoad opType = 225 + opStructFieldPtrAnonymousHeadStringTagMapLoad opType = 226 + opStructFieldNPtrHeadMapLoad opType = 227 + opStructFieldNPtrHeadOmitEmptyMapLoad opType = 228 + opStructFieldNPtrHeadStringTagMapLoad opType = 229 + opStructFieldNPtrAnonymousHeadMapLoad opType = 230 + opStructFieldNPtrAnonymousHeadOmitEmptyMapLoad opType = 231 + opStructFieldNPtrAnonymousHeadStringTagMapLoad opType = 232 + opStructFieldHeadSlice opType = 233 + opStructFieldHeadOmitEmptySlice opType = 234 + opStructFieldHeadStringTagSlice opType = 235 + opStructFieldAnonymousHeadSlice opType = 236 + opStructFieldAnonymousHeadOmitEmptySlice opType = 237 + opStructFieldAnonymousHeadStringTagSlice opType = 238 + opStructFieldPtrHeadSlice opType = 239 + opStructFieldPtrHeadOmitEmptySlice opType = 240 + opStructFieldPtrHeadStringTagSlice opType = 241 + opStructFieldPtrAnonymousHeadSlice opType = 242 + opStructFieldPtrAnonymousHeadOmitEmptySlice opType = 243 + opStructFieldPtrAnonymousHeadStringTagSlice opType = 244 + opStructFieldNPtrHeadSlice opType = 245 + opStructFieldNPtrHeadOmitEmptySlice opType = 246 + opStructFieldNPtrHeadStringTagSlice opType = 247 + opStructFieldNPtrAnonymousHeadSlice opType = 248 + opStructFieldNPtrAnonymousHeadOmitEmptySlice opType = 249 + opStructFieldNPtrAnonymousHeadStringTagSlice opType = 250 + opStructFieldHeadStruct opType = 251 + opStructFieldHeadOmitEmptyStruct opType = 252 + opStructFieldHeadStringTagStruct opType = 253 + opStructFieldAnonymousHeadStruct opType = 254 + opStructFieldAnonymousHeadOmitEmptyStruct opType = 255 + opStructFieldAnonymousHeadStringTagStruct opType = 256 + opStructFieldPtrHeadStruct opType = 257 + opStructFieldPtrHeadOmitEmptyStruct opType = 258 + opStructFieldPtrHeadStringTagStruct opType = 259 + opStructFieldPtrAnonymousHeadStruct opType = 260 + opStructFieldPtrAnonymousHeadOmitEmptyStruct opType = 261 + opStructFieldPtrAnonymousHeadStringTagStruct opType = 262 + opStructFieldNPtrHeadStruct opType = 263 + opStructFieldNPtrHeadOmitEmptyStruct opType = 264 + opStructFieldNPtrHeadStringTagStruct opType = 265 + opStructFieldNPtrAnonymousHeadStruct opType = 266 + opStructFieldNPtrAnonymousHeadOmitEmptyStruct opType = 267 + opStructFieldNPtrAnonymousHeadStringTagStruct opType = 268 + opStructFieldHeadMarshalJSON opType = 269 + opStructFieldHeadOmitEmptyMarshalJSON opType = 270 + opStructFieldHeadStringTagMarshalJSON opType = 271 + opStructFieldAnonymousHeadMarshalJSON opType = 272 + opStructFieldAnonymousHeadOmitEmptyMarshalJSON opType = 273 + opStructFieldAnonymousHeadStringTagMarshalJSON opType = 274 + opStructFieldPtrHeadMarshalJSON opType = 275 + opStructFieldPtrHeadOmitEmptyMarshalJSON opType = 276 + opStructFieldPtrHeadStringTagMarshalJSON opType = 277 + opStructFieldPtrAnonymousHeadMarshalJSON opType = 278 + opStructFieldPtrAnonymousHeadOmitEmptyMarshalJSON opType = 279 + opStructFieldPtrAnonymousHeadStringTagMarshalJSON opType = 280 + opStructFieldNPtrHeadMarshalJSON opType = 281 + opStructFieldNPtrHeadOmitEmptyMarshalJSON opType = 282 + opStructFieldNPtrHeadStringTagMarshalJSON opType = 283 + opStructFieldNPtrAnonymousHeadMarshalJSON opType = 284 + opStructFieldNPtrAnonymousHeadOmitEmptyMarshalJSON opType = 285 + opStructFieldNPtrAnonymousHeadStringTagMarshalJSON opType = 286 + opStructFieldHeadMarshalText opType = 287 + opStructFieldHeadOmitEmptyMarshalText opType = 288 + opStructFieldHeadStringTagMarshalText opType = 289 + opStructFieldAnonymousHeadMarshalText opType = 290 + opStructFieldAnonymousHeadOmitEmptyMarshalText opType = 291 + opStructFieldAnonymousHeadStringTagMarshalText opType = 292 + opStructFieldPtrHeadMarshalText opType = 293 + opStructFieldPtrHeadOmitEmptyMarshalText opType = 294 + opStructFieldPtrHeadStringTagMarshalText opType = 295 + opStructFieldPtrAnonymousHeadMarshalText opType = 296 + opStructFieldPtrAnonymousHeadOmitEmptyMarshalText opType = 297 + opStructFieldPtrAnonymousHeadStringTagMarshalText opType = 298 + opStructFieldNPtrHeadMarshalText opType = 299 + opStructFieldNPtrHeadOmitEmptyMarshalText opType = 300 + opStructFieldNPtrHeadStringTagMarshalText opType = 301 + opStructFieldNPtrAnonymousHeadMarshalText opType = 302 + opStructFieldNPtrAnonymousHeadOmitEmptyMarshalText opType = 303 + opStructFieldNPtrAnonymousHeadStringTagMarshalText opType = 304 + opStructFieldHeadRecursive opType = 305 + opStructFieldHeadOmitEmptyRecursive opType = 306 + opStructFieldHeadStringTagRecursive opType = 307 + opStructFieldAnonymousHeadRecursive opType = 308 + opStructFieldAnonymousHeadOmitEmptyRecursive opType = 309 + opStructFieldAnonymousHeadStringTagRecursive opType = 310 + opStructFieldPtrHeadRecursive opType = 311 + opStructFieldPtrHeadOmitEmptyRecursive opType = 312 + opStructFieldPtrHeadStringTagRecursive opType = 313 + opStructFieldPtrAnonymousHeadRecursive opType = 314 + opStructFieldPtrAnonymousHeadOmitEmptyRecursive opType = 315 + opStructFieldPtrAnonymousHeadStringTagRecursive opType = 316 + opStructFieldNPtrHeadRecursive opType = 317 + opStructFieldNPtrHeadOmitEmptyRecursive opType = 318 + opStructFieldNPtrHeadStringTagRecursive opType = 319 + opStructFieldNPtrAnonymousHeadRecursive opType = 320 + opStructFieldNPtrAnonymousHeadOmitEmptyRecursive opType = 321 + opStructFieldNPtrAnonymousHeadStringTagRecursive opType = 322 + opStructFieldHeadIntString opType = 323 + opStructFieldHeadOmitEmptyIntString opType = 324 + opStructFieldHeadStringTagIntString opType = 325 + opStructFieldAnonymousHeadIntString opType = 326 + opStructFieldAnonymousHeadOmitEmptyIntString opType = 327 + opStructFieldAnonymousHeadStringTagIntString opType = 328 + opStructFieldPtrHeadIntString opType = 329 + opStructFieldPtrHeadOmitEmptyIntString opType = 330 + opStructFieldPtrHeadStringTagIntString opType = 331 + opStructFieldPtrAnonymousHeadIntString opType = 332 + opStructFieldPtrAnonymousHeadOmitEmptyIntString opType = 333 + opStructFieldPtrAnonymousHeadStringTagIntString opType = 334 + opStructFieldNPtrHeadIntString opType = 335 + opStructFieldNPtrHeadOmitEmptyIntString opType = 336 + opStructFieldNPtrHeadStringTagIntString opType = 337 + opStructFieldNPtrAnonymousHeadIntString opType = 338 + opStructFieldNPtrAnonymousHeadOmitEmptyIntString opType = 339 + opStructFieldNPtrAnonymousHeadStringTagIntString opType = 340 + opStructFieldHeadUintString opType = 341 + opStructFieldHeadOmitEmptyUintString opType = 342 + opStructFieldHeadStringTagUintString opType = 343 + opStructFieldAnonymousHeadUintString opType = 344 + opStructFieldAnonymousHeadOmitEmptyUintString opType = 345 + opStructFieldAnonymousHeadStringTagUintString opType = 346 + opStructFieldPtrHeadUintString opType = 347 + opStructFieldPtrHeadOmitEmptyUintString opType = 348 + opStructFieldPtrHeadStringTagUintString opType = 349 + opStructFieldPtrAnonymousHeadUintString opType = 350 + opStructFieldPtrAnonymousHeadOmitEmptyUintString opType = 351 + opStructFieldPtrAnonymousHeadStringTagUintString opType = 352 + opStructFieldNPtrHeadUintString opType = 353 + opStructFieldNPtrHeadOmitEmptyUintString opType = 354 + opStructFieldNPtrHeadStringTagUintString opType = 355 + opStructFieldNPtrAnonymousHeadUintString opType = 356 + opStructFieldNPtrAnonymousHeadOmitEmptyUintString opType = 357 + opStructFieldNPtrAnonymousHeadStringTagUintString opType = 358 + opStructFieldHeadIntPtr opType = 359 + opStructFieldHeadOmitEmptyIntPtr opType = 360 + opStructFieldHeadStringTagIntPtr opType = 361 + opStructFieldAnonymousHeadIntPtr opType = 362 + opStructFieldAnonymousHeadOmitEmptyIntPtr opType = 363 + opStructFieldAnonymousHeadStringTagIntPtr opType = 364 + opStructFieldPtrHeadIntPtr opType = 365 + opStructFieldPtrHeadOmitEmptyIntPtr opType = 366 + opStructFieldPtrHeadStringTagIntPtr opType = 367 + opStructFieldPtrAnonymousHeadIntPtr opType = 368 + opStructFieldPtrAnonymousHeadOmitEmptyIntPtr opType = 369 + opStructFieldPtrAnonymousHeadStringTagIntPtr opType = 370 + opStructFieldNPtrHeadIntPtr opType = 371 + opStructFieldNPtrHeadOmitEmptyIntPtr opType = 372 + opStructFieldNPtrHeadStringTagIntPtr opType = 373 + opStructFieldNPtrAnonymousHeadIntPtr opType = 374 + opStructFieldNPtrAnonymousHeadOmitEmptyIntPtr opType = 375 + opStructFieldNPtrAnonymousHeadStringTagIntPtr opType = 376 + opStructFieldHeadUintPtr opType = 377 + opStructFieldHeadOmitEmptyUintPtr opType = 378 + opStructFieldHeadStringTagUintPtr opType = 379 + opStructFieldAnonymousHeadUintPtr opType = 380 + opStructFieldAnonymousHeadOmitEmptyUintPtr opType = 381 + opStructFieldAnonymousHeadStringTagUintPtr opType = 382 + opStructFieldPtrHeadUintPtr opType = 383 + opStructFieldPtrHeadOmitEmptyUintPtr opType = 384 + opStructFieldPtrHeadStringTagUintPtr opType = 385 + opStructFieldPtrAnonymousHeadUintPtr opType = 386 + opStructFieldPtrAnonymousHeadOmitEmptyUintPtr opType = 387 + opStructFieldPtrAnonymousHeadStringTagUintPtr opType = 388 + opStructFieldNPtrHeadUintPtr opType = 389 + opStructFieldNPtrHeadOmitEmptyUintPtr opType = 390 + opStructFieldNPtrHeadStringTagUintPtr opType = 391 + opStructFieldNPtrAnonymousHeadUintPtr opType = 392 + opStructFieldNPtrAnonymousHeadOmitEmptyUintPtr opType = 393 + opStructFieldNPtrAnonymousHeadStringTagUintPtr opType = 394 + opStructFieldHeadFloat32Ptr opType = 395 + opStructFieldHeadOmitEmptyFloat32Ptr opType = 396 + opStructFieldHeadStringTagFloat32Ptr opType = 397 + opStructFieldAnonymousHeadFloat32Ptr opType = 398 + opStructFieldAnonymousHeadOmitEmptyFloat32Ptr opType = 399 + opStructFieldAnonymousHeadStringTagFloat32Ptr opType = 400 + opStructFieldPtrHeadFloat32Ptr opType = 401 + opStructFieldPtrHeadOmitEmptyFloat32Ptr opType = 402 + opStructFieldPtrHeadStringTagFloat32Ptr opType = 403 + opStructFieldPtrAnonymousHeadFloat32Ptr opType = 404 + opStructFieldPtrAnonymousHeadOmitEmptyFloat32Ptr opType = 405 + opStructFieldPtrAnonymousHeadStringTagFloat32Ptr opType = 406 + opStructFieldNPtrHeadFloat32Ptr opType = 407 + opStructFieldNPtrHeadOmitEmptyFloat32Ptr opType = 408 + opStructFieldNPtrHeadStringTagFloat32Ptr opType = 409 + opStructFieldNPtrAnonymousHeadFloat32Ptr opType = 410 + opStructFieldNPtrAnonymousHeadOmitEmptyFloat32Ptr opType = 411 + opStructFieldNPtrAnonymousHeadStringTagFloat32Ptr opType = 412 + opStructFieldHeadFloat64Ptr opType = 413 + opStructFieldHeadOmitEmptyFloat64Ptr opType = 414 + opStructFieldHeadStringTagFloat64Ptr opType = 415 + opStructFieldAnonymousHeadFloat64Ptr opType = 416 + opStructFieldAnonymousHeadOmitEmptyFloat64Ptr opType = 417 + opStructFieldAnonymousHeadStringTagFloat64Ptr opType = 418 + opStructFieldPtrHeadFloat64Ptr opType = 419 + opStructFieldPtrHeadOmitEmptyFloat64Ptr opType = 420 + opStructFieldPtrHeadStringTagFloat64Ptr opType = 421 + opStructFieldPtrAnonymousHeadFloat64Ptr opType = 422 + opStructFieldPtrAnonymousHeadOmitEmptyFloat64Ptr opType = 423 + opStructFieldPtrAnonymousHeadStringTagFloat64Ptr opType = 424 + opStructFieldNPtrHeadFloat64Ptr opType = 425 + opStructFieldNPtrHeadOmitEmptyFloat64Ptr opType = 426 + opStructFieldNPtrHeadStringTagFloat64Ptr opType = 427 + opStructFieldNPtrAnonymousHeadFloat64Ptr opType = 428 + opStructFieldNPtrAnonymousHeadOmitEmptyFloat64Ptr opType = 429 + opStructFieldNPtrAnonymousHeadStringTagFloat64Ptr opType = 430 + opStructFieldHeadBoolPtr opType = 431 + opStructFieldHeadOmitEmptyBoolPtr opType = 432 + opStructFieldHeadStringTagBoolPtr opType = 433 + opStructFieldAnonymousHeadBoolPtr opType = 434 + opStructFieldAnonymousHeadOmitEmptyBoolPtr opType = 435 + opStructFieldAnonymousHeadStringTagBoolPtr opType = 436 + opStructFieldPtrHeadBoolPtr opType = 437 + opStructFieldPtrHeadOmitEmptyBoolPtr opType = 438 + opStructFieldPtrHeadStringTagBoolPtr opType = 439 + opStructFieldPtrAnonymousHeadBoolPtr opType = 440 + opStructFieldPtrAnonymousHeadOmitEmptyBoolPtr opType = 441 + opStructFieldPtrAnonymousHeadStringTagBoolPtr opType = 442 + opStructFieldNPtrHeadBoolPtr opType = 443 + opStructFieldNPtrHeadOmitEmptyBoolPtr opType = 444 + opStructFieldNPtrHeadStringTagBoolPtr opType = 445 + opStructFieldNPtrAnonymousHeadBoolPtr opType = 446 + opStructFieldNPtrAnonymousHeadOmitEmptyBoolPtr opType = 447 + opStructFieldNPtrAnonymousHeadStringTagBoolPtr opType = 448 + opStructFieldHeadStringPtr opType = 449 + opStructFieldHeadOmitEmptyStringPtr opType = 450 + opStructFieldHeadStringTagStringPtr opType = 451 + opStructFieldAnonymousHeadStringPtr opType = 452 + opStructFieldAnonymousHeadOmitEmptyStringPtr opType = 453 + opStructFieldAnonymousHeadStringTagStringPtr opType = 454 + opStructFieldPtrHeadStringPtr opType = 455 + opStructFieldPtrHeadOmitEmptyStringPtr opType = 456 + opStructFieldPtrHeadStringTagStringPtr opType = 457 + opStructFieldPtrAnonymousHeadStringPtr opType = 458 + opStructFieldPtrAnonymousHeadOmitEmptyStringPtr opType = 459 + opStructFieldPtrAnonymousHeadStringTagStringPtr opType = 460 + opStructFieldNPtrHeadStringPtr opType = 461 + opStructFieldNPtrHeadOmitEmptyStringPtr opType = 462 + opStructFieldNPtrHeadStringTagStringPtr opType = 463 + opStructFieldNPtrAnonymousHeadStringPtr opType = 464 + opStructFieldNPtrAnonymousHeadOmitEmptyStringPtr opType = 465 + opStructFieldNPtrAnonymousHeadStringTagStringPtr opType = 466 + opStructFieldHeadBytesPtr opType = 467 + opStructFieldHeadOmitEmptyBytesPtr opType = 468 + opStructFieldHeadStringTagBytesPtr opType = 469 + opStructFieldAnonymousHeadBytesPtr opType = 470 + opStructFieldAnonymousHeadOmitEmptyBytesPtr opType = 471 + opStructFieldAnonymousHeadStringTagBytesPtr opType = 472 + opStructFieldPtrHeadBytesPtr opType = 473 + opStructFieldPtrHeadOmitEmptyBytesPtr opType = 474 + opStructFieldPtrHeadStringTagBytesPtr opType = 475 + opStructFieldPtrAnonymousHeadBytesPtr opType = 476 + opStructFieldPtrAnonymousHeadOmitEmptyBytesPtr opType = 477 + opStructFieldPtrAnonymousHeadStringTagBytesPtr opType = 478 + opStructFieldNPtrHeadBytesPtr opType = 479 + opStructFieldNPtrHeadOmitEmptyBytesPtr opType = 480 + opStructFieldNPtrHeadStringTagBytesPtr opType = 481 + opStructFieldNPtrAnonymousHeadBytesPtr opType = 482 + opStructFieldNPtrAnonymousHeadOmitEmptyBytesPtr opType = 483 + opStructFieldNPtrAnonymousHeadStringTagBytesPtr opType = 484 + opStructFieldHeadArrayPtr opType = 485 + opStructFieldHeadOmitEmptyArrayPtr opType = 486 + opStructFieldHeadStringTagArrayPtr opType = 487 + opStructFieldAnonymousHeadArrayPtr opType = 488 + opStructFieldAnonymousHeadOmitEmptyArrayPtr opType = 489 + opStructFieldAnonymousHeadStringTagArrayPtr opType = 490 + opStructFieldPtrHeadArrayPtr opType = 491 + opStructFieldPtrHeadOmitEmptyArrayPtr opType = 492 + opStructFieldPtrHeadStringTagArrayPtr opType = 493 + opStructFieldPtrAnonymousHeadArrayPtr opType = 494 + opStructFieldPtrAnonymousHeadOmitEmptyArrayPtr opType = 495 + opStructFieldPtrAnonymousHeadStringTagArrayPtr opType = 496 + opStructFieldNPtrHeadArrayPtr opType = 497 + opStructFieldNPtrHeadOmitEmptyArrayPtr opType = 498 + opStructFieldNPtrHeadStringTagArrayPtr opType = 499 + opStructFieldNPtrAnonymousHeadArrayPtr opType = 500 + opStructFieldNPtrAnonymousHeadOmitEmptyArrayPtr opType = 501 + opStructFieldNPtrAnonymousHeadStringTagArrayPtr opType = 502 + opStructFieldHeadSlicePtr opType = 503 + opStructFieldHeadOmitEmptySlicePtr opType = 504 + opStructFieldHeadStringTagSlicePtr opType = 505 + opStructFieldAnonymousHeadSlicePtr opType = 506 + opStructFieldAnonymousHeadOmitEmptySlicePtr opType = 507 + opStructFieldAnonymousHeadStringTagSlicePtr opType = 508 + opStructFieldPtrHeadSlicePtr opType = 509 + opStructFieldPtrHeadOmitEmptySlicePtr opType = 510 + opStructFieldPtrHeadStringTagSlicePtr opType = 511 + opStructFieldPtrAnonymousHeadSlicePtr opType = 512 + opStructFieldPtrAnonymousHeadOmitEmptySlicePtr opType = 513 + opStructFieldPtrAnonymousHeadStringTagSlicePtr opType = 514 + opStructFieldNPtrHeadSlicePtr opType = 515 + opStructFieldNPtrHeadOmitEmptySlicePtr opType = 516 + opStructFieldNPtrHeadStringTagSlicePtr opType = 517 + opStructFieldNPtrAnonymousHeadSlicePtr opType = 518 + opStructFieldNPtrAnonymousHeadOmitEmptySlicePtr opType = 519 + opStructFieldNPtrAnonymousHeadStringTagSlicePtr opType = 520 + opStructFieldHeadMapPtr opType = 521 + opStructFieldHeadOmitEmptyMapPtr opType = 522 + opStructFieldHeadStringTagMapPtr opType = 523 + opStructFieldAnonymousHeadMapPtr opType = 524 + opStructFieldAnonymousHeadOmitEmptyMapPtr opType = 525 + opStructFieldAnonymousHeadStringTagMapPtr opType = 526 + opStructFieldPtrHeadMapPtr opType = 527 + opStructFieldPtrHeadOmitEmptyMapPtr opType = 528 + opStructFieldPtrHeadStringTagMapPtr opType = 529 + opStructFieldPtrAnonymousHeadMapPtr opType = 530 + opStructFieldPtrAnonymousHeadOmitEmptyMapPtr opType = 531 + opStructFieldPtrAnonymousHeadStringTagMapPtr opType = 532 + opStructFieldNPtrHeadMapPtr opType = 533 + opStructFieldNPtrHeadOmitEmptyMapPtr opType = 534 + opStructFieldNPtrHeadStringTagMapPtr opType = 535 + opStructFieldNPtrAnonymousHeadMapPtr opType = 536 + opStructFieldNPtrAnonymousHeadOmitEmptyMapPtr opType = 537 + opStructFieldNPtrAnonymousHeadStringTagMapPtr opType = 538 + opStructFieldHeadIntNPtr opType = 539 + opStructFieldHeadOmitEmptyIntNPtr opType = 540 + opStructFieldHeadStringTagIntNPtr opType = 541 + opStructFieldAnonymousHeadIntNPtr opType = 542 + opStructFieldAnonymousHeadOmitEmptyIntNPtr opType = 543 + opStructFieldAnonymousHeadStringTagIntNPtr opType = 544 + opStructFieldPtrHeadIntNPtr opType = 545 + opStructFieldPtrHeadOmitEmptyIntNPtr opType = 546 + opStructFieldPtrHeadStringTagIntNPtr opType = 547 + opStructFieldPtrAnonymousHeadIntNPtr opType = 548 + opStructFieldPtrAnonymousHeadOmitEmptyIntNPtr opType = 549 + opStructFieldPtrAnonymousHeadStringTagIntNPtr opType = 550 + opStructFieldNPtrHeadIntNPtr opType = 551 + opStructFieldNPtrHeadOmitEmptyIntNPtr opType = 552 + opStructFieldNPtrHeadStringTagIntNPtr opType = 553 + opStructFieldNPtrAnonymousHeadIntNPtr opType = 554 + opStructFieldNPtrAnonymousHeadOmitEmptyIntNPtr opType = 555 + opStructFieldNPtrAnonymousHeadStringTagIntNPtr opType = 556 + opStructFieldHeadUintNPtr opType = 557 + opStructFieldHeadOmitEmptyUintNPtr opType = 558 + opStructFieldHeadStringTagUintNPtr opType = 559 + opStructFieldAnonymousHeadUintNPtr opType = 560 + opStructFieldAnonymousHeadOmitEmptyUintNPtr opType = 561 + opStructFieldAnonymousHeadStringTagUintNPtr opType = 562 + opStructFieldPtrHeadUintNPtr opType = 563 + opStructFieldPtrHeadOmitEmptyUintNPtr opType = 564 + opStructFieldPtrHeadStringTagUintNPtr opType = 565 + opStructFieldPtrAnonymousHeadUintNPtr opType = 566 + opStructFieldPtrAnonymousHeadOmitEmptyUintNPtr opType = 567 + opStructFieldPtrAnonymousHeadStringTagUintNPtr opType = 568 + opStructFieldNPtrHeadUintNPtr opType = 569 + opStructFieldNPtrHeadOmitEmptyUintNPtr opType = 570 + opStructFieldNPtrHeadStringTagUintNPtr opType = 571 + opStructFieldNPtrAnonymousHeadUintNPtr opType = 572 + opStructFieldNPtrAnonymousHeadOmitEmptyUintNPtr opType = 573 + opStructFieldNPtrAnonymousHeadStringTagUintNPtr opType = 574 + opStructFieldHeadFloat32NPtr opType = 575 + opStructFieldHeadOmitEmptyFloat32NPtr opType = 576 + opStructFieldHeadStringTagFloat32NPtr opType = 577 + opStructFieldAnonymousHeadFloat32NPtr opType = 578 + opStructFieldAnonymousHeadOmitEmptyFloat32NPtr opType = 579 + opStructFieldAnonymousHeadStringTagFloat32NPtr opType = 580 + opStructFieldPtrHeadFloat32NPtr opType = 581 + opStructFieldPtrHeadOmitEmptyFloat32NPtr opType = 582 + opStructFieldPtrHeadStringTagFloat32NPtr opType = 583 + opStructFieldPtrAnonymousHeadFloat32NPtr opType = 584 + opStructFieldPtrAnonymousHeadOmitEmptyFloat32NPtr opType = 585 + opStructFieldPtrAnonymousHeadStringTagFloat32NPtr opType = 586 + opStructFieldNPtrHeadFloat32NPtr opType = 587 + opStructFieldNPtrHeadOmitEmptyFloat32NPtr opType = 588 + opStructFieldNPtrHeadStringTagFloat32NPtr opType = 589 + opStructFieldNPtrAnonymousHeadFloat32NPtr opType = 590 + opStructFieldNPtrAnonymousHeadOmitEmptyFloat32NPtr opType = 591 + opStructFieldNPtrAnonymousHeadStringTagFloat32NPtr opType = 592 + opStructFieldHeadFloat64NPtr opType = 593 + opStructFieldHeadOmitEmptyFloat64NPtr opType = 594 + opStructFieldHeadStringTagFloat64NPtr opType = 595 + opStructFieldAnonymousHeadFloat64NPtr opType = 596 + opStructFieldAnonymousHeadOmitEmptyFloat64NPtr opType = 597 + opStructFieldAnonymousHeadStringTagFloat64NPtr opType = 598 + opStructFieldPtrHeadFloat64NPtr opType = 599 + opStructFieldPtrHeadOmitEmptyFloat64NPtr opType = 600 + opStructFieldPtrHeadStringTagFloat64NPtr opType = 601 + opStructFieldPtrAnonymousHeadFloat64NPtr opType = 602 + opStructFieldPtrAnonymousHeadOmitEmptyFloat64NPtr opType = 603 + opStructFieldPtrAnonymousHeadStringTagFloat64NPtr opType = 604 + opStructFieldNPtrHeadFloat64NPtr opType = 605 + opStructFieldNPtrHeadOmitEmptyFloat64NPtr opType = 606 + opStructFieldNPtrHeadStringTagFloat64NPtr opType = 607 + opStructFieldNPtrAnonymousHeadFloat64NPtr opType = 608 + opStructFieldNPtrAnonymousHeadOmitEmptyFloat64NPtr opType = 609 + opStructFieldNPtrAnonymousHeadStringTagFloat64NPtr opType = 610 + opStructFieldHeadBoolNPtr opType = 611 + opStructFieldHeadOmitEmptyBoolNPtr opType = 612 + opStructFieldHeadStringTagBoolNPtr opType = 613 + opStructFieldAnonymousHeadBoolNPtr opType = 614 + opStructFieldAnonymousHeadOmitEmptyBoolNPtr opType = 615 + opStructFieldAnonymousHeadStringTagBoolNPtr opType = 616 + opStructFieldPtrHeadBoolNPtr opType = 617 + opStructFieldPtrHeadOmitEmptyBoolNPtr opType = 618 + opStructFieldPtrHeadStringTagBoolNPtr opType = 619 + opStructFieldPtrAnonymousHeadBoolNPtr opType = 620 + opStructFieldPtrAnonymousHeadOmitEmptyBoolNPtr opType = 621 + opStructFieldPtrAnonymousHeadStringTagBoolNPtr opType = 622 + opStructFieldNPtrHeadBoolNPtr opType = 623 + opStructFieldNPtrHeadOmitEmptyBoolNPtr opType = 624 + opStructFieldNPtrHeadStringTagBoolNPtr opType = 625 + opStructFieldNPtrAnonymousHeadBoolNPtr opType = 626 + opStructFieldNPtrAnonymousHeadOmitEmptyBoolNPtr opType = 627 + opStructFieldNPtrAnonymousHeadStringTagBoolNPtr opType = 628 + opStructFieldHeadStringNPtr opType = 629 + opStructFieldHeadOmitEmptyStringNPtr opType = 630 + opStructFieldHeadStringTagStringNPtr opType = 631 + opStructFieldAnonymousHeadStringNPtr opType = 632 + opStructFieldAnonymousHeadOmitEmptyStringNPtr opType = 633 + opStructFieldAnonymousHeadStringTagStringNPtr opType = 634 + opStructFieldPtrHeadStringNPtr opType = 635 + opStructFieldPtrHeadOmitEmptyStringNPtr opType = 636 + opStructFieldPtrHeadStringTagStringNPtr opType = 637 + opStructFieldPtrAnonymousHeadStringNPtr opType = 638 + opStructFieldPtrAnonymousHeadOmitEmptyStringNPtr opType = 639 + opStructFieldPtrAnonymousHeadStringTagStringNPtr opType = 640 + opStructFieldNPtrHeadStringNPtr opType = 641 + opStructFieldNPtrHeadOmitEmptyStringNPtr opType = 642 + opStructFieldNPtrHeadStringTagStringNPtr opType = 643 + opStructFieldNPtrAnonymousHeadStringNPtr opType = 644 + opStructFieldNPtrAnonymousHeadOmitEmptyStringNPtr opType = 645 + opStructFieldNPtrAnonymousHeadStringTagStringNPtr opType = 646 + opStructFieldHeadBytesNPtr opType = 647 + opStructFieldHeadOmitEmptyBytesNPtr opType = 648 + opStructFieldHeadStringTagBytesNPtr opType = 649 + opStructFieldAnonymousHeadBytesNPtr opType = 650 + opStructFieldAnonymousHeadOmitEmptyBytesNPtr opType = 651 + opStructFieldAnonymousHeadStringTagBytesNPtr opType = 652 + opStructFieldPtrHeadBytesNPtr opType = 653 + opStructFieldPtrHeadOmitEmptyBytesNPtr opType = 654 + opStructFieldPtrHeadStringTagBytesNPtr opType = 655 + opStructFieldPtrAnonymousHeadBytesNPtr opType = 656 + opStructFieldPtrAnonymousHeadOmitEmptyBytesNPtr opType = 657 + opStructFieldPtrAnonymousHeadStringTagBytesNPtr opType = 658 + opStructFieldNPtrHeadBytesNPtr opType = 659 + opStructFieldNPtrHeadOmitEmptyBytesNPtr opType = 660 + opStructFieldNPtrHeadStringTagBytesNPtr opType = 661 + opStructFieldNPtrAnonymousHeadBytesNPtr opType = 662 + opStructFieldNPtrAnonymousHeadOmitEmptyBytesNPtr opType = 663 + opStructFieldNPtrAnonymousHeadStringTagBytesNPtr opType = 664 + opStructFieldHead opType = 665 + opStructFieldHeadOmitEmpty opType = 666 + opStructFieldHeadStringTag opType = 667 + opStructFieldAnonymousHead opType = 668 + opStructFieldAnonymousHeadOmitEmpty opType = 669 + opStructFieldAnonymousHeadStringTag opType = 670 + opStructFieldPtrHead opType = 671 + opStructFieldPtrHeadOmitEmpty opType = 672 + opStructFieldPtrHeadStringTag opType = 673 + opStructFieldPtrAnonymousHead opType = 674 + opStructFieldPtrAnonymousHeadOmitEmpty opType = 675 + opStructFieldPtrAnonymousHeadStringTag opType = 676 + opStructFieldNPtrHead opType = 677 + opStructFieldNPtrHeadOmitEmpty opType = 678 + opStructFieldNPtrHeadStringTag opType = 679 + opStructFieldNPtrAnonymousHead opType = 680 + opStructFieldNPtrAnonymousHeadOmitEmpty opType = 681 + opStructFieldNPtrAnonymousHeadStringTag opType = 682 + opStructFieldInt opType = 683 + opStructFieldOmitEmptyInt opType = 684 + opStructFieldStringTagInt opType = 685 + opStructFieldUint opType = 686 + opStructFieldOmitEmptyUint opType = 687 + opStructFieldStringTagUint opType = 688 + opStructFieldFloat32 opType = 689 + opStructFieldOmitEmptyFloat32 opType = 690 + opStructFieldStringTagFloat32 opType = 691 + opStructFieldFloat64 opType = 692 + opStructFieldOmitEmptyFloat64 opType = 693 + opStructFieldStringTagFloat64 opType = 694 + opStructFieldBool opType = 695 + opStructFieldOmitEmptyBool opType = 696 + opStructFieldStringTagBool opType = 697 + opStructFieldString opType = 698 + opStructFieldOmitEmptyString opType = 699 + opStructFieldStringTagString opType = 700 + opStructFieldBytes opType = 701 + opStructFieldOmitEmptyBytes opType = 702 + opStructFieldStringTagBytes opType = 703 + opStructFieldArray opType = 704 + opStructFieldOmitEmptyArray opType = 705 + opStructFieldStringTagArray opType = 706 + opStructFieldMap opType = 707 + opStructFieldOmitEmptyMap opType = 708 + opStructFieldStringTagMap opType = 709 + opStructFieldMapLoad opType = 710 + opStructFieldOmitEmptyMapLoad opType = 711 + opStructFieldStringTagMapLoad opType = 712 + opStructFieldSlice opType = 713 + opStructFieldOmitEmptySlice opType = 714 + opStructFieldStringTagSlice opType = 715 + opStructFieldStruct opType = 716 + opStructFieldOmitEmptyStruct opType = 717 + opStructFieldStringTagStruct opType = 718 + opStructFieldMarshalJSON opType = 719 + opStructFieldOmitEmptyMarshalJSON opType = 720 + opStructFieldStringTagMarshalJSON opType = 721 + opStructFieldMarshalText opType = 722 + opStructFieldOmitEmptyMarshalText opType = 723 + opStructFieldStringTagMarshalText opType = 724 + opStructFieldRecursive opType = 725 + opStructFieldOmitEmptyRecursive opType = 726 + opStructFieldStringTagRecursive opType = 727 + opStructFieldIntString opType = 728 + opStructFieldOmitEmptyIntString opType = 729 + opStructFieldStringTagIntString opType = 730 + opStructFieldUintString opType = 731 + opStructFieldOmitEmptyUintString opType = 732 + opStructFieldStringTagUintString opType = 733 + opStructFieldIntPtr opType = 734 + opStructFieldOmitEmptyIntPtr opType = 735 + opStructFieldStringTagIntPtr opType = 736 + opStructFieldUintPtr opType = 737 + opStructFieldOmitEmptyUintPtr opType = 738 + opStructFieldStringTagUintPtr opType = 739 + opStructFieldFloat32Ptr opType = 740 + opStructFieldOmitEmptyFloat32Ptr opType = 741 + opStructFieldStringTagFloat32Ptr opType = 742 + opStructFieldFloat64Ptr opType = 743 + opStructFieldOmitEmptyFloat64Ptr opType = 744 + opStructFieldStringTagFloat64Ptr opType = 745 + opStructFieldBoolPtr opType = 746 + opStructFieldOmitEmptyBoolPtr opType = 747 + opStructFieldStringTagBoolPtr opType = 748 + opStructFieldStringPtr opType = 749 + opStructFieldOmitEmptyStringPtr opType = 750 + opStructFieldStringTagStringPtr opType = 751 + opStructFieldBytesPtr opType = 752 + opStructFieldOmitEmptyBytesPtr opType = 753 + opStructFieldStringTagBytesPtr opType = 754 + opStructFieldArrayPtr opType = 755 + opStructFieldOmitEmptyArrayPtr opType = 756 + opStructFieldStringTagArrayPtr opType = 757 + opStructFieldSlicePtr opType = 758 + opStructFieldOmitEmptySlicePtr opType = 759 + opStructFieldStringTagSlicePtr opType = 760 + opStructFieldMapPtr opType = 761 + opStructFieldOmitEmptyMapPtr opType = 762 + opStructFieldStringTagMapPtr opType = 763 + opStructFieldIntNPtr opType = 764 + opStructFieldOmitEmptyIntNPtr opType = 765 + opStructFieldStringTagIntNPtr opType = 766 + opStructFieldUintNPtr opType = 767 + opStructFieldOmitEmptyUintNPtr opType = 768 + opStructFieldStringTagUintNPtr opType = 769 + opStructFieldFloat32NPtr opType = 770 + opStructFieldOmitEmptyFloat32NPtr opType = 771 + opStructFieldStringTagFloat32NPtr opType = 772 + opStructFieldFloat64NPtr opType = 773 + opStructFieldOmitEmptyFloat64NPtr opType = 774 + opStructFieldStringTagFloat64NPtr opType = 775 + opStructFieldBoolNPtr opType = 776 + opStructFieldOmitEmptyBoolNPtr opType = 777 + opStructFieldStringTagBoolNPtr opType = 778 + opStructFieldStringNPtr opType = 779 + opStructFieldOmitEmptyStringNPtr opType = 780 + opStructFieldStringTagStringNPtr opType = 781 + opStructFieldBytesNPtr opType = 782 + opStructFieldOmitEmptyBytesNPtr opType = 783 + opStructFieldStringTagBytesNPtr opType = 784 + opStructField opType = 785 + opStructFieldOmitEmpty opType = 786 + opStructFieldStringTag opType = 787 + opStructEndInt opType = 788 + opStructEndOmitEmptyInt opType = 789 + opStructEndStringTagInt opType = 790 + opStructEndUint opType = 791 + opStructEndOmitEmptyUint opType = 792 + opStructEndStringTagUint opType = 793 + opStructEndFloat32 opType = 794 + opStructEndOmitEmptyFloat32 opType = 795 + opStructEndStringTagFloat32 opType = 796 + opStructEndFloat64 opType = 797 + opStructEndOmitEmptyFloat64 opType = 798 + opStructEndStringTagFloat64 opType = 799 + opStructEndBool opType = 800 + opStructEndOmitEmptyBool opType = 801 + opStructEndStringTagBool opType = 802 + opStructEndString opType = 803 + opStructEndOmitEmptyString opType = 804 + opStructEndStringTagString opType = 805 + opStructEndBytes opType = 806 + opStructEndOmitEmptyBytes opType = 807 + opStructEndStringTagBytes opType = 808 + opStructEndArray opType = 809 + opStructEndOmitEmptyArray opType = 810 + opStructEndStringTagArray opType = 811 + opStructEndMap opType = 812 + opStructEndOmitEmptyMap opType = 813 + opStructEndStringTagMap opType = 814 + opStructEndMapLoad opType = 815 + opStructEndOmitEmptyMapLoad opType = 816 + opStructEndStringTagMapLoad opType = 817 + opStructEndSlice opType = 818 + opStructEndOmitEmptySlice opType = 819 + opStructEndStringTagSlice opType = 820 + opStructEndStruct opType = 821 + opStructEndOmitEmptyStruct opType = 822 + opStructEndStringTagStruct opType = 823 + opStructEndMarshalJSON opType = 824 + opStructEndOmitEmptyMarshalJSON opType = 825 + opStructEndStringTagMarshalJSON opType = 826 + opStructEndMarshalText opType = 827 + opStructEndOmitEmptyMarshalText opType = 828 + opStructEndStringTagMarshalText opType = 829 + opStructEndRecursive opType = 830 + opStructEndOmitEmptyRecursive opType = 831 + opStructEndStringTagRecursive opType = 832 + opStructEndIntString opType = 833 + opStructEndOmitEmptyIntString opType = 834 + opStructEndStringTagIntString opType = 835 + opStructEndUintString opType = 836 + opStructEndOmitEmptyUintString opType = 837 + opStructEndStringTagUintString opType = 838 + opStructEndIntPtr opType = 839 + opStructEndOmitEmptyIntPtr opType = 840 + opStructEndStringTagIntPtr opType = 841 + opStructEndUintPtr opType = 842 + opStructEndOmitEmptyUintPtr opType = 843 + opStructEndStringTagUintPtr opType = 844 + opStructEndFloat32Ptr opType = 845 + opStructEndOmitEmptyFloat32Ptr opType = 846 + opStructEndStringTagFloat32Ptr opType = 847 + opStructEndFloat64Ptr opType = 848 + opStructEndOmitEmptyFloat64Ptr opType = 849 + opStructEndStringTagFloat64Ptr opType = 850 + opStructEndBoolPtr opType = 851 + opStructEndOmitEmptyBoolPtr opType = 852 + opStructEndStringTagBoolPtr opType = 853 + opStructEndStringPtr opType = 854 + opStructEndOmitEmptyStringPtr opType = 855 + opStructEndStringTagStringPtr opType = 856 + opStructEndBytesPtr opType = 857 + opStructEndOmitEmptyBytesPtr opType = 858 + opStructEndStringTagBytesPtr opType = 859 + opStructEndArrayPtr opType = 860 + opStructEndOmitEmptyArrayPtr opType = 861 + opStructEndStringTagArrayPtr opType = 862 + opStructEndSlicePtr opType = 863 + opStructEndOmitEmptySlicePtr opType = 864 + opStructEndStringTagSlicePtr opType = 865 + opStructEndMapPtr opType = 866 + opStructEndOmitEmptyMapPtr opType = 867 + opStructEndStringTagMapPtr opType = 868 + opStructEndIntNPtr opType = 869 + opStructEndOmitEmptyIntNPtr opType = 870 + opStructEndStringTagIntNPtr opType = 871 + opStructEndUintNPtr opType = 872 + opStructEndOmitEmptyUintNPtr opType = 873 + opStructEndStringTagUintNPtr opType = 874 + opStructEndFloat32NPtr opType = 875 + opStructEndOmitEmptyFloat32NPtr opType = 876 + opStructEndStringTagFloat32NPtr opType = 877 + opStructEndFloat64NPtr opType = 878 + opStructEndOmitEmptyFloat64NPtr opType = 879 + opStructEndStringTagFloat64NPtr opType = 880 + opStructEndBoolNPtr opType = 881 + opStructEndOmitEmptyBoolNPtr opType = 882 + opStructEndStringTagBoolNPtr opType = 883 + opStructEndStringNPtr opType = 884 + opStructEndOmitEmptyStringNPtr opType = 885 + opStructEndStringTagStringNPtr opType = 886 + opStructEndBytesNPtr opType = 887 + opStructEndOmitEmptyBytesNPtr opType = 888 + opStructEndStringTagBytesNPtr opType = 889 + opStructEnd opType = 890 + opStructEndOmitEmpty opType = 891 + opStructEndStringTag opType = 892 ) func (t opType) String() string { - if int(t) >= 818 { + if int(t) >= 893 { return "" } return opTypeStrings[int(t)] @@ -1899,6 +2049,24 @@ func (t opType) fieldToEnd() opType { return opStructEndOmitEmptyBytesPtr case opStructFieldStringTagBytesPtr: return opStructEndStringTagBytesPtr + case opStructFieldArrayPtr: + return opStructEndArrayPtr + case opStructFieldOmitEmptyArrayPtr: + return opStructEndOmitEmptyArrayPtr + case opStructFieldStringTagArrayPtr: + return opStructEndStringTagArrayPtr + case opStructFieldSlicePtr: + return opStructEndSlicePtr + case opStructFieldOmitEmptySlicePtr: + return opStructEndOmitEmptySlicePtr + case opStructFieldStringTagSlicePtr: + return opStructEndStringTagSlicePtr + case opStructFieldMapPtr: + return opStructEndMapPtr + case opStructFieldOmitEmptyMapPtr: + return opStructEndOmitEmptyMapPtr + case opStructFieldStringTagMapPtr: + return opStructEndStringTagMapPtr case opStructFieldIntNPtr: return opStructEndIntNPtr case opStructFieldOmitEmptyIntNPtr: diff --git a/encode_vm.go b/encode_vm.go index 3b7cbd9..c805a9f 100644 --- a/encode_vm.go +++ b/encode_vm.go @@ -2764,12 +2764,14 @@ func encodeRun(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, opt Enco } b = encodeComma(b) code = code.next - case opStructFieldPtrHeadArray: + case opStructFieldPtrHeadArray, opStructFieldPtrHeadStringTagArray, + opStructFieldPtrHeadSlice, opStructFieldPtrHeadStringTagSlice: if code.indirect { store(ctxptr, code.idx, ptrToPtr(load(ctxptr, code.idx))) } fallthrough - case opStructFieldHeadArray: + case opStructFieldHeadArray, opStructFieldHeadStringTagArray, + opStructFieldHeadSlice, opStructFieldHeadStringTagSlice: p := load(ctxptr, code.idx) if p == 0 { b = encodeNull(b) @@ -2779,21 +2781,34 @@ func encodeRun(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, opt Enco } b = append(b, '{') b = append(b, code.key...) + p += code.offset code = code.next store(ctxptr, code.idx, p) - case opStructFieldPtrAnonymousHeadArray: - store(ctxptr, code.idx, ptrToPtr(load(ctxptr, code.idx))) + case opStructFieldPtrHeadOmitEmptyArray, opStructFieldPtrHeadOmitEmptySlice: + if code.indirect { + store(ctxptr, code.idx, ptrToPtr(load(ctxptr, code.idx))) + } fallthrough - case opStructFieldAnonymousHeadArray: - ptr := load(ctxptr, code.idx) + code.offset - if ptr == 0 { + case opStructFieldHeadOmitEmptyArray, opStructFieldHeadOmitEmptySlice: + p := load(ctxptr, code.idx) + if p == 0 { + b = encodeNull(b) + b = encodeComma(b) code = code.end.next + break + } + b = append(b, '{') + p += code.offset + array := ptrToSlice(p) + if array.data == nil { + code = code.nextField } else { b = append(b, code.key...) - store(ctxptr, code.idx, ptr) code = code.next + store(ctxptr, code.idx, p) } - case opStructFieldPtrHeadSlice: + case opStructFieldPtrHeadArrayPtr, opStructFieldPtrHeadStringTagArrayPtr, + opStructFieldPtrHeadSlicePtr, opStructFieldPtrHeadStringTagSlicePtr: p := load(ctxptr, code.idx) if p == 0 { b = encodeNull(b) @@ -2803,37 +2818,139 @@ func encodeRun(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, opt Enco } store(ctxptr, code.idx, ptrToPtr(p)) fallthrough - case opStructFieldHeadSlice: - ptr := load(ctxptr, code.idx) - p := ptr + code.offset - if p == 0 { - if code.op == opStructFieldPtrHeadSlice { - b = encodeNull(b) - b = encodeComma(b) - } else { - b = append(b, '[', ']', ',') - } + case opStructFieldHeadArrayPtr, opStructFieldHeadStringTagArrayPtr, + opStructFieldHeadSlicePtr, opStructFieldHeadStringTagSlicePtr: + p := load(ctxptr, code.idx) + if p == 0 && code.indirect { + b = encodeNull(b) + b = encodeComma(b) code = code.end.next + break + } + b = append(b, '{') + b = append(b, code.key...) + if code.indirect { + p = ptrToPtr(p + code.offset) + } + if p == 0 { + b = encodeNull(b) + b = encodeComma(b) + code = code.nextField } else { - b = append(b, '{') - if !code.anonymousKey { - b = append(b, code.key...) - } code = code.next store(ctxptr, code.idx, p) } - case opStructFieldPtrAnonymousHeadSlice: - store(ctxptr, code.idx, ptrToPtr(load(ctxptr, code.idx))) - fallthrough - case opStructFieldAnonymousHeadSlice: - ptr := load(ctxptr, code.idx) - p := ptr + code.offset + case opStructFieldPtrHeadOmitEmptyArrayPtr, opStructFieldPtrHeadOmitEmptySlicePtr: + p := load(ctxptr, code.idx) if p == 0 { + b = encodeNull(b) + b = encodeComma(b) code = code.end.next + break + } + store(ctxptr, code.idx, ptrToPtr(p)) + fallthrough + case opStructFieldHeadOmitEmptyArrayPtr, opStructFieldHeadOmitEmptySlicePtr: + p := load(ctxptr, code.idx) + if p == 0 && code.indirect { + b = encodeNull(b) + b = encodeComma(b) + code = code.end.next + break + } + b = append(b, '{') + if code.indirect { + p = ptrToPtr(p + code.offset) + } + if p == 0 { + code = code.nextField } else { b = append(b, code.key...) - store(ctxptr, code.idx, p) code = code.next + store(ctxptr, code.idx, p) + } + case opStructFieldPtrAnonymousHeadArray, opStructFieldPtrAnonymousHeadSlice: + if code.indirect { + store(ctxptr, code.idx, ptrToPtr(load(ctxptr, code.idx))) + } + fallthrough + case opStructFieldAnonymousHeadArray, opStructFieldAnonymousHeadSlice: + p := load(ctxptr, code.idx) + if p == 0 { + code = code.end.next + break + } + b = append(b, code.key...) + store(ctxptr, code.idx, p+code.offset) + code = code.next + case opStructFieldPtrAnonymousHeadOmitEmptyArray, opStructFieldPtrAnonymousHeadOmitEmptySlice: + if code.indirect { + store(ctxptr, code.idx, ptrToPtr(load(ctxptr, code.idx))) + } + fallthrough + case opStructFieldAnonymousHeadOmitEmptyArray, opStructFieldAnonymousHeadOmitEmptySlice: + p := load(ctxptr, code.idx) + if p == 0 { + code = code.end.next + break + } + array := ptrToSlice(p) + if array.data == nil { + code = code.nextField + } else { + b = append(b, code.key...) + code = code.next + store(ctxptr, code.idx, p) + } + case opStructFieldPtrAnonymousHeadArrayPtr, opStructFieldPtrAnonymousHeadSlicePtr: + p := load(ctxptr, code.idx) + if p == 0 { + code = code.end.next + break + } + store(ctxptr, code.idx, ptrToPtr(p)) + fallthrough + case opStructFieldAnonymousHeadArrayPtr, opStructFieldAnonymousHeadSlicePtr: + p := load(ctxptr, code.idx) + if p == 0 && code.indirect { + code = code.end.next + break + } + b = append(b, code.key...) + if code.indirect { + p = ptrToPtr(p + code.offset) + } + if p == 0 { + b = encodeNull(b) + b = encodeComma(b) + code = code.nextField + } else { + code = code.next + store(ctxptr, code.idx, p) + } + case opStructFieldPtrAnonymousHeadOmitEmptyArrayPtr, opStructFieldPtrAnonymousHeadOmitEmptySlicePtr: + p := load(ctxptr, code.idx) + if p == 0 { + code = code.end.next + break + } + store(ctxptr, code.idx, ptrToPtr(p)) + fallthrough + case opStructFieldAnonymousHeadOmitEmptyArrayPtr, opStructFieldAnonymousHeadOmitEmptySlicePtr: + p := load(ctxptr, code.idx) + if p == 0 && code.indirect { + code = code.end.next + break + } + if code.indirect { + p = ptrToPtr(p + code.offset) + } + if p == 0 { + code = code.nextField + } else { + b = append(b, code.key...) + code = code.next + store(ctxptr, code.idx, p) } case opStructFieldPtrHeadMarshalJSON: p := load(ctxptr, code.idx) @@ -2846,77 +2963,98 @@ func encodeRun(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, opt Enco store(ctxptr, code.idx, ptrToPtr(p)) fallthrough case opStructFieldHeadMarshalJSON: - ptr := load(ctxptr, code.idx) - if ptr == 0 { + p := load(ctxptr, code.idx) + if p == 0 && code.indirect { b = encodeNull(b) b = encodeComma(b) code = code.end.next + break + } + b = append(b, '{') + b = append(b, code.key...) + bb, err := encodeMarshalJSON(b, ptrToInterface(code, p+code.offset)) + if err != nil { + return nil, err + } + b = bb + b = encodeComma(b) + code = code.next + case opStructFieldPtrHeadOmitEmptyMarshalJSON: + p := load(ctxptr, code.idx) + if p == 0 { + b = encodeNull(b) + b = encodeComma(b) + code = code.end.next + break + } + store(ctxptr, code.idx, ptrToPtr(p)) + fallthrough + case opStructFieldHeadOmitEmptyMarshalJSON: + ptr := load(ctxptr, code.idx) + if ptr == 0 && code.indirect { + b = encodeNull(b) + b = encodeComma(b) + code = code.end.next + break + } + b = append(b, '{') + p := ptrToUnsafePtr(ptr + code.offset) + isPtr := code.typ.Kind() == reflect.Ptr + if p == nil || (!isPtr && *(*unsafe.Pointer)(p) == nil) { + code = code.nextField } else { - b = append(b, '{') - b = append(b, code.key...) - ptr += code.offset - v := ptrToInterface(code, ptr) - rv := reflect.ValueOf(v) - if rv.Type().Kind() == reflect.Interface && rv.IsNil() { - b = encodeNull(b) - code = code.end - break - } - bb, err := rv.Interface().(Marshaler).MarshalJSON() + v := *(*interface{})(unsafe.Pointer(&interfaceHeader{typ: code.typ, ptr: p})) + bb, err := v.(Marshaler).MarshalJSON() if err != nil { - return nil, errMarshaler(code, err) + return nil, &MarshalerError{ + Type: rtype2type(code.typ), + Err: err, + } } if len(bb) == 0 { - return nil, errUnexpectedEndOfJSON( - fmt.Sprintf("error calling MarshalJSON for type %s", code.typ), - 0, - ) + if isPtr { + return nil, errUnexpectedEndOfJSON( + fmt.Sprintf("error calling MarshalJSON for type %s", code.typ), + 0, + ) + } + code = code.nextField + } else { + b = append(b, code.key...) + buf := bytes.NewBuffer(b) + //TODO: we should validate buffer with `compact` + if err := compact(buf, bb, false); err != nil { + return nil, err + } + b = buf.Bytes() + b = encodeComma(b) + code = code.next } - buf := bytes.NewBuffer(b) - //TODO: we should validate buffer with `compact` - if err := compact(buf, bb, false); err != nil { - return nil, err - } - b = buf.Bytes() - b = encodeComma(b) - code = code.next } case opStructFieldPtrAnonymousHeadMarshalJSON: - store(ctxptr, code.idx, ptrToPtr(load(ctxptr, code.idx))) + p := load(ctxptr, code.idx) + if p == 0 { + b = encodeNull(b) + b = encodeComma(b) + code = code.end.next + break + } + store(ctxptr, code.idx, ptrToPtr(p)) fallthrough case opStructFieldAnonymousHeadMarshalJSON: - ptr := load(ctxptr, code.idx) - if ptr == 0 { + p := load(ctxptr, code.idx) + if p == 0 && code.indirect { code = code.end.next - } else { - b = append(b, code.key...) - ptr += code.offset - v := ptrToInterface(code, ptr) - rv := reflect.ValueOf(v) - if rv.Type().Kind() == reflect.Interface && rv.IsNil() { - b = encodeNull(b) - code = code.end.next - break - } - bb, err := rv.Interface().(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, - ) - } - buf := bytes.NewBuffer(b) - //TODO: we should validate buffer with `compact` - if err := compact(buf, bb, false); err != nil { - return nil, err - } - b = buf.Bytes() - b = encodeComma(b) - code = code.next + break } + b = append(b, code.key...) + bb, err := encodeMarshalJSON(b, ptrToInterface(code, p+code.offset)) + if err != nil { + return nil, err + } + b = bb + b = encodeComma(b) + code = code.next case opStructFieldPtrHeadMarshalText: p := load(ctxptr, code.idx) if p == 0 { @@ -2928,106 +3066,46 @@ func encodeRun(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, opt Enco store(ctxptr, code.idx, ptrToPtr(p)) fallthrough case opStructFieldHeadMarshalText: - ptr := load(ctxptr, code.idx) - if ptr == 0 { + p := load(ctxptr, code.idx) + if p == 0 && code.indirect { b = encodeNull(b) b = encodeComma(b) code = code.end.next - } else { - b = append(b, '{') - b = append(b, code.key...) - ptr += code.offset - v := ptrToInterface(code, ptr) - rv := reflect.ValueOf(v) - if rv.Type().Kind() == reflect.Interface && rv.IsNil() { - b = encodeNull(b) - b = encodeComma(b) - code = code.end - break - } - bytes, err := rv.Interface().(encoding.TextMarshaler).MarshalText() - if err != nil { - return nil, errMarshaler(code, err) - } - b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) - b = encodeComma(b) - code = code.next + break } + b = append(b, '{') + b = append(b, code.key...) + bb, err := encodeMarshalText(b, ptrToInterface(code, p+code.offset)) + if err != nil { + return nil, err + } + b = bb + b = encodeComma(b) + code = code.next case opStructFieldPtrAnonymousHeadMarshalText: - store(ctxptr, code.idx, ptrToPtr(load(ctxptr, code.idx))) + p := load(ctxptr, code.idx) + if p == 0 { + b = encodeNull(b) + b = encodeComma(b) + code = code.end.next + break + } + store(ctxptr, code.idx, ptrToPtr(p)) fallthrough case opStructFieldAnonymousHeadMarshalText: - ptr := load(ctxptr, code.idx) - if ptr == 0 { + p := load(ctxptr, code.idx) + if p == 0 && code.indirect { code = code.end.next - } else { - b = append(b, code.key...) - ptr += code.offset - v := ptrToInterface(code, ptr) - rv := reflect.ValueOf(v) - if rv.Type().Kind() == reflect.Interface && rv.IsNil() { - b = encodeNull(b) - b = encodeComma(b) - code = code.end.next - break - } - bytes, err := rv.Interface().(encoding.TextMarshaler).MarshalText() - if err != nil { - return nil, errMarshaler(code, err) - } - b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) - b = encodeComma(b) - code = code.next + break } - case opStructFieldPtrHeadOmitEmptyMarshalJSON: - ptr := load(ctxptr, code.idx) - if ptr != 0 { - store(ctxptr, code.idx, ptrToPtr(ptr)) - } - fallthrough - case opStructFieldHeadOmitEmptyMarshalJSON: - ptr := load(ctxptr, code.idx) - if ptr == 0 { - b = encodeNull(b) - b = encodeComma(b) - code = code.end.next - } else { - b = append(b, '{') - ptr += code.offset - p := ptrToUnsafePtr(ptr) - isPtr := code.typ.Kind() == reflect.Ptr - if p == nil || (!isPtr && *(*unsafe.Pointer)(p) == nil) { - code = code.nextField - } else { - v := *(*interface{})(unsafe.Pointer(&interfaceHeader{typ: code.typ, ptr: p})) - bb, err := v.(Marshaler).MarshalJSON() - if err != nil { - return nil, &MarshalerError{ - Type: rtype2type(code.typ), - Err: err, - } - } - if len(bb) == 0 { - if isPtr { - return nil, errUnexpectedEndOfJSON( - fmt.Sprintf("error calling MarshalJSON for type %s", code.typ), - 0, - ) - } - code = code.nextField - } else { - b = append(b, code.key...) - buf := bytes.NewBuffer(b) - //TODO: we should validate buffer with `compact` - if err := compact(buf, bb, false); err != nil { - return nil, err - } - b = buf.Bytes() - b = encodeComma(b) - code = code.next - } - } + b = append(b, code.key...) + bb, err := encodeMarshalText(b, ptrToInterface(code, p+code.offset)) + if err != nil { + return nil, err } + b = bb + b = encodeComma(b) + code = code.next case opStructFieldPtrAnonymousHeadOmitEmptyMarshalJSON: ptr := load(ctxptr, code.idx) if ptr != 0 { @@ -3845,7 +3923,7 @@ func encodeRun(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, opt Enco code = code.next store(ctxptr, code.idx, p) } - case opStructFieldSlice: + case opStructFieldSlice, opStructFieldStringTagSlice: b = append(b, code.key...) ptr := load(ctxptr, code.headIdx) p := ptr + code.offset @@ -3862,6 +3940,22 @@ func encodeRun(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, opt Enco code = code.next store(ctxptr, code.idx, p) } + case opStructFieldSlicePtr, opStructFieldStringTagSlicePtr: + b = append(b, code.key...) + p := load(ctxptr, code.headIdx) + p = ptrToPtr(p + code.offset) + code = code.next + store(ctxptr, code.idx, p) + case opStructFieldOmitEmptySlicePtr: + p := load(ctxptr, code.headIdx) + p = ptrToPtr(p + code.offset) + if p != 0 { + b = append(b, code.key...) + code = code.next + store(ctxptr, code.idx, p) + } else { + code = code.nextField + } case opStructFieldMap: b = append(b, code.key...) ptr := load(ctxptr, code.headIdx)