go-json/encode_optype.go

1159 lines
45 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 08:58:33 +03:00
var opTypeStrings = [429]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-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-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-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-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
opStructFieldHeadInt opType = 45
opStructFieldHeadOmitEmptyInt opType = 46
opStructFieldHeadStringTagInt opType = 47
opStructFieldPtrHeadInt opType = 48
opStructFieldPtrHeadOmitEmptyInt opType = 49
opStructFieldPtrHeadStringTagInt opType = 50
opStructFieldHeadUint opType = 51
opStructFieldHeadOmitEmptyUint opType = 52
opStructFieldHeadStringTagUint opType = 53
opStructFieldPtrHeadUint opType = 54
opStructFieldPtrHeadOmitEmptyUint opType = 55
opStructFieldPtrHeadStringTagUint opType = 56
opStructFieldHeadFloat32 opType = 57
opStructFieldHeadOmitEmptyFloat32 opType = 58
opStructFieldHeadStringTagFloat32 opType = 59
opStructFieldPtrHeadFloat32 opType = 60
opStructFieldPtrHeadOmitEmptyFloat32 opType = 61
opStructFieldPtrHeadStringTagFloat32 opType = 62
opStructFieldHeadFloat64 opType = 63
opStructFieldHeadOmitEmptyFloat64 opType = 64
opStructFieldHeadStringTagFloat64 opType = 65
opStructFieldPtrHeadFloat64 opType = 66
opStructFieldPtrHeadOmitEmptyFloat64 opType = 67
opStructFieldPtrHeadStringTagFloat64 opType = 68
opStructFieldHeadBool opType = 69
opStructFieldHeadOmitEmptyBool opType = 70
opStructFieldHeadStringTagBool opType = 71
opStructFieldPtrHeadBool opType = 72
opStructFieldPtrHeadOmitEmptyBool opType = 73
opStructFieldPtrHeadStringTagBool opType = 74
opStructFieldHeadString opType = 75
opStructFieldHeadOmitEmptyString opType = 76
opStructFieldHeadStringTagString opType = 77
opStructFieldPtrHeadString opType = 78
opStructFieldPtrHeadOmitEmptyString opType = 79
opStructFieldPtrHeadStringTagString opType = 80
opStructFieldHeadBytes opType = 81
opStructFieldHeadOmitEmptyBytes opType = 82
opStructFieldHeadStringTagBytes opType = 83
opStructFieldPtrHeadBytes opType = 84
opStructFieldPtrHeadOmitEmptyBytes opType = 85
opStructFieldPtrHeadStringTagBytes opType = 86
opStructFieldHeadNumber opType = 87
opStructFieldHeadOmitEmptyNumber opType = 88
opStructFieldHeadStringTagNumber opType = 89
opStructFieldPtrHeadNumber opType = 90
opStructFieldPtrHeadOmitEmptyNumber opType = 91
opStructFieldPtrHeadStringTagNumber opType = 92
opStructFieldHeadArray opType = 93
opStructFieldHeadOmitEmptyArray opType = 94
opStructFieldHeadStringTagArray opType = 95
opStructFieldPtrHeadArray opType = 96
opStructFieldPtrHeadOmitEmptyArray opType = 97
opStructFieldPtrHeadStringTagArray opType = 98
opStructFieldHeadMap opType = 99
opStructFieldHeadOmitEmptyMap opType = 100
opStructFieldHeadStringTagMap opType = 101
opStructFieldPtrHeadMap opType = 102
opStructFieldPtrHeadOmitEmptyMap opType = 103
opStructFieldPtrHeadStringTagMap opType = 104
opStructFieldHeadSlice opType = 105
opStructFieldHeadOmitEmptySlice opType = 106
opStructFieldHeadStringTagSlice opType = 107
opStructFieldPtrHeadSlice opType = 108
opStructFieldPtrHeadOmitEmptySlice opType = 109
opStructFieldPtrHeadStringTagSlice opType = 110
opStructFieldHeadStruct opType = 111
opStructFieldHeadOmitEmptyStruct opType = 112
opStructFieldHeadStringTagStruct opType = 113
opStructFieldPtrHeadStruct opType = 114
opStructFieldPtrHeadOmitEmptyStruct opType = 115
opStructFieldPtrHeadStringTagStruct opType = 116
opStructFieldHeadMarshalJSON opType = 117
opStructFieldHeadOmitEmptyMarshalJSON opType = 118
opStructFieldHeadStringTagMarshalJSON opType = 119
opStructFieldPtrHeadMarshalJSON opType = 120
opStructFieldPtrHeadOmitEmptyMarshalJSON opType = 121
opStructFieldPtrHeadStringTagMarshalJSON opType = 122
opStructFieldHeadMarshalText opType = 123
opStructFieldHeadOmitEmptyMarshalText opType = 124
opStructFieldHeadStringTagMarshalText opType = 125
opStructFieldPtrHeadMarshalText opType = 126
opStructFieldPtrHeadOmitEmptyMarshalText opType = 127
opStructFieldPtrHeadStringTagMarshalText opType = 128
opStructFieldHeadRecursive opType = 129
opStructFieldHeadOmitEmptyRecursive opType = 130
opStructFieldHeadStringTagRecursive opType = 131
opStructFieldPtrHeadRecursive opType = 132
opStructFieldPtrHeadOmitEmptyRecursive opType = 133
opStructFieldPtrHeadStringTagRecursive opType = 134
opStructFieldHeadIntString opType = 135
opStructFieldHeadOmitEmptyIntString opType = 136
opStructFieldHeadStringTagIntString opType = 137
opStructFieldPtrHeadIntString opType = 138
opStructFieldPtrHeadOmitEmptyIntString opType = 139
opStructFieldPtrHeadStringTagIntString opType = 140
opStructFieldHeadUintString opType = 141
opStructFieldHeadOmitEmptyUintString opType = 142
opStructFieldHeadStringTagUintString opType = 143
opStructFieldPtrHeadUintString opType = 144
opStructFieldPtrHeadOmitEmptyUintString opType = 145
opStructFieldPtrHeadStringTagUintString opType = 146
opStructFieldHeadIntPtr opType = 147
opStructFieldHeadOmitEmptyIntPtr opType = 148
opStructFieldHeadStringTagIntPtr opType = 149
opStructFieldPtrHeadIntPtr opType = 150
opStructFieldPtrHeadOmitEmptyIntPtr opType = 151
opStructFieldPtrHeadStringTagIntPtr opType = 152
opStructFieldHeadUintPtr opType = 153
opStructFieldHeadOmitEmptyUintPtr opType = 154
opStructFieldHeadStringTagUintPtr opType = 155
opStructFieldPtrHeadUintPtr opType = 156
opStructFieldPtrHeadOmitEmptyUintPtr opType = 157
opStructFieldPtrHeadStringTagUintPtr opType = 158
opStructFieldHeadFloat32Ptr opType = 159
opStructFieldHeadOmitEmptyFloat32Ptr opType = 160
opStructFieldHeadStringTagFloat32Ptr opType = 161
opStructFieldPtrHeadFloat32Ptr opType = 162
opStructFieldPtrHeadOmitEmptyFloat32Ptr opType = 163
opStructFieldPtrHeadStringTagFloat32Ptr opType = 164
opStructFieldHeadFloat64Ptr opType = 165
opStructFieldHeadOmitEmptyFloat64Ptr opType = 166
opStructFieldHeadStringTagFloat64Ptr opType = 167
opStructFieldPtrHeadFloat64Ptr opType = 168
opStructFieldPtrHeadOmitEmptyFloat64Ptr opType = 169
opStructFieldPtrHeadStringTagFloat64Ptr opType = 170
opStructFieldHeadBoolPtr opType = 171
opStructFieldHeadOmitEmptyBoolPtr opType = 172
opStructFieldHeadStringTagBoolPtr opType = 173
opStructFieldPtrHeadBoolPtr opType = 174
opStructFieldPtrHeadOmitEmptyBoolPtr opType = 175
opStructFieldPtrHeadStringTagBoolPtr opType = 176
opStructFieldHeadStringPtr opType = 177
opStructFieldHeadOmitEmptyStringPtr opType = 178
opStructFieldHeadStringTagStringPtr opType = 179
opStructFieldPtrHeadStringPtr opType = 180
opStructFieldPtrHeadOmitEmptyStringPtr opType = 181
opStructFieldPtrHeadStringTagStringPtr opType = 182
opStructFieldHeadBytesPtr opType = 183
opStructFieldHeadOmitEmptyBytesPtr opType = 184
opStructFieldHeadStringTagBytesPtr opType = 185
opStructFieldPtrHeadBytesPtr opType = 186
opStructFieldPtrHeadOmitEmptyBytesPtr opType = 187
opStructFieldPtrHeadStringTagBytesPtr opType = 188
opStructFieldHeadNumberPtr opType = 189
opStructFieldHeadOmitEmptyNumberPtr opType = 190
opStructFieldHeadStringTagNumberPtr opType = 191
opStructFieldPtrHeadNumberPtr opType = 192
opStructFieldPtrHeadOmitEmptyNumberPtr opType = 193
opStructFieldPtrHeadStringTagNumberPtr opType = 194
opStructFieldHeadArrayPtr opType = 195
opStructFieldHeadOmitEmptyArrayPtr opType = 196
opStructFieldHeadStringTagArrayPtr opType = 197
opStructFieldPtrHeadArrayPtr opType = 198
opStructFieldPtrHeadOmitEmptyArrayPtr opType = 199
opStructFieldPtrHeadStringTagArrayPtr opType = 200
opStructFieldHeadMapPtr opType = 201
opStructFieldHeadOmitEmptyMapPtr opType = 202
opStructFieldHeadStringTagMapPtr opType = 203
opStructFieldPtrHeadMapPtr opType = 204
opStructFieldPtrHeadOmitEmptyMapPtr opType = 205
opStructFieldPtrHeadStringTagMapPtr opType = 206
opStructFieldHeadSlicePtr opType = 207
opStructFieldHeadOmitEmptySlicePtr opType = 208
opStructFieldHeadStringTagSlicePtr opType = 209
opStructFieldPtrHeadSlicePtr opType = 210
opStructFieldPtrHeadOmitEmptySlicePtr opType = 211
opStructFieldPtrHeadStringTagSlicePtr opType = 212
opStructFieldHeadMarshalJSONPtr opType = 213
opStructFieldHeadOmitEmptyMarshalJSONPtr opType = 214
opStructFieldHeadStringTagMarshalJSONPtr opType = 215
opStructFieldPtrHeadMarshalJSONPtr opType = 216
opStructFieldPtrHeadOmitEmptyMarshalJSONPtr opType = 217
opStructFieldPtrHeadStringTagMarshalJSONPtr opType = 218
opStructFieldHeadMarshalTextPtr opType = 219
opStructFieldHeadOmitEmptyMarshalTextPtr opType = 220
opStructFieldHeadStringTagMarshalTextPtr opType = 221
opStructFieldPtrHeadMarshalTextPtr opType = 222
opStructFieldPtrHeadOmitEmptyMarshalTextPtr opType = 223
opStructFieldPtrHeadStringTagMarshalTextPtr opType = 224
opStructFieldHeadInterfacePtr opType = 225
opStructFieldHeadOmitEmptyInterfacePtr opType = 226
opStructFieldHeadStringTagInterfacePtr opType = 227
opStructFieldPtrHeadInterfacePtr opType = 228
opStructFieldPtrHeadOmitEmptyInterfacePtr opType = 229
opStructFieldPtrHeadStringTagInterfacePtr opType = 230
opStructFieldHead opType = 231
opStructFieldHeadOmitEmpty opType = 232
opStructFieldHeadStringTag opType = 233
opStructFieldPtrHead opType = 234
opStructFieldPtrHeadOmitEmpty opType = 235
opStructFieldPtrHeadStringTag opType = 236
opStructFieldInt opType = 237
opStructFieldOmitEmptyInt opType = 238
opStructFieldStringTagInt opType = 239
opStructFieldUint opType = 240
opStructFieldOmitEmptyUint opType = 241
opStructFieldStringTagUint opType = 242
opStructFieldFloat32 opType = 243
opStructFieldOmitEmptyFloat32 opType = 244
opStructFieldStringTagFloat32 opType = 245
opStructFieldFloat64 opType = 246
opStructFieldOmitEmptyFloat64 opType = 247
opStructFieldStringTagFloat64 opType = 248
opStructFieldBool opType = 249
opStructFieldOmitEmptyBool opType = 250
opStructFieldStringTagBool opType = 251
opStructFieldString opType = 252
opStructFieldOmitEmptyString opType = 253
opStructFieldStringTagString opType = 254
opStructFieldBytes opType = 255
opStructFieldOmitEmptyBytes opType = 256
opStructFieldStringTagBytes opType = 257
opStructFieldNumber opType = 258
opStructFieldOmitEmptyNumber opType = 259
opStructFieldStringTagNumber opType = 260
opStructFieldArray opType = 261
opStructFieldOmitEmptyArray opType = 262
opStructFieldStringTagArray opType = 263
opStructFieldMap opType = 264
opStructFieldOmitEmptyMap opType = 265
opStructFieldStringTagMap opType = 266
opStructFieldSlice opType = 267
opStructFieldOmitEmptySlice opType = 268
opStructFieldStringTagSlice opType = 269
opStructFieldStruct opType = 270
opStructFieldOmitEmptyStruct opType = 271
opStructFieldStringTagStruct opType = 272
opStructFieldMarshalJSON opType = 273
opStructFieldOmitEmptyMarshalJSON opType = 274
opStructFieldStringTagMarshalJSON opType = 275
opStructFieldMarshalText opType = 276
opStructFieldOmitEmptyMarshalText opType = 277
opStructFieldStringTagMarshalText opType = 278
opStructFieldRecursive opType = 279
opStructFieldOmitEmptyRecursive opType = 280
opStructFieldStringTagRecursive opType = 281
opStructFieldIntString opType = 282
opStructFieldOmitEmptyIntString opType = 283
opStructFieldStringTagIntString opType = 284
opStructFieldUintString opType = 285
opStructFieldOmitEmptyUintString opType = 286
opStructFieldStringTagUintString opType = 287
opStructFieldIntPtr opType = 288
opStructFieldOmitEmptyIntPtr opType = 289
opStructFieldStringTagIntPtr opType = 290
opStructFieldUintPtr opType = 291
opStructFieldOmitEmptyUintPtr opType = 292
opStructFieldStringTagUintPtr opType = 293
opStructFieldFloat32Ptr opType = 294
opStructFieldOmitEmptyFloat32Ptr opType = 295
opStructFieldStringTagFloat32Ptr opType = 296
opStructFieldFloat64Ptr opType = 297
opStructFieldOmitEmptyFloat64Ptr opType = 298
opStructFieldStringTagFloat64Ptr opType = 299
opStructFieldBoolPtr opType = 300
opStructFieldOmitEmptyBoolPtr opType = 301
opStructFieldStringTagBoolPtr opType = 302
opStructFieldStringPtr opType = 303
opStructFieldOmitEmptyStringPtr opType = 304
opStructFieldStringTagStringPtr opType = 305
opStructFieldBytesPtr opType = 306
opStructFieldOmitEmptyBytesPtr opType = 307
opStructFieldStringTagBytesPtr opType = 308
opStructFieldNumberPtr opType = 309
opStructFieldOmitEmptyNumberPtr opType = 310
opStructFieldStringTagNumberPtr opType = 311
opStructFieldArrayPtr opType = 312
opStructFieldOmitEmptyArrayPtr opType = 313
opStructFieldStringTagArrayPtr opType = 314
opStructFieldMapPtr opType = 315
opStructFieldOmitEmptyMapPtr opType = 316
opStructFieldStringTagMapPtr opType = 317
opStructFieldSlicePtr opType = 318
opStructFieldOmitEmptySlicePtr opType = 319
opStructFieldStringTagSlicePtr opType = 320
opStructFieldMarshalJSONPtr opType = 321
opStructFieldOmitEmptyMarshalJSONPtr opType = 322
opStructFieldStringTagMarshalJSONPtr opType = 323
opStructFieldMarshalTextPtr opType = 324
opStructFieldOmitEmptyMarshalTextPtr opType = 325
opStructFieldStringTagMarshalTextPtr opType = 326
opStructFieldInterfacePtr opType = 327
opStructFieldOmitEmptyInterfacePtr opType = 328
opStructFieldStringTagInterfacePtr opType = 329
opStructField opType = 330
opStructFieldOmitEmpty opType = 331
opStructFieldStringTag opType = 332
opStructEndInt opType = 333
opStructEndOmitEmptyInt opType = 334
opStructEndStringTagInt opType = 335
opStructEndUint opType = 336
opStructEndOmitEmptyUint opType = 337
opStructEndStringTagUint opType = 338
opStructEndFloat32 opType = 339
opStructEndOmitEmptyFloat32 opType = 340
opStructEndStringTagFloat32 opType = 341
opStructEndFloat64 opType = 342
opStructEndOmitEmptyFloat64 opType = 343
opStructEndStringTagFloat64 opType = 344
opStructEndBool opType = 345
opStructEndOmitEmptyBool opType = 346
opStructEndStringTagBool opType = 347
opStructEndString opType = 348
opStructEndOmitEmptyString opType = 349
opStructEndStringTagString opType = 350
opStructEndBytes opType = 351
opStructEndOmitEmptyBytes opType = 352
opStructEndStringTagBytes opType = 353
opStructEndNumber opType = 354
opStructEndOmitEmptyNumber opType = 355
opStructEndStringTagNumber opType = 356
opStructEndArray opType = 357
opStructEndOmitEmptyArray opType = 358
opStructEndStringTagArray opType = 359
opStructEndMap opType = 360
opStructEndOmitEmptyMap opType = 361
opStructEndStringTagMap opType = 362
opStructEndSlice opType = 363
opStructEndOmitEmptySlice opType = 364
opStructEndStringTagSlice opType = 365
opStructEndStruct opType = 366
opStructEndOmitEmptyStruct opType = 367
opStructEndStringTagStruct opType = 368
opStructEndMarshalJSON opType = 369
opStructEndOmitEmptyMarshalJSON opType = 370
opStructEndStringTagMarshalJSON opType = 371
opStructEndMarshalText opType = 372
opStructEndOmitEmptyMarshalText opType = 373
opStructEndStringTagMarshalText opType = 374
opStructEndRecursive opType = 375
opStructEndOmitEmptyRecursive opType = 376
opStructEndStringTagRecursive opType = 377
opStructEndIntString opType = 378
opStructEndOmitEmptyIntString opType = 379
opStructEndStringTagIntString opType = 380
opStructEndUintString opType = 381
opStructEndOmitEmptyUintString opType = 382
opStructEndStringTagUintString opType = 383
opStructEndIntPtr opType = 384
opStructEndOmitEmptyIntPtr opType = 385
opStructEndStringTagIntPtr opType = 386
opStructEndUintPtr opType = 387
opStructEndOmitEmptyUintPtr opType = 388
opStructEndStringTagUintPtr opType = 389
opStructEndFloat32Ptr opType = 390
opStructEndOmitEmptyFloat32Ptr opType = 391
opStructEndStringTagFloat32Ptr opType = 392
opStructEndFloat64Ptr opType = 393
opStructEndOmitEmptyFloat64Ptr opType = 394
opStructEndStringTagFloat64Ptr opType = 395
opStructEndBoolPtr opType = 396
opStructEndOmitEmptyBoolPtr opType = 397
opStructEndStringTagBoolPtr opType = 398
opStructEndStringPtr opType = 399
opStructEndOmitEmptyStringPtr opType = 400
opStructEndStringTagStringPtr opType = 401
opStructEndBytesPtr opType = 402
opStructEndOmitEmptyBytesPtr opType = 403
opStructEndStringTagBytesPtr opType = 404
opStructEndNumberPtr opType = 405
opStructEndOmitEmptyNumberPtr opType = 406
opStructEndStringTagNumberPtr opType = 407
opStructEndArrayPtr opType = 408
opStructEndOmitEmptyArrayPtr opType = 409
opStructEndStringTagArrayPtr opType = 410
opStructEndMapPtr opType = 411
opStructEndOmitEmptyMapPtr opType = 412
opStructEndStringTagMapPtr opType = 413
opStructEndSlicePtr opType = 414
opStructEndOmitEmptySlicePtr opType = 415
opStructEndStringTagSlicePtr opType = 416
opStructEndMarshalJSONPtr opType = 417
opStructEndOmitEmptyMarshalJSONPtr opType = 418
opStructEndStringTagMarshalJSONPtr opType = 419
opStructEndMarshalTextPtr opType = 420
opStructEndOmitEmptyMarshalTextPtr opType = 421
opStructEndStringTagMarshalTextPtr opType = 422
opStructEndInterfacePtr opType = 423
opStructEndOmitEmptyInterfacePtr opType = 424
opStructEndStringTagInterfacePtr opType = 425
opStructEnd opType = 426
opStructEndOmitEmpty opType = 427
opStructEndStringTag opType = 428
2020-08-15 11:41:38 +03:00
)
func (t opType) String() string {
2021-03-11 08:58:33 +03:00
if int(t) >= 429 {
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-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
}