Generate encode_optype.go

This commit is contained in:
Masaaki Goshima 2021-02-22 00:54:34 +09:00
parent 73fbc98667
commit ef165af9cd
2 changed files with 1586 additions and 4353 deletions

View File

@ -295,18 +295,12 @@ func (t opType) fieldToStringTagField() opType {
"StructEnd", "StructEnd",
} }
primitiveTypes := []string{ primitiveTypes := []string{
"int", "int8", "int16", "int32", "int64", "int", "uint", "float32", "float64", "bool", "string", "bytes",
"uint", "uint8", "uint16", "uint32", "uint64",
"float32", "float64", "bool", "string", "bytes",
"array", "map", "mapLoad", "slice", "struct", "MarshalJSON", "MarshalText", "recursive", "array", "map", "mapLoad", "slice", "struct", "MarshalJSON", "MarshalText", "recursive",
"intString", "int8String", "int16String", "int32String", "int64String", "intString", "uintString",
"uintString", "uint8String", "uint16String", "uint32String", "uint64String", "intPtr", "uintPtr", "float32Ptr", "float64Ptr", "boolPtr", "stringPtr", "bytesPtr",
"intPtr", "int8Ptr", "int16Ptr", "int32Ptr", "int64Ptr", "intNPtr", "uintNPtr", "float32NPtr", "float64NPtr", "boolNPtr", "stringNPtr", "bytesNPtr",
"uintPtr", "uint8Ptr", "uint16Ptr", "uint32Ptr", "uint64Ptr", "emptyStruct", "emptyStructPtr",
"float32Ptr", "float64Ptr", "boolPtr", "stringPtr", "bytesPtr",
"intNPtr", "int8NPtr", "int16NPtr", "int32NPtr", "int64NPtr",
"uintNPtr", "uint8NPtr", "uint16NPtr", "uint32NPtr", "uint64NPtr",
"float32NPtr", "float64NPtr", "boolNPtr", "stringNPtr", "bytesNPtr",
} }
primitiveTypesUpper := []string{} primitiveTypesUpper := []string{}
for _, typ := range primitiveTypes { for _, typ := range primitiveTypes {
@ -408,8 +402,7 @@ func (t opType) fieldToStringTagField() opType {
switch typ { switch typ {
case "", "Array", "Map", "MapLoad", "Slice", case "", "Array", "Map", "MapLoad", "Slice",
"Struct", "Recursive", "MarshalJSON", "MarshalText", "Struct", "Recursive", "MarshalJSON", "MarshalText",
"IntString", "Int8String", "Int16String", "Int32String", "Int64String", "IntString", "UintString":
"UintString", "Uint8String", "Uint16String", "Uint32String", "Uint64String":
return op return op
} }
return fmt.Sprintf( return fmt.Sprintf(

File diff suppressed because it is too large Load Diff