go-json/encode_optype.go

1191 lines
46 KiB
Go
Raw Normal View History

2020-08-15 11:41:38 +03:00
// Code generated by cmd/generator. DO NOT EDIT!
package json
2021-01-10 14:21:58 +03:00
import (
"strings"
)
2020-08-15 11:41:38 +03:00
type codeType int
const (
2020-11-12 18:27:11 +03:00
codeOp codeType = 0
codeArrayHead codeType = 1
codeArrayElem codeType = 2
codeSliceHead codeType = 3
codeSliceElem codeType = 4
codeMapHead codeType = 5
codeMapKey codeType = 6
codeMapValue codeType = 7
codeMapEnd codeType = 8
codeStructFieldRecursive codeType = 9
codeStructField codeType = 10
2020-12-29 18:13:45 +03:00
codeStructEnd codeType = 11
2020-08-15 11:41:38 +03:00
)
2021-03-11 11:59:22 +03:00
var opTypeStrings = [442]string{
2021-01-17 16:23:28 +03:00
"End",
"Interface",
"Ptr",
"RootSliceHead",
"SliceElem",
"RootSliceElem",
"SliceEnd",
"ArrayElem",
"ArrayEnd",
"MapKey",
"MapValue",
"MapEnd",
"StructFieldRecursiveEnd",
"StructAnonymousEnd",
"Int",
"Uint",
"Float32",
"Float64",
"Bool",
"String",
"Bytes",
2021-03-11 08:58:33 +03:00
"Number",
2021-01-17 16:23:28 +03:00
"Array",
"Map",
"Slice",
"Struct",
"MarshalJSON",
"MarshalText",
"Recursive",
"IntString",
"UintString",
"IntPtr",
"UintPtr",
"Float32Ptr",
"Float64Ptr",
"BoolPtr",
"StringPtr",
"BytesPtr",
2021-03-11 08:58:33 +03:00
"NumberPtr",
2021-03-03 08:54:40 +03:00
"ArrayPtr",
"MapPtr",
2021-03-11 08:58:33 +03:00
"SlicePtr",
"MarshalJSONPtr",
2021-03-06 05:47:51 +03:00
"MarshalTextPtr",
2021-03-09 19:11:48 +03:00
"InterfacePtr",
2021-03-11 11:59:22 +03:00
"RecursivePtr",
2021-01-17 16:23:28 +03:00
"StructFieldHeadInt",
"StructFieldHeadOmitEmptyInt",
"StructFieldHeadStringTagInt",
"StructFieldPtrHeadInt",
"StructFieldPtrHeadOmitEmptyInt",
"StructFieldPtrHeadStringTagInt",
"StructFieldHeadUint",
"StructFieldHeadOmitEmptyUint",
"StructFieldHeadStringTagUint",
"StructFieldPtrHeadUint",
"StructFieldPtrHeadOmitEmptyUint",
"StructFieldPtrHeadStringTagUint",
"StructFieldHeadFloat32",
"StructFieldHeadOmitEmptyFloat32",
"StructFieldHeadStringTagFloat32",
"StructFieldPtrHeadFloat32",
"StructFieldPtrHeadOmitEmptyFloat32",
"StructFieldPtrHeadStringTagFloat32",
"StructFieldHeadFloat64",
"StructFieldHeadOmitEmptyFloat64",
"StructFieldHeadStringTagFloat64",
"StructFieldPtrHeadFloat64",
"StructFieldPtrHeadOmitEmptyFloat64",
"StructFieldPtrHeadStringTagFloat64",
"StructFieldHeadBool",
"StructFieldHeadOmitEmptyBool",
"StructFieldHeadStringTagBool",
"StructFieldPtrHeadBool",
"StructFieldPtrHeadOmitEmptyBool",
"StructFieldPtrHeadStringTagBool",
"StructFieldHeadString",
"StructFieldHeadOmitEmptyString",
"StructFieldHeadStringTagString",
"StructFieldPtrHeadString",
"StructFieldPtrHeadOmitEmptyString",
"StructFieldPtrHeadStringTagString",
"StructFieldHeadBytes",
"StructFieldHeadOmitEmptyBytes",
"StructFieldHeadStringTagBytes",
"StructFieldPtrHeadBytes",
"StructFieldPtrHeadOmitEmptyBytes",
"StructFieldPtrHeadStringTagBytes",
2021-03-11 08:58:33 +03:00
"StructFieldHeadNumber",
"StructFieldHeadOmitEmptyNumber",
"StructFieldHeadStringTagNumber",
"StructFieldPtrHeadNumber",
"StructFieldPtrHeadOmitEmptyNumber",
"StructFieldPtrHeadStringTagNumber",
2021-01-17 16:23:28 +03:00
"StructFieldHeadArray",
"StructFieldHeadOmitEmptyArray",
"StructFieldHeadStringTagArray",
"StructFieldPtrHeadArray",
"StructFieldPtrHeadOmitEmptyArray",
"StructFieldPtrHeadStringTagArray",
"StructFieldHeadMap",
"StructFieldHeadOmitEmptyMap",
"StructFieldHeadStringTagMap",
"StructFieldPtrHeadMap",
"StructFieldPtrHeadOmitEmptyMap",
"StructFieldPtrHeadStringTagMap",
"StructFieldHeadSlice",
"StructFieldHeadOmitEmptySlice",
"StructFieldHeadStringTagSlice",
"StructFieldPtrHeadSlice",
"StructFieldPtrHeadOmitEmptySlice",
"StructFieldPtrHeadStringTagSlice",
"StructFieldHeadStruct",
"StructFieldHeadOmitEmptyStruct",
"StructFieldHeadStringTagStruct",
"StructFieldPtrHeadStruct",
"StructFieldPtrHeadOmitEmptyStruct",
"StructFieldPtrHeadStringTagStruct",
"StructFieldHeadMarshalJSON",
"StructFieldHeadOmitEmptyMarshalJSON",
"StructFieldHeadStringTagMarshalJSON",
"StructFieldPtrHeadMarshalJSON",
"StructFieldPtrHeadOmitEmptyMarshalJSON",
"StructFieldPtrHeadStringTagMarshalJSON",
"StructFieldHeadMarshalText",
"StructFieldHeadOmitEmptyMarshalText",
"StructFieldHeadStringTagMarshalText",
"StructFieldPtrHeadMarshalText",
"StructFieldPtrHeadOmitEmptyMarshalText",
"StructFieldPtrHeadStringTagMarshalText",
"StructFieldHeadRecursive",
"StructFieldHeadOmitEmptyRecursive",
"StructFieldHeadStringTagRecursive",
"StructFieldPtrHeadRecursive",
"StructFieldPtrHeadOmitEmptyRecursive",
"StructFieldPtrHeadStringTagRecursive",
"StructFieldHeadIntString",
"StructFieldHeadOmitEmptyIntString",
"StructFieldHeadStringTagIntString",
"StructFieldPtrHeadIntString",
"StructFieldPtrHeadOmitEmptyIntString",
"StructFieldPtrHeadStringTagIntString",
"StructFieldHeadUintString",
"StructFieldHeadOmitEmptyUintString",
"StructFieldHeadStringTagUintString",
"StructFieldPtrHeadUintString",
"StructFieldPtrHeadOmitEmptyUintString",
"StructFieldPtrHeadStringTagUintString",
"StructFieldHeadIntPtr",
"StructFieldHeadOmitEmptyIntPtr",
"StructFieldHeadStringTagIntPtr",
"StructFieldPtrHeadIntPtr",
"StructFieldPtrHeadOmitEmptyIntPtr",
"StructFieldPtrHeadStringTagIntPtr",
"StructFieldHeadUintPtr",
"StructFieldHeadOmitEmptyUintPtr",
"StructFieldHeadStringTagUintPtr",
"StructFieldPtrHeadUintPtr",
"StructFieldPtrHeadOmitEmptyUintPtr",
"StructFieldPtrHeadStringTagUintPtr",
"StructFieldHeadFloat32Ptr",
"StructFieldHeadOmitEmptyFloat32Ptr",
"StructFieldHeadStringTagFloat32Ptr",
"StructFieldPtrHeadFloat32Ptr",
"StructFieldPtrHeadOmitEmptyFloat32Ptr",
"StructFieldPtrHeadStringTagFloat32Ptr",
"StructFieldHeadFloat64Ptr",
"StructFieldHeadOmitEmptyFloat64Ptr",
"StructFieldHeadStringTagFloat64Ptr",
"StructFieldPtrHeadFloat64Ptr",
"StructFieldPtrHeadOmitEmptyFloat64Ptr",
"StructFieldPtrHeadStringTagFloat64Ptr",
"StructFieldHeadBoolPtr",
"StructFieldHeadOmitEmptyBoolPtr",
"StructFieldHeadStringTagBoolPtr",
"StructFieldPtrHeadBoolPtr",
"StructFieldPtrHeadOmitEmptyBoolPtr",
"StructFieldPtrHeadStringTagBoolPtr",
"StructFieldHeadStringPtr",
"StructFieldHeadOmitEmptyStringPtr",
"StructFieldHeadStringTagStringPtr",
"StructFieldPtrHeadStringPtr",
"StructFieldPtrHeadOmitEmptyStringPtr",
"StructFieldPtrHeadStringTagStringPtr",
"StructFieldHeadBytesPtr",
"StructFieldHeadOmitEmptyBytesPtr",
"StructFieldHeadStringTagBytesPtr",
"StructFieldPtrHeadBytesPtr",
"StructFieldPtrHeadOmitEmptyBytesPtr",
"StructFieldPtrHeadStringTagBytesPtr",
2021-03-11 08:58:33 +03:00
"StructFieldHeadNumberPtr",
"StructFieldHeadOmitEmptyNumberPtr",
"StructFieldHeadStringTagNumberPtr",
"StructFieldPtrHeadNumberPtr",
"StructFieldPtrHeadOmitEmptyNumberPtr",
"StructFieldPtrHeadStringTagNumberPtr",
2021-03-03 08:54:40 +03:00
"StructFieldHeadArrayPtr",
"StructFieldHeadOmitEmptyArrayPtr",
"StructFieldHeadStringTagArrayPtr",
"StructFieldPtrHeadArrayPtr",
"StructFieldPtrHeadOmitEmptyArrayPtr",
"StructFieldPtrHeadStringTagArrayPtr",
"StructFieldHeadMapPtr",
"StructFieldHeadOmitEmptyMapPtr",
"StructFieldHeadStringTagMapPtr",
"StructFieldPtrHeadMapPtr",
"StructFieldPtrHeadOmitEmptyMapPtr",
"StructFieldPtrHeadStringTagMapPtr",
2021-03-11 08:58:33 +03:00
"StructFieldHeadSlicePtr",
"StructFieldHeadOmitEmptySlicePtr",
"StructFieldHeadStringTagSlicePtr",
"StructFieldPtrHeadSlicePtr",
"StructFieldPtrHeadOmitEmptySlicePtr",
"StructFieldPtrHeadStringTagSlicePtr",
"StructFieldHeadMarshalJSONPtr",
"StructFieldHeadOmitEmptyMarshalJSONPtr",
"StructFieldHeadStringTagMarshalJSONPtr",
"StructFieldPtrHeadMarshalJSONPtr",
"StructFieldPtrHeadOmitEmptyMarshalJSONPtr",
"StructFieldPtrHeadStringTagMarshalJSONPtr",
2021-03-06 05:47:51 +03:00
"StructFieldHeadMarshalTextPtr",
"StructFieldHeadOmitEmptyMarshalTextPtr",
"StructFieldHeadStringTagMarshalTextPtr",
"StructFieldPtrHeadMarshalTextPtr",
"StructFieldPtrHeadOmitEmptyMarshalTextPtr",
"StructFieldPtrHeadStringTagMarshalTextPtr",
2021-03-09 19:11:48 +03:00
"StructFieldHeadInterfacePtr",
"StructFieldHeadOmitEmptyInterfacePtr",
"StructFieldHeadStringTagInterfacePtr",
"StructFieldPtrHeadInterfacePtr",
"StructFieldPtrHeadOmitEmptyInterfacePtr",
"StructFieldPtrHeadStringTagInterfacePtr",
2021-03-11 11:59:22 +03:00
"StructFieldHeadRecursivePtr",
"StructFieldHeadOmitEmptyRecursivePtr",
"StructFieldHeadStringTagRecursivePtr",
"StructFieldPtrHeadRecursivePtr",
"StructFieldPtrHeadOmitEmptyRecursivePtr",
"StructFieldPtrHeadStringTagRecursivePtr",
2021-01-17 16:23:28 +03:00
"StructFieldHead",
"StructFieldHeadOmitEmpty",
"StructFieldHeadStringTag",
"StructFieldPtrHead",
"StructFieldPtrHeadOmitEmpty",
"StructFieldPtrHeadStringTag",
"StructFieldInt",
"StructFieldOmitEmptyInt",
"StructFieldStringTagInt",
"StructFieldUint",
"StructFieldOmitEmptyUint",
"StructFieldStringTagUint",
"StructFieldFloat32",
"StructFieldOmitEmptyFloat32",
"StructFieldStringTagFloat32",
"StructFieldFloat64",
"StructFieldOmitEmptyFloat64",
"StructFieldStringTagFloat64",
"StructFieldBool",
"StructFieldOmitEmptyBool",
"StructFieldStringTagBool",
"StructFieldString",
"StructFieldOmitEmptyString",
"StructFieldStringTagString",
"StructFieldBytes",
"StructFieldOmitEmptyBytes",
"StructFieldStringTagBytes",
2021-03-11 08:58:33 +03:00
"StructFieldNumber",
"StructFieldOmitEmptyNumber",
"StructFieldStringTagNumber",
2021-01-17 16:23:28 +03:00
"StructFieldArray",
"StructFieldOmitEmptyArray",
"StructFieldStringTagArray",
"StructFieldMap",
"StructFieldOmitEmptyMap",
"StructFieldStringTagMap",
"StructFieldSlice",
"StructFieldOmitEmptySlice",
"StructFieldStringTagSlice",
"StructFieldStruct",
"StructFieldOmitEmptyStruct",
"StructFieldStringTagStruct",
"StructFieldMarshalJSON",
"StructFieldOmitEmptyMarshalJSON",
"StructFieldStringTagMarshalJSON",
"StructFieldMarshalText",
"StructFieldOmitEmptyMarshalText",
"StructFieldStringTagMarshalText",
"StructFieldRecursive",
"StructFieldOmitEmptyRecursive",
"StructFieldStringTagRecursive",
"StructFieldIntString",
"StructFieldOmitEmptyIntString",
"StructFieldStringTagIntString",
"StructFieldUintString",
"StructFieldOmitEmptyUintString",
"StructFieldStringTagUintString",
"StructFieldIntPtr",
"StructFieldOmitEmptyIntPtr",
"StructFieldStringTagIntPtr",
"StructFieldUintPtr",
"StructFieldOmitEmptyUintPtr",
"StructFieldStringTagUintPtr",
"StructFieldFloat32Ptr",
"StructFieldOmitEmptyFloat32Ptr",
"StructFieldStringTagFloat32Ptr",
"StructFieldFloat64Ptr",
"StructFieldOmitEmptyFloat64Ptr",
"StructFieldStringTagFloat64Ptr",
"StructFieldBoolPtr",
"StructFieldOmitEmptyBoolPtr",
"StructFieldStringTagBoolPtr",
"StructFieldStringPtr",
"StructFieldOmitEmptyStringPtr",
"StructFieldStringTagStringPtr",
"StructFieldBytesPtr",
"StructFieldOmitEmptyBytesPtr",
"StructFieldStringTagBytesPtr",
2021-03-11 08:58:33 +03:00
"StructFieldNumberPtr",
"StructFieldOmitEmptyNumberPtr",
"StructFieldStringTagNumberPtr",
2021-03-03 08:54:40 +03:00
"StructFieldArrayPtr",
"StructFieldOmitEmptyArrayPtr",
"StructFieldStringTagArrayPtr",
"StructFieldMapPtr",
"StructFieldOmitEmptyMapPtr",
"StructFieldStringTagMapPtr",
2021-03-11 08:58:33 +03:00
"StructFieldSlicePtr",
"StructFieldOmitEmptySlicePtr",
"StructFieldStringTagSlicePtr",
"StructFieldMarshalJSONPtr",
"StructFieldOmitEmptyMarshalJSONPtr",
"StructFieldStringTagMarshalJSONPtr",
2021-03-06 05:47:51 +03:00
"StructFieldMarshalTextPtr",
"StructFieldOmitEmptyMarshalTextPtr",
"StructFieldStringTagMarshalTextPtr",
2021-03-09 19:11:48 +03:00
"StructFieldInterfacePtr",
"StructFieldOmitEmptyInterfacePtr",
"StructFieldStringTagInterfacePtr",
2021-03-11 11:59:22 +03:00
"StructFieldRecursivePtr",
"StructFieldOmitEmptyRecursivePtr",
"StructFieldStringTagRecursivePtr",
2021-01-17 16:23:28 +03:00
"StructField",
"StructFieldOmitEmpty",
"StructFieldStringTag",
"StructEndInt",
"StructEndOmitEmptyInt",
"StructEndStringTagInt",
"StructEndUint",
"StructEndOmitEmptyUint",
"StructEndStringTagUint",
"StructEndFloat32",
"StructEndOmitEmptyFloat32",
"StructEndStringTagFloat32",
"StructEndFloat64",
"StructEndOmitEmptyFloat64",
"StructEndStringTagFloat64",
"StructEndBool",
"StructEndOmitEmptyBool",
"StructEndStringTagBool",
"StructEndString",
"StructEndOmitEmptyString",
"StructEndStringTagString",
"StructEndBytes",
"StructEndOmitEmptyBytes",
"StructEndStringTagBytes",
2021-03-11 08:58:33 +03:00
"StructEndNumber",
"StructEndOmitEmptyNumber",
"StructEndStringTagNumber",
2021-01-17 16:23:28 +03:00
"StructEndArray",
"StructEndOmitEmptyArray",
"StructEndStringTagArray",
"StructEndMap",
"StructEndOmitEmptyMap",
"StructEndStringTagMap",
"StructEndSlice",
"StructEndOmitEmptySlice",
"StructEndStringTagSlice",
"StructEndStruct",
"StructEndOmitEmptyStruct",
"StructEndStringTagStruct",
"StructEndMarshalJSON",
"StructEndOmitEmptyMarshalJSON",
"StructEndStringTagMarshalJSON",
"StructEndMarshalText",
"StructEndOmitEmptyMarshalText",
"StructEndStringTagMarshalText",
"StructEndRecursive",
"StructEndOmitEmptyRecursive",
"StructEndStringTagRecursive",
"StructEndIntString",
"StructEndOmitEmptyIntString",
"StructEndStringTagIntString",
"StructEndUintString",
"StructEndOmitEmptyUintString",
"StructEndStringTagUintString",
"StructEndIntPtr",
"StructEndOmitEmptyIntPtr",
"StructEndStringTagIntPtr",
"StructEndUintPtr",
"StructEndOmitEmptyUintPtr",
"StructEndStringTagUintPtr",
"StructEndFloat32Ptr",
"StructEndOmitEmptyFloat32Ptr",
"StructEndStringTagFloat32Ptr",
"StructEndFloat64Ptr",
"StructEndOmitEmptyFloat64Ptr",
"StructEndStringTagFloat64Ptr",
"StructEndBoolPtr",
"StructEndOmitEmptyBoolPtr",
"StructEndStringTagBoolPtr",
"StructEndStringPtr",
"StructEndOmitEmptyStringPtr",
"StructEndStringTagStringPtr",
"StructEndBytesPtr",
"StructEndOmitEmptyBytesPtr",
"StructEndStringTagBytesPtr",
2021-03-11 08:58:33 +03:00
"StructEndNumberPtr",
"StructEndOmitEmptyNumberPtr",
"StructEndStringTagNumberPtr",
2021-03-03 08:54:40 +03:00
"StructEndArrayPtr",
"StructEndOmitEmptyArrayPtr",
"StructEndStringTagArrayPtr",
"StructEndMapPtr",
"StructEndOmitEmptyMapPtr",
"StructEndStringTagMapPtr",
2021-03-11 08:58:33 +03:00
"StructEndSlicePtr",
"StructEndOmitEmptySlicePtr",
"StructEndStringTagSlicePtr",
"StructEndMarshalJSONPtr",
"StructEndOmitEmptyMarshalJSONPtr",
"StructEndStringTagMarshalJSONPtr",
2021-03-06 05:47:51 +03:00
"StructEndMarshalTextPtr",
"StructEndOmitEmptyMarshalTextPtr",
"StructEndStringTagMarshalTextPtr",
2021-03-09 19:11:48 +03:00
"StructEndInterfacePtr",
"StructEndOmitEmptyInterfacePtr",
"StructEndStringTagInterfacePtr",
2021-03-11 11:59:22 +03:00
"StructEndRecursivePtr",
"StructEndOmitEmptyRecursivePtr",
"StructEndStringTagRecursivePtr",
2021-01-17 16:23:28 +03:00
"StructEnd",
"StructEndOmitEmpty",
"StructEndStringTag",
}
2020-08-15 11:41:38 +03:00
type opType int
const (
2021-03-09 19:11:48 +03:00
opEnd opType = 0
opInterface opType = 1
opPtr opType = 2
opRootSliceHead opType = 3
opSliceElem opType = 4
opRootSliceElem opType = 5
opSliceEnd opType = 6
opArrayElem opType = 7
opArrayEnd opType = 8
2021-03-09 20:12:53 +03:00
opMapKey opType = 9
opMapValue opType = 10
opMapEnd opType = 11
opStructFieldRecursiveEnd opType = 12
opStructAnonymousEnd opType = 13
opInt opType = 14
opUint opType = 15
opFloat32 opType = 16
opFloat64 opType = 17
opBool opType = 18
opString opType = 19
opBytes opType = 20
2021-03-11 08:58:33 +03:00
opNumber opType = 21
opArray opType = 22
opMap opType = 23
opSlice opType = 24
opStruct opType = 25
opMarshalJSON opType = 26
opMarshalText opType = 27
opRecursive opType = 28
opIntString opType = 29
opUintString opType = 30
opIntPtr opType = 31
opUintPtr opType = 32
opFloat32Ptr opType = 33
opFloat64Ptr opType = 34
opBoolPtr opType = 35
opStringPtr opType = 36
opBytesPtr opType = 37
opNumberPtr opType = 38
opArrayPtr opType = 39
opMapPtr opType = 40
opSlicePtr opType = 41
opMarshalJSONPtr opType = 42
opMarshalTextPtr opType = 43
opInterfacePtr opType = 44
2021-03-11 11:59:22 +03:00
opRecursivePtr opType = 45
opStructFieldHeadInt opType = 46
opStructFieldHeadOmitEmptyInt opType = 47
opStructFieldHeadStringTagInt opType = 48
opStructFieldPtrHeadInt opType = 49
opStructFieldPtrHeadOmitEmptyInt opType = 50
opStructFieldPtrHeadStringTagInt opType = 51
opStructFieldHeadUint opType = 52
opStructFieldHeadOmitEmptyUint opType = 53
opStructFieldHeadStringTagUint opType = 54
opStructFieldPtrHeadUint opType = 55
opStructFieldPtrHeadOmitEmptyUint opType = 56
opStructFieldPtrHeadStringTagUint opType = 57
opStructFieldHeadFloat32 opType = 58
opStructFieldHeadOmitEmptyFloat32 opType = 59
opStructFieldHeadStringTagFloat32 opType = 60
opStructFieldPtrHeadFloat32 opType = 61
opStructFieldPtrHeadOmitEmptyFloat32 opType = 62
opStructFieldPtrHeadStringTagFloat32 opType = 63
opStructFieldHeadFloat64 opType = 64
opStructFieldHeadOmitEmptyFloat64 opType = 65
opStructFieldHeadStringTagFloat64 opType = 66
opStructFieldPtrHeadFloat64 opType = 67
opStructFieldPtrHeadOmitEmptyFloat64 opType = 68
opStructFieldPtrHeadStringTagFloat64 opType = 69
opStructFieldHeadBool opType = 70
opStructFieldHeadOmitEmptyBool opType = 71
opStructFieldHeadStringTagBool opType = 72
opStructFieldPtrHeadBool opType = 73
opStructFieldPtrHeadOmitEmptyBool opType = 74
opStructFieldPtrHeadStringTagBool opType = 75
opStructFieldHeadString opType = 76
opStructFieldHeadOmitEmptyString opType = 77
opStructFieldHeadStringTagString opType = 78
opStructFieldPtrHeadString opType = 79
opStructFieldPtrHeadOmitEmptyString opType = 80
opStructFieldPtrHeadStringTagString opType = 81
opStructFieldHeadBytes opType = 82
opStructFieldHeadOmitEmptyBytes opType = 83
opStructFieldHeadStringTagBytes opType = 84
opStructFieldPtrHeadBytes opType = 85
opStructFieldPtrHeadOmitEmptyBytes opType = 86
opStructFieldPtrHeadStringTagBytes opType = 87
opStructFieldHeadNumber opType = 88
opStructFieldHeadOmitEmptyNumber opType = 89
opStructFieldHeadStringTagNumber opType = 90
opStructFieldPtrHeadNumber opType = 91
opStructFieldPtrHeadOmitEmptyNumber opType = 92
opStructFieldPtrHeadStringTagNumber opType = 93
opStructFieldHeadArray opType = 94
opStructFieldHeadOmitEmptyArray opType = 95
opStructFieldHeadStringTagArray opType = 96
opStructFieldPtrHeadArray opType = 97
opStructFieldPtrHeadOmitEmptyArray opType = 98
opStructFieldPtrHeadStringTagArray opType = 99
opStructFieldHeadMap opType = 100
opStructFieldHeadOmitEmptyMap opType = 101
opStructFieldHeadStringTagMap opType = 102
opStructFieldPtrHeadMap opType = 103
opStructFieldPtrHeadOmitEmptyMap opType = 104
opStructFieldPtrHeadStringTagMap opType = 105
opStructFieldHeadSlice opType = 106
opStructFieldHeadOmitEmptySlice opType = 107
opStructFieldHeadStringTagSlice opType = 108
opStructFieldPtrHeadSlice opType = 109
opStructFieldPtrHeadOmitEmptySlice opType = 110
opStructFieldPtrHeadStringTagSlice opType = 111
opStructFieldHeadStruct opType = 112
opStructFieldHeadOmitEmptyStruct opType = 113
opStructFieldHeadStringTagStruct opType = 114
opStructFieldPtrHeadStruct opType = 115
opStructFieldPtrHeadOmitEmptyStruct opType = 116
opStructFieldPtrHeadStringTagStruct opType = 117
opStructFieldHeadMarshalJSON opType = 118
opStructFieldHeadOmitEmptyMarshalJSON opType = 119
opStructFieldHeadStringTagMarshalJSON opType = 120
opStructFieldPtrHeadMarshalJSON opType = 121
opStructFieldPtrHeadOmitEmptyMarshalJSON opType = 122
opStructFieldPtrHeadStringTagMarshalJSON opType = 123
opStructFieldHeadMarshalText opType = 124
opStructFieldHeadOmitEmptyMarshalText opType = 125
opStructFieldHeadStringTagMarshalText opType = 126
opStructFieldPtrHeadMarshalText opType = 127
opStructFieldPtrHeadOmitEmptyMarshalText opType = 128
opStructFieldPtrHeadStringTagMarshalText opType = 129
opStructFieldHeadRecursive opType = 130
opStructFieldHeadOmitEmptyRecursive opType = 131
opStructFieldHeadStringTagRecursive opType = 132
opStructFieldPtrHeadRecursive opType = 133
opStructFieldPtrHeadOmitEmptyRecursive opType = 134
opStructFieldPtrHeadStringTagRecursive opType = 135
opStructFieldHeadIntString opType = 136
opStructFieldHeadOmitEmptyIntString opType = 137
opStructFieldHeadStringTagIntString opType = 138
opStructFieldPtrHeadIntString opType = 139
opStructFieldPtrHeadOmitEmptyIntString opType = 140
opStructFieldPtrHeadStringTagIntString opType = 141
opStructFieldHeadUintString opType = 142
opStructFieldHeadOmitEmptyUintString opType = 143
opStructFieldHeadStringTagUintString opType = 144
opStructFieldPtrHeadUintString opType = 145
opStructFieldPtrHeadOmitEmptyUintString opType = 146
opStructFieldPtrHeadStringTagUintString opType = 147
opStructFieldHeadIntPtr opType = 148
opStructFieldHeadOmitEmptyIntPtr opType = 149
opStructFieldHeadStringTagIntPtr opType = 150
opStructFieldPtrHeadIntPtr opType = 151
opStructFieldPtrHeadOmitEmptyIntPtr opType = 152
opStructFieldPtrHeadStringTagIntPtr opType = 153
opStructFieldHeadUintPtr opType = 154
opStructFieldHeadOmitEmptyUintPtr opType = 155
opStructFieldHeadStringTagUintPtr opType = 156
opStructFieldPtrHeadUintPtr opType = 157
opStructFieldPtrHeadOmitEmptyUintPtr opType = 158
opStructFieldPtrHeadStringTagUintPtr opType = 159
opStructFieldHeadFloat32Ptr opType = 160
opStructFieldHeadOmitEmptyFloat32Ptr opType = 161
opStructFieldHeadStringTagFloat32Ptr opType = 162
opStructFieldPtrHeadFloat32Ptr opType = 163
opStructFieldPtrHeadOmitEmptyFloat32Ptr opType = 164
opStructFieldPtrHeadStringTagFloat32Ptr opType = 165
opStructFieldHeadFloat64Ptr opType = 166
opStructFieldHeadOmitEmptyFloat64Ptr opType = 167
opStructFieldHeadStringTagFloat64Ptr opType = 168
opStructFieldPtrHeadFloat64Ptr opType = 169
opStructFieldPtrHeadOmitEmptyFloat64Ptr opType = 170
opStructFieldPtrHeadStringTagFloat64Ptr opType = 171
opStructFieldHeadBoolPtr opType = 172
opStructFieldHeadOmitEmptyBoolPtr opType = 173
opStructFieldHeadStringTagBoolPtr opType = 174
opStructFieldPtrHeadBoolPtr opType = 175
opStructFieldPtrHeadOmitEmptyBoolPtr opType = 176
opStructFieldPtrHeadStringTagBoolPtr opType = 177
opStructFieldHeadStringPtr opType = 178
opStructFieldHeadOmitEmptyStringPtr opType = 179
opStructFieldHeadStringTagStringPtr opType = 180
opStructFieldPtrHeadStringPtr opType = 181
opStructFieldPtrHeadOmitEmptyStringPtr opType = 182
opStructFieldPtrHeadStringTagStringPtr opType = 183
opStructFieldHeadBytesPtr opType = 184
opStructFieldHeadOmitEmptyBytesPtr opType = 185
opStructFieldHeadStringTagBytesPtr opType = 186
opStructFieldPtrHeadBytesPtr opType = 187
opStructFieldPtrHeadOmitEmptyBytesPtr opType = 188
opStructFieldPtrHeadStringTagBytesPtr opType = 189
opStructFieldHeadNumberPtr opType = 190
opStructFieldHeadOmitEmptyNumberPtr opType = 191
opStructFieldHeadStringTagNumberPtr opType = 192
opStructFieldPtrHeadNumberPtr opType = 193
opStructFieldPtrHeadOmitEmptyNumberPtr opType = 194
opStructFieldPtrHeadStringTagNumberPtr opType = 195
opStructFieldHeadArrayPtr opType = 196
opStructFieldHeadOmitEmptyArrayPtr opType = 197
opStructFieldHeadStringTagArrayPtr opType = 198
opStructFieldPtrHeadArrayPtr opType = 199
opStructFieldPtrHeadOmitEmptyArrayPtr opType = 200
opStructFieldPtrHeadStringTagArrayPtr opType = 201
opStructFieldHeadMapPtr opType = 202
opStructFieldHeadOmitEmptyMapPtr opType = 203
opStructFieldHeadStringTagMapPtr opType = 204
opStructFieldPtrHeadMapPtr opType = 205
opStructFieldPtrHeadOmitEmptyMapPtr opType = 206
opStructFieldPtrHeadStringTagMapPtr opType = 207
opStructFieldHeadSlicePtr opType = 208
opStructFieldHeadOmitEmptySlicePtr opType = 209
opStructFieldHeadStringTagSlicePtr opType = 210
opStructFieldPtrHeadSlicePtr opType = 211
opStructFieldPtrHeadOmitEmptySlicePtr opType = 212
opStructFieldPtrHeadStringTagSlicePtr opType = 213
opStructFieldHeadMarshalJSONPtr opType = 214
opStructFieldHeadOmitEmptyMarshalJSONPtr opType = 215
opStructFieldHeadStringTagMarshalJSONPtr opType = 216
opStructFieldPtrHeadMarshalJSONPtr opType = 217
opStructFieldPtrHeadOmitEmptyMarshalJSONPtr opType = 218
opStructFieldPtrHeadStringTagMarshalJSONPtr opType = 219
opStructFieldHeadMarshalTextPtr opType = 220
opStructFieldHeadOmitEmptyMarshalTextPtr opType = 221
opStructFieldHeadStringTagMarshalTextPtr opType = 222
opStructFieldPtrHeadMarshalTextPtr opType = 223
opStructFieldPtrHeadOmitEmptyMarshalTextPtr opType = 224
opStructFieldPtrHeadStringTagMarshalTextPtr opType = 225
opStructFieldHeadInterfacePtr opType = 226
opStructFieldHeadOmitEmptyInterfacePtr opType = 227
opStructFieldHeadStringTagInterfacePtr opType = 228
opStructFieldPtrHeadInterfacePtr opType = 229
opStructFieldPtrHeadOmitEmptyInterfacePtr opType = 230
opStructFieldPtrHeadStringTagInterfacePtr opType = 231
opStructFieldHeadRecursivePtr opType = 232
opStructFieldHeadOmitEmptyRecursivePtr opType = 233
opStructFieldHeadStringTagRecursivePtr opType = 234
opStructFieldPtrHeadRecursivePtr opType = 235
opStructFieldPtrHeadOmitEmptyRecursivePtr opType = 236
opStructFieldPtrHeadStringTagRecursivePtr opType = 237
opStructFieldHead opType = 238
opStructFieldHeadOmitEmpty opType = 239
opStructFieldHeadStringTag opType = 240
opStructFieldPtrHead opType = 241
opStructFieldPtrHeadOmitEmpty opType = 242
opStructFieldPtrHeadStringTag opType = 243
opStructFieldInt opType = 244
opStructFieldOmitEmptyInt opType = 245
opStructFieldStringTagInt opType = 246
opStructFieldUint opType = 247
opStructFieldOmitEmptyUint opType = 248
opStructFieldStringTagUint opType = 249
opStructFieldFloat32 opType = 250
opStructFieldOmitEmptyFloat32 opType = 251
opStructFieldStringTagFloat32 opType = 252
opStructFieldFloat64 opType = 253
opStructFieldOmitEmptyFloat64 opType = 254
opStructFieldStringTagFloat64 opType = 255
opStructFieldBool opType = 256
opStructFieldOmitEmptyBool opType = 257
opStructFieldStringTagBool opType = 258
opStructFieldString opType = 259
opStructFieldOmitEmptyString opType = 260
opStructFieldStringTagString opType = 261
opStructFieldBytes opType = 262
opStructFieldOmitEmptyBytes opType = 263
opStructFieldStringTagBytes opType = 264
opStructFieldNumber opType = 265
opStructFieldOmitEmptyNumber opType = 266
opStructFieldStringTagNumber opType = 267
opStructFieldArray opType = 268
opStructFieldOmitEmptyArray opType = 269
opStructFieldStringTagArray opType = 270
opStructFieldMap opType = 271
opStructFieldOmitEmptyMap opType = 272
opStructFieldStringTagMap opType = 273
opStructFieldSlice opType = 274
opStructFieldOmitEmptySlice opType = 275
opStructFieldStringTagSlice opType = 276
opStructFieldStruct opType = 277
opStructFieldOmitEmptyStruct opType = 278
opStructFieldStringTagStruct opType = 279
opStructFieldMarshalJSON opType = 280
opStructFieldOmitEmptyMarshalJSON opType = 281
opStructFieldStringTagMarshalJSON opType = 282
opStructFieldMarshalText opType = 283
opStructFieldOmitEmptyMarshalText opType = 284
opStructFieldStringTagMarshalText opType = 285
opStructFieldRecursive opType = 286
opStructFieldOmitEmptyRecursive opType = 287
opStructFieldStringTagRecursive opType = 288
opStructFieldIntString opType = 289
opStructFieldOmitEmptyIntString opType = 290
opStructFieldStringTagIntString opType = 291
opStructFieldUintString opType = 292
opStructFieldOmitEmptyUintString opType = 293
opStructFieldStringTagUintString opType = 294
opStructFieldIntPtr opType = 295
opStructFieldOmitEmptyIntPtr opType = 296
opStructFieldStringTagIntPtr opType = 297
opStructFieldUintPtr opType = 298
opStructFieldOmitEmptyUintPtr opType = 299
opStructFieldStringTagUintPtr opType = 300
opStructFieldFloat32Ptr opType = 301
opStructFieldOmitEmptyFloat32Ptr opType = 302
opStructFieldStringTagFloat32Ptr opType = 303
opStructFieldFloat64Ptr opType = 304
opStructFieldOmitEmptyFloat64Ptr opType = 305
opStructFieldStringTagFloat64Ptr opType = 306
opStructFieldBoolPtr opType = 307
opStructFieldOmitEmptyBoolPtr opType = 308
opStructFieldStringTagBoolPtr opType = 309
opStructFieldStringPtr opType = 310
opStructFieldOmitEmptyStringPtr opType = 311
opStructFieldStringTagStringPtr opType = 312
opStructFieldBytesPtr opType = 313
opStructFieldOmitEmptyBytesPtr opType = 314
opStructFieldStringTagBytesPtr opType = 315
opStructFieldNumberPtr opType = 316
opStructFieldOmitEmptyNumberPtr opType = 317
opStructFieldStringTagNumberPtr opType = 318
opStructFieldArrayPtr opType = 319
opStructFieldOmitEmptyArrayPtr opType = 320
opStructFieldStringTagArrayPtr opType = 321
opStructFieldMapPtr opType = 322
opStructFieldOmitEmptyMapPtr opType = 323
opStructFieldStringTagMapPtr opType = 324
opStructFieldSlicePtr opType = 325
opStructFieldOmitEmptySlicePtr opType = 326
opStructFieldStringTagSlicePtr opType = 327
opStructFieldMarshalJSONPtr opType = 328
opStructFieldOmitEmptyMarshalJSONPtr opType = 329
opStructFieldStringTagMarshalJSONPtr opType = 330
opStructFieldMarshalTextPtr opType = 331
opStructFieldOmitEmptyMarshalTextPtr opType = 332
opStructFieldStringTagMarshalTextPtr opType = 333
opStructFieldInterfacePtr opType = 334
opStructFieldOmitEmptyInterfacePtr opType = 335
opStructFieldStringTagInterfacePtr opType = 336
opStructFieldRecursivePtr opType = 337
opStructFieldOmitEmptyRecursivePtr opType = 338
opStructFieldStringTagRecursivePtr opType = 339
opStructField opType = 340
opStructFieldOmitEmpty opType = 341
opStructFieldStringTag opType = 342
opStructEndInt opType = 343
opStructEndOmitEmptyInt opType = 344
opStructEndStringTagInt opType = 345
opStructEndUint opType = 346
opStructEndOmitEmptyUint opType = 347
opStructEndStringTagUint opType = 348
opStructEndFloat32 opType = 349
opStructEndOmitEmptyFloat32 opType = 350
opStructEndStringTagFloat32 opType = 351
opStructEndFloat64 opType = 352
opStructEndOmitEmptyFloat64 opType = 353
opStructEndStringTagFloat64 opType = 354
opStructEndBool opType = 355
opStructEndOmitEmptyBool opType = 356
opStructEndStringTagBool opType = 357
opStructEndString opType = 358
opStructEndOmitEmptyString opType = 359
opStructEndStringTagString opType = 360
opStructEndBytes opType = 361
opStructEndOmitEmptyBytes opType = 362
opStructEndStringTagBytes opType = 363
opStructEndNumber opType = 364
opStructEndOmitEmptyNumber opType = 365
opStructEndStringTagNumber opType = 366
opStructEndArray opType = 367
opStructEndOmitEmptyArray opType = 368
opStructEndStringTagArray opType = 369
opStructEndMap opType = 370
opStructEndOmitEmptyMap opType = 371
opStructEndStringTagMap opType = 372
opStructEndSlice opType = 373
opStructEndOmitEmptySlice opType = 374
opStructEndStringTagSlice opType = 375
opStructEndStruct opType = 376
opStructEndOmitEmptyStruct opType = 377
opStructEndStringTagStruct opType = 378
opStructEndMarshalJSON opType = 379
opStructEndOmitEmptyMarshalJSON opType = 380
opStructEndStringTagMarshalJSON opType = 381
opStructEndMarshalText opType = 382
opStructEndOmitEmptyMarshalText opType = 383
opStructEndStringTagMarshalText opType = 384
opStructEndRecursive opType = 385
opStructEndOmitEmptyRecursive opType = 386
opStructEndStringTagRecursive opType = 387
opStructEndIntString opType = 388
opStructEndOmitEmptyIntString opType = 389
opStructEndStringTagIntString opType = 390
opStructEndUintString opType = 391
opStructEndOmitEmptyUintString opType = 392
opStructEndStringTagUintString opType = 393
opStructEndIntPtr opType = 394
opStructEndOmitEmptyIntPtr opType = 395
opStructEndStringTagIntPtr opType = 396
opStructEndUintPtr opType = 397
opStructEndOmitEmptyUintPtr opType = 398
opStructEndStringTagUintPtr opType = 399
opStructEndFloat32Ptr opType = 400
opStructEndOmitEmptyFloat32Ptr opType = 401
opStructEndStringTagFloat32Ptr opType = 402
opStructEndFloat64Ptr opType = 403
opStructEndOmitEmptyFloat64Ptr opType = 404
opStructEndStringTagFloat64Ptr opType = 405
opStructEndBoolPtr opType = 406
opStructEndOmitEmptyBoolPtr opType = 407
opStructEndStringTagBoolPtr opType = 408
opStructEndStringPtr opType = 409
opStructEndOmitEmptyStringPtr opType = 410
opStructEndStringTagStringPtr opType = 411
opStructEndBytesPtr opType = 412
opStructEndOmitEmptyBytesPtr opType = 413
opStructEndStringTagBytesPtr opType = 414
opStructEndNumberPtr opType = 415
opStructEndOmitEmptyNumberPtr opType = 416
opStructEndStringTagNumberPtr opType = 417
opStructEndArrayPtr opType = 418
opStructEndOmitEmptyArrayPtr opType = 419
opStructEndStringTagArrayPtr opType = 420
opStructEndMapPtr opType = 421
opStructEndOmitEmptyMapPtr opType = 422
opStructEndStringTagMapPtr opType = 423
opStructEndSlicePtr opType = 424
opStructEndOmitEmptySlicePtr opType = 425
opStructEndStringTagSlicePtr opType = 426
opStructEndMarshalJSONPtr opType = 427
opStructEndOmitEmptyMarshalJSONPtr opType = 428
opStructEndStringTagMarshalJSONPtr opType = 429
opStructEndMarshalTextPtr opType = 430
opStructEndOmitEmptyMarshalTextPtr opType = 431
opStructEndStringTagMarshalTextPtr opType = 432
opStructEndInterfacePtr opType = 433
opStructEndOmitEmptyInterfacePtr opType = 434
opStructEndStringTagInterfacePtr opType = 435
opStructEndRecursivePtr opType = 436
opStructEndOmitEmptyRecursivePtr opType = 437
opStructEndStringTagRecursivePtr opType = 438
opStructEnd opType = 439
opStructEndOmitEmpty opType = 440
opStructEndStringTag opType = 441
2020-08-15 11:41:38 +03:00
)
func (t opType) String() string {
2021-03-11 11:59:22 +03:00
if int(t) >= 442 {
2021-01-17 16:23:28 +03:00
return ""
2021-01-10 14:21:58 +03:00
}
2021-01-17 16:23:28 +03:00
return opTypeStrings[int(t)]
2021-01-10 14:21:58 +03:00
}
func (t opType) codeType() codeType {
2021-01-10 18:48:20 +03:00
if strings.Contains(t.String(), "Struct") {
if strings.Contains(t.String(), "End") {
return codeStructEnd
}
return codeStructField
}
2021-03-09 19:11:48 +03:00
if t.String() == "Array" || t.String() == "ArrayPtr" {
2021-01-10 14:21:58 +03:00
return codeArrayHead
2021-01-10 18:48:20 +03:00
}
if strings.Contains(t.String(), "ArrayElem") {
2021-01-10 14:21:58 +03:00
return codeArrayElem
2021-01-10 18:48:20 +03:00
}
2021-03-09 19:11:48 +03:00
if t.String() == "Slice" || t.String() == "SlicePtr" {
2021-01-10 18:48:20 +03:00
return codeSliceHead
}
if strings.Contains(t.String(), "SliceElem") {
return codeSliceElem
}
2021-03-09 19:11:48 +03:00
if t.String() == "Map" || t.String() == "MapPtr" {
2021-01-10 14:21:58 +03:00
return codeMapHead
2021-01-10 18:48:20 +03:00
}
if strings.Contains(t.String(), "MapKey") {
2021-01-10 14:21:58 +03:00
return codeMapKey
2021-01-10 18:48:20 +03:00
}
if strings.Contains(t.String(), "MapValue") {
2021-01-10 14:21:58 +03:00
return codeMapValue
2021-01-10 18:48:20 +03:00
}
if strings.Contains(t.String(), "MapEnd") {
return codeMapEnd
}
return codeOp
}
func (t opType) headToPtrHead() opType {
if strings.Index(t.String(), "PtrHead") > 0 {
return t
}
idx := strings.Index(t.String(), "Field")
if idx == -1 {
return t
}
suffix := "Ptr" + t.String()[idx+len("Field"):]
2021-03-09 19:11:48 +03:00
const toPtrOffset = 3
2021-01-10 18:48:20 +03:00
if strings.Contains(opType(int(t)+toPtrOffset).String(), suffix) {
return opType(int(t) + toPtrOffset)
}
return t
}
func (t opType) headToOmitEmptyHead() opType {
const toOmitEmptyOffset = 1
2021-01-10 18:48:20 +03:00
if strings.Contains(opType(int(t)+toOmitEmptyOffset).String(), "OmitEmpty") {
return opType(int(t) + toOmitEmptyOffset)
}
return t
}
func (t opType) headToStringTagHead() opType {
const toStringTagOffset = 2
2021-01-10 18:48:20 +03:00
if strings.Contains(opType(int(t)+toStringTagOffset).String(), "StringTag") {
return opType(int(t) + toStringTagOffset)
}
return t
}
func (t opType) ptrHeadToHead() opType {
idx := strings.Index(t.String(), "Ptr")
if idx == -1 {
return t
}
suffix := t.String()[idx+len("Ptr"):]
2021-03-09 19:11:48 +03:00
const toPtrOffset = 3
2021-01-10 18:48:20 +03:00
if strings.Contains(opType(int(t)-toPtrOffset).String(), suffix) {
return opType(int(t) - toPtrOffset)
}
return t
}
func (t opType) fieldToEnd() opType {
2021-01-10 14:21:58 +03:00
switch t {
case opStructFieldInt:
2021-01-10 18:48:20 +03:00
return opStructEndInt
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyInt:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyInt
case opStructFieldStringTagInt:
return opStructEndStringTagInt
2021-01-10 14:21:58 +03:00
case opStructFieldUint:
2021-01-10 18:48:20 +03:00
return opStructEndUint
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyUint:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyUint
case opStructFieldStringTagUint:
return opStructEndStringTagUint
2021-01-10 14:21:58 +03:00
case opStructFieldFloat32:
2021-01-10 18:48:20 +03:00
return opStructEndFloat32
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyFloat32:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyFloat32
case opStructFieldStringTagFloat32:
return opStructEndStringTagFloat32
2021-01-10 14:21:58 +03:00
case opStructFieldFloat64:
2021-01-10 18:48:20 +03:00
return opStructEndFloat64
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyFloat64:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyFloat64
case opStructFieldStringTagFloat64:
return opStructEndStringTagFloat64
2021-01-10 14:21:58 +03:00
case opStructFieldBool:
2021-01-10 18:48:20 +03:00
return opStructEndBool
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyBool:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyBool
case opStructFieldStringTagBool:
return opStructEndStringTagBool
2021-01-10 14:21:58 +03:00
case opStructFieldString:
2021-01-10 18:48:20 +03:00
return opStructEndString
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyString:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyString
case opStructFieldStringTagString:
return opStructEndStringTagString
2021-01-10 14:21:58 +03:00
case opStructFieldBytes:
2021-01-10 18:48:20 +03:00
return opStructEndBytes
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyBytes:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyBytes
case opStructFieldStringTagBytes:
return opStructEndStringTagBytes
2021-03-11 08:58:33 +03:00
case opStructFieldNumber:
return opStructEndNumber
case opStructFieldOmitEmptyNumber:
return opStructEndOmitEmptyNumber
case opStructFieldStringTagNumber:
return opStructEndStringTagNumber
2021-01-10 14:21:58 +03:00
case opStructFieldMarshalJSON:
2021-01-10 18:48:20 +03:00
return opStructEndMarshalJSON
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyMarshalJSON:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyMarshalJSON
case opStructFieldStringTagMarshalJSON:
return opStructEndStringTagMarshalJSON
2021-01-10 14:21:58 +03:00
case opStructFieldMarshalText:
2021-01-10 18:48:20 +03:00
return opStructEndMarshalText
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyMarshalText:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyMarshalText
case opStructFieldStringTagMarshalText:
return opStructEndStringTagMarshalText
2021-01-10 14:21:58 +03:00
case opStructFieldIntString:
2021-01-10 18:48:20 +03:00
return opStructEndIntString
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyIntString:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyIntString
case opStructFieldStringTagIntString:
return opStructEndStringTagIntString
2021-01-10 14:21:58 +03:00
case opStructFieldUintString:
2021-01-10 18:48:20 +03:00
return opStructEndUintString
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyUintString:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyUintString
case opStructFieldStringTagUintString:
return opStructEndStringTagUintString
2021-01-10 14:21:58 +03:00
case opStructFieldIntPtr:
2021-01-10 18:48:20 +03:00
return opStructEndIntPtr
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyIntPtr:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyIntPtr
case opStructFieldStringTagIntPtr:
return opStructEndStringTagIntPtr
2021-01-10 14:21:58 +03:00
case opStructFieldUintPtr:
2021-01-10 18:48:20 +03:00
return opStructEndUintPtr
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyUintPtr:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyUintPtr
case opStructFieldStringTagUintPtr:
return opStructEndStringTagUintPtr
2021-01-10 14:21:58 +03:00
case opStructFieldFloat32Ptr:
2021-01-10 18:48:20 +03:00
return opStructEndFloat32Ptr
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyFloat32Ptr:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyFloat32Ptr
case opStructFieldStringTagFloat32Ptr:
return opStructEndStringTagFloat32Ptr
2021-01-10 14:21:58 +03:00
case opStructFieldFloat64Ptr:
2021-01-10 18:48:20 +03:00
return opStructEndFloat64Ptr
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyFloat64Ptr:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyFloat64Ptr
case opStructFieldStringTagFloat64Ptr:
return opStructEndStringTagFloat64Ptr
2021-01-10 14:21:58 +03:00
case opStructFieldBoolPtr:
2021-01-10 18:48:20 +03:00
return opStructEndBoolPtr
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyBoolPtr:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyBoolPtr
case opStructFieldStringTagBoolPtr:
return opStructEndStringTagBoolPtr
2021-01-10 14:21:58 +03:00
case opStructFieldStringPtr:
2021-01-10 18:48:20 +03:00
return opStructEndStringPtr
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyStringPtr:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyStringPtr
case opStructFieldStringTagStringPtr:
return opStructEndStringTagStringPtr
2021-01-10 14:21:58 +03:00
case opStructFieldBytesPtr:
2021-01-10 18:48:20 +03:00
return opStructEndBytesPtr
2021-01-10 14:21:58 +03:00
case opStructFieldOmitEmptyBytesPtr:
2021-01-10 18:48:20 +03:00
return opStructEndOmitEmptyBytesPtr
case opStructFieldStringTagBytesPtr:
return opStructEndStringTagBytesPtr
2021-03-11 08:58:33 +03:00
case opStructFieldNumberPtr:
return opStructEndNumberPtr
case opStructFieldOmitEmptyNumberPtr:
return opStructEndOmitEmptyNumberPtr
case opStructFieldStringTagNumberPtr:
return opStructEndStringTagNumberPtr
2021-03-03 08:54:40 +03:00
case opStructFieldArrayPtr:
return opStructEndArrayPtr
case opStructFieldOmitEmptyArrayPtr:
return opStructEndOmitEmptyArrayPtr
case opStructFieldStringTagArrayPtr:
return opStructEndStringTagArrayPtr
case opStructFieldMapPtr:
return opStructEndMapPtr
case opStructFieldOmitEmptyMapPtr:
return opStructEndOmitEmptyMapPtr
case opStructFieldStringTagMapPtr:
return opStructEndStringTagMapPtr
2021-03-11 08:58:33 +03:00
case opStructFieldSlicePtr:
return opStructEndSlicePtr
case opStructFieldOmitEmptySlicePtr:
return opStructEndOmitEmptySlicePtr
case opStructFieldStringTagSlicePtr:
return opStructEndStringTagSlicePtr
case opStructFieldMarshalJSONPtr:
return opStructEndMarshalJSONPtr
case opStructFieldOmitEmptyMarshalJSONPtr:
return opStructEndOmitEmptyMarshalJSONPtr
case opStructFieldStringTagMarshalJSONPtr:
return opStructEndStringTagMarshalJSONPtr
2021-03-06 05:47:51 +03:00
case opStructFieldMarshalTextPtr:
return opStructEndMarshalTextPtr
case opStructFieldOmitEmptyMarshalTextPtr:
return opStructEndOmitEmptyMarshalTextPtr
case opStructFieldStringTagMarshalTextPtr:
return opStructEndStringTagMarshalTextPtr
2021-03-09 19:11:48 +03:00
case opStructFieldInterfacePtr:
return opStructEndInterfacePtr
case opStructFieldOmitEmptyInterfacePtr:
return opStructEndOmitEmptyInterfacePtr
case opStructFieldStringTagInterfacePtr:
return opStructEndStringTagInterfacePtr
2021-03-11 11:59:22 +03:00
case opStructFieldRecursivePtr:
return opStructEndRecursivePtr
case opStructFieldOmitEmptyRecursivePtr:
return opStructEndOmitEmptyRecursivePtr
case opStructFieldStringTagRecursivePtr:
return opStructEndStringTagRecursivePtr
2021-01-10 18:48:20 +03:00
}
return t
}
func (t opType) fieldToOmitEmptyField() opType {
const toOmitEmptyOffset = 1
if strings.Contains(opType(int(t)+toOmitEmptyOffset).String(), "OmitEmpty") {
return opType(int(t) + toOmitEmptyOffset)
}
return t
}
func (t opType) fieldToStringTagField() opType {
const toStringTagOffset = 2
if strings.Contains(opType(int(t)+toStringTagOffset).String(), "StringTag") {
return opType(int(t) + toStringTagOffset)
2020-11-12 18:27:11 +03:00
}
return t
2020-08-19 13:55:06 +03:00
}