diff --git a/cli/cli.go b/cli/cli.go index 5de54843..e61841dc 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -51,6 +51,6 @@ func init() { // Init runs the cli app func Init() { if err := mainCmd.Execute(); err != nil { - os.Exit(-1) + os.Exit(1) } } diff --git a/cli/start.go b/cli/start.go index b2e6d1f7..f038b7af 100644 --- a/cli/start.go +++ b/cli/start.go @@ -18,6 +18,7 @@ import ( "github.com/spf13/cobra" "github.com/abcum/surreal/db" + "github.com/abcum/surreal/kvs" "github.com/abcum/surreal/log" "github.com/abcum/surreal/web" ) @@ -26,12 +27,15 @@ var startCmd = &cobra.Command{ Use: "start [flags]", Short: "Start the database and http server", PreRun: func(cmd *cobra.Command, args []string) { - log.Display(logo) - }, RunE: func(cmd *cobra.Command, args []string) (err error) { + if err = kvs.Setup(opts); err != nil { + log.Fatal(err) + return + } + if err = db.Setup(opts); err != nil { log.Fatal(err) return @@ -47,12 +51,17 @@ var startCmd = &cobra.Command{ }, PostRunE: func(cmd *cobra.Command, args []string) (err error) { - if err = web.Exit(); err != nil { + if err = web.Exit(opts); err != nil { log.Fatal(err) return } - if err = db.Exit(); err != nil { + if err = db.Exit(opts); err != nil { + log.Fatal(err) + return + } + + if err = kvs.Exit(opts); err != nil { log.Fatal(err) return } diff --git a/db/cache.go b/db/cache.go index 2919712f..622935c7 100644 --- a/db/cache.go +++ b/db/cache.go @@ -15,34 +15,44 @@ package db import ( - "sync" + "github.com/dgraph-io/ristretto" ) -type cache struct { - items sync.Map -} +var keyCache *ristretto.Cache +var valCache *ristretto.Cache -func (c *cache) Clr() { - c.items.Range(func(key interface{}, _ interface{}) bool { - c.items.Delete(key) - return true +func init() { + + keyCache, _ = ristretto.NewCache(&ristretto.Config{ + NumCounters: 1e7, + MaxCost: 1 << 32, + BufferItems: 64, + Cost: func(i interface{}) int64 { + switch v := i.(type) { + case string: + return int64(len(v)) + case []byte: + return int64(len(v)) + default: + return 1 + } + }, }) -} -func (c *cache) Del(key string) { - c.items.Delete(key) -} + valCache, _ = ristretto.NewCache(&ristretto.Config{ + NumCounters: 1e7, + MaxCost: 1 << 32, + BufferItems: 64, + Cost: func(i interface{}) int64 { + switch v := i.(type) { + case string: + return int64(len(v)) + case []byte: + return int64(len(v)) + default: + return 1 + } + }, + }) -func (c *cache) Has(key string) bool { - _, ok := c.items.Load(key) - return ok -} - -func (c *cache) Get(key string) interface{} { - val, _ := c.items.Load(key) - return val -} - -func (c *cache) Put(key string, val interface{}) { - c.items.Store(key, val) } diff --git a/db/check.go b/db/check.go index b5122499..0ad65fca 100644 --- a/db/check.go +++ b/db/check.go @@ -74,7 +74,7 @@ func (d *document) grant(ctx context.Context, met method) (ok bool, err error) { // so we can check if the permissions // allow us to view this document. - tb, err := d.i.e.dbo.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) + tb, err := d.i.e.tx.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return false, err } @@ -161,7 +161,7 @@ func (d *document) allow(ctx context.Context, met method) (ok bool, err error) { // so we can check if the permissions // allow us to view this document. - tb, err := d.i.e.dbo.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) + tb, err := d.i.e.tx.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return false, err } diff --git a/db/db.gen.go b/db/db.gen.go index 6391bc0a..5568e6d4 100644 --- a/db/db.gen.go +++ b/db/db.gen.go @@ -1,3 +1,5 @@ +// +build go1.6 + // Code generated by codecgen - DO NOT EDIT. package db @@ -11,216 +13,170 @@ import ( const ( // ----- content types ---- - codecSelferCcUTF87751 = 1 - codecSelferCcRAW7751 = 255 + codecSelferCcUTF84653 = 1 + codecSelferCcRAW4653 = 255 // ----- value types used ---- - codecSelferValueTypeArray7751 = 10 - codecSelferValueTypeMap7751 = 9 - codecSelferValueTypeString7751 = 6 - codecSelferValueTypeInt7751 = 2 - codecSelferValueTypeUint7751 = 3 - codecSelferValueTypeFloat7751 = 4 - codecSelferBitsize7751 = uint8(32 << (^uint(0) >> 63)) + codecSelferValueTypeArray4653 = 10 + codecSelferValueTypeMap4653 = 9 + codecSelferValueTypeString4653 = 6 + codecSelferValueTypeInt4653 = 2 + codecSelferValueTypeUint4653 = 3 + codecSelferValueTypeFloat4653 = 4 + codecSelferValueTypeNil4653 = 1 + codecSelferBitsize4653 = uint8(32 << (^uint(0) >> 63)) + codecSelferDecContainerLenNil4653 = -2147483648 ) var ( - errCodecSelferOnlyMapOrArrayEncodeToStruct7751 = errors.New(`only encoded map or array can be decoded into a struct`) + errCodecSelferOnlyMapOrArrayEncodeToStruct4653 = errors.New(`only encoded map or array can be decoded into a struct`) ) -type codecSelfer7751 struct{} +type codecSelfer4653 struct{} + +func codecSelfer4653False() bool { return false } func init() { - if codec1978.GenVersion != 10 { + if codec1978.GenVersion != 16 { _, file, _, _ := runtime.Caller(0) - panic("codecgen version mismatch: current: 10, need " + strconv.FormatInt(int64(codec1978.GenVersion), 10) + ". Re-generate file: " + file) - } - if false { - var _ byte = 0 // reference the types, but skip this branch at build/run time + ver := strconv.FormatInt(int64(codec1978.GenVersion), 10) + panic("codecgen version mismatch: current: 16, need " + ver + ". Re-generate file: " + file) } } func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7751 + var h codecSelfer4653 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - var yyq2 = [4]bool{ // should field at this index be written? - x.Time != "", // Time - x.Status != "", // Status - x.Detail != "", // Detail - len(x.Result) != 0, // Result - } - _ = yyq2 - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyq2 = [4]bool{ // should field at this index be written? + x.Time != "", // Time + x.Status != "", // Status + x.Detail != "", // Detail + len(x.Result) != 0, // Result + } + _ = yyq2 + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(4) + z.EncWriteArrayElem() + if yyq2[0] { + r.EncodeString(string(x.Time)) } else { - var yynn2 int - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.WriteMapStart(yynn2) - yynn2 = 0 + r.EncodeString("") } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[0] { - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Time)) - } - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, "") - } + z.EncWriteArrayElem() + if yyq2[1] { + r.EncodeString(string(x.Status)) } else { - if yyq2[0] { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"time\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, `time`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Time)) - } - } + r.EncodeString("") } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[1] { - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Status)) - } - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, "") - } + z.EncWriteArrayElem() + if yyq2[2] { + r.EncodeString(string(x.Detail)) } else { - if yyq2[1] { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"status\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, `status`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Status)) - } - } + r.EncodeString("") } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[2] { - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Detail)) - } - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, "") - } - } else { - if yyq2[2] { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"detail\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, `detail`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Detail)) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[3] { - if x.Result == nil { - r.EncodeNil() - } else { - if false { - } else { - z.F.EncSliceIntfV(x.Result, e) - } - } - } else { + z.EncWriteArrayElem() + if yyq2[3] { + if x.Result == nil { r.EncodeNil() - } + } else { + z.F.EncSliceIntfV(x.Result, e) + } // end block: if x.Result slice == nil } else { - if yyq2[3] { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"result\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, `result`) - } - r.WriteMapElemValue() - if x.Result == nil { - r.EncodeNil() - } else { - if false { - } else { - z.F.EncSliceIntfV(x.Result, e) - } - } + r.EncodeNil() + } + z.EncWriteArrayEnd() + } else { + var yynn2 int + for _, b := range yyq2 { + if b { + yynn2++ } } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncWriteMapStart(yynn2) + yynn2 = 0 + if yyq2[0] { + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"time\"") + } else { + r.EncodeString(`time`) + } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Time)) } + if yyq2[1] { + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"status\"") + } else { + r.EncodeString(`status`) + } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Status)) + } + if yyq2[2] { + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"detail\"") + } else { + r.EncodeString(`detail`) + } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Detail)) + } + if yyq2[3] { + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"result\"") + } else { + r.EncodeString(`result`) + } + z.EncWriteMapElemValue() + if x.Result == nil { + r.EncodeNil() + } else { + z.F.EncSliceIntfV(x.Result, e) + } // end block: if x.Result slice == nil + } + z.EncWriteMapEnd() } } } func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7751 + var h codecSelfer4653 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7751 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7751 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil4653 { + *(x) = Response{} + } else if yyct2 == codecSelferValueTypeMap4653 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7751) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray4653 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct4653) } } func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7751 + var h codecSelfer4653 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -230,50 +186,30 @@ func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "time": - if r.TryDecodeAsNil() { - x.Time = "" - } else { - x.Time = (string)(r.DecodeString()) - } + x.Time = (string)(string(r.DecodeStringAsBytes())) case "status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - x.Status = (string)(r.DecodeString()) - } + x.Status = (string)(string(r.DecodeStringAsBytes())) case "detail": - if r.TryDecodeAsNil() { - x.Detail = "" - } else { - x.Detail = (string)(r.DecodeString()) - } + x.Detail = (string)(string(r.DecodeStringAsBytes())) case "result": - if r.TryDecodeAsNil() { - x.Result = nil - } else { - if false { - } else { - z.F.DecSliceIntfX(&x.Result, d) - } - } + z.F.DecSliceIntfX(&x.Result, d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7751 + var h codecSelfer4653 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj9 int @@ -283,241 +219,174 @@ func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Time = "" - } else { - x.Time = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Time = (string)(string(r.DecodeStringAsBytes())) yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Status = "" - } else { - x.Status = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Status = (string)(string(r.DecodeStringAsBytes())) yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Detail = "" - } else { - x.Detail = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Detail = (string)(string(r.DecodeStringAsBytes())) yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Result = nil - } else { - if false { - } else { - z.F.DecSliceIntfX(&x.Result, d) - } - } + z.DecReadArrayElem() + z.F.DecSliceIntfX(&x.Result, d) for { yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } - r.ReadArrayEnd() } func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7751 + var h codecSelfer4653 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyq2 = [3]bool{ // should field at this index be written? + x.Query != "", // Query + x.Action != "", // Action + x.Result != nil, // Result + } + _ = yyq2 + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + if yyq2[0] { + r.EncodeString(string(x.Query)) + } else { + r.EncodeString("") + } + z.EncWriteArrayElem() + if yyq2[1] { + r.EncodeString(string(x.Action)) + } else { + r.EncodeString("") + } + z.EncWriteArrayElem() + if yyq2[2] { + z.EncFallback(x.Result) + } else { + r.EncodeNil() + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - var yyq2 = [3]bool{ // should field at this index be written? - x.Query != "", // Query - x.Action != "", // Action - x.Result != nil, // Result - } - _ = yyq2 - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) - } else { - var yynn2 int - for _, b := range yyq2 { - if b { - yynn2++ - } + var yynn2 int + for _, b := range yyq2 { + if b { + yynn2++ } - r.WriteMapStart(yynn2) - yynn2 = 0 } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[0] { - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Query)) - } + z.EncWriteMapStart(yynn2) + yynn2 = 0 + if yyq2[0] { + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"query\"") } else { - r.EncodeStringEnc(codecSelferCcUTF87751, "") - } - } else { - if yyq2[0] { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"query\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, `query`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Query)) - } + r.EncodeString(`query`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Query)) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[1] { - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Action)) - } + if yyq2[1] { + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"action\"") } else { - r.EncodeStringEnc(codecSelferCcUTF87751, "") - } - } else { - if yyq2[1] { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"action\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, `action`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, string(x.Action)) - } + r.EncodeString(`action`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Action)) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[2] { - if x.Result == nil { - r.EncodeNil() - } else { - if false { - } else { - z.EncFallback(x.Result) - } - } + if yyq2[2] { + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"result\"") } else { - r.EncodeNil() - } - } else { - if yyq2[2] { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"result\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF87751, `result`) - } - r.WriteMapElemValue() - if x.Result == nil { - r.EncodeNil() - } else { - if false { - } else { - z.EncFallback(x.Result) - } - } + r.EncodeString(`result`) } + z.EncWriteMapElemValue() + z.EncFallback(x.Result) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapEnd() } } } func (x *Dispatch) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7751 + var h codecSelfer4653 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7751 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7751 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil4653 { + *(x) = Dispatch{} + } else if yyct2 == codecSelferValueTypeMap4653 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7751) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray4653 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct4653) } } func (x *Dispatch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7751 + var h codecSelfer4653 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -527,44 +396,28 @@ func (x *Dispatch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "query": - if r.TryDecodeAsNil() { - x.Query = "" - } else { - x.Query = (string)(r.DecodeString()) - } + x.Query = (string)(string(r.DecodeStringAsBytes())) case "action": - if r.TryDecodeAsNil() { - x.Action = "" - } else { - x.Action = (string)(r.DecodeString()) - } + x.Action = (string)(string(r.DecodeStringAsBytes())) case "result": - if r.TryDecodeAsNil() { - x.Result = nil - } else { - if false { - } else { - z.DecFallback(&x.Result, true) - } - } + z.DecFallback(&x.Result, true) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Dispatch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7751 + var h codecSelfer4653 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj8 int @@ -574,65 +427,49 @@ func (x *Dispatch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Query = "" - } else { - x.Query = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Query = (string)(string(r.DecodeStringAsBytes())) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Action = "" - } else { - x.Action = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Action = (string)(string(r.DecodeStringAsBytes())) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Result = nil - } else { - if false { - } else { - z.DecFallback(&x.Result, true) - } - } + z.DecReadArrayElem() + z.DecFallback(&x.Result, true) for { yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - r.ReadArrayEnd() } diff --git a/db/db.go b/db/db.go index 82c78728..b4d25265 100644 --- a/db/db.go +++ b/db/db.go @@ -25,15 +25,12 @@ import ( "github.com/abcum/fibre" "github.com/abcum/surreal/cnf" "github.com/abcum/surreal/kvs" - "github.com/abcum/surreal/log" "github.com/abcum/surreal/sql" "github.com/abcum/surreal/util/data" _ "github.com/abcum/surreal/kvs/rixxdb" ) -var db *kvs.DS - var KV string var NIL string @@ -61,28 +58,18 @@ func init() { // Setup sets up the connection with the data layer func Setup(opts *cnf.Options) (err error) { - - log.WithPrefix("db").Infof("Starting database") - KV = cnf.Settings.DB.Base - - db, err = kvs.New(opts) - return } // Exit shuts down the connection with the data layer -func Exit() (err error) { - - log.WithPrefix("db").Infof("Gracefully shutting down database") - +func Exit(opts *cnf.Options) (err error) { sockets.Range(func(key, val interface{}) bool { id, so := key.(string), val.(*socket) deregister(so.fibre, id)() return true }) - - return db.Close() + return } @@ -92,21 +79,14 @@ func Exit() (err error) { func Sync(rw interface{}) (err error) { switch v := rw.(type) { case io.Reader: - return db.Import(v) + return kvs.Import(v) case io.Writer: - return db.Export(v) + return kvs.Export(v) default: return nil } } -// Begin begins a new read / write transaction -// with the underlying database, and returns -// the transaction, or any error which occured. -func Begin(rw bool) (txn kvs.TX, err error) { - return db.Begin(context.Background(), rw) -} - // Export saves all database operations to a writer. // This can be used to save a database snapshot // to a secondary file or stream. @@ -157,19 +137,11 @@ func Process(fib *fibre.Context, ast *sql.Query, vars map[string]interface{}) (o vars = make(map[string]interface{}) } - // Ensure that we have a unique id assigned - // to this fibre connection, as we need it - // to detect unique websocket notifications. - - if fib.Get(ctxKeyId) == nil { - fib.Set(ctxKeyId, "background") - } - // Get the unique id for this connection // so that we can assign it to the context // and detect any websocket notifications. - id := fib.Get(ctxKeyId).(string) + id := fib.Uniq() // Assign the authentication data to the // context so that we can log the auth kind diff --git a/db/db_test.go b/db/db_test.go index 02167336..2d646405 100644 --- a/db/db_test.go +++ b/db/db_test.go @@ -19,6 +19,7 @@ import ( "github.com/abcum/fibre" "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" "github.com/abcum/surreal/util/uuid" ) @@ -37,6 +38,8 @@ func setupDB(workers int) { cnf.Settings.DB.Base = "surreal" workerCount = workers + kvs.Setup(cnf.Settings) + Setup(cnf.Settings) } diff --git a/db/define.go b/db/define.go index 65706adb..1fb71744 100644 --- a/db/define.go +++ b/db/define.go @@ -33,7 +33,7 @@ func (e *executor) executeDefineNamespace(ctx context.Context, ast *sql.DefineNa // Save the namespace definition nkey := &keys.NS{KV: KV, NS: ast.Name.VA} - _, err = e.dbo.Put(ctx, 0, nkey.Encode(), ast.Encode()) + _, err = e.tx.Put(ctx, 0, nkey.Encode(), ast.Encode()) return @@ -45,11 +45,11 @@ func (e *executor) executeDefineDatabase(ctx context.Context, ast *sql.DefineDat return nil, err } - e.dbo.AddNS(ctx, e.ns) + e.tx.AddNS(ctx, e.ns) // Save the database definition dkey := &keys.DB{KV: KV, NS: e.ns, DB: ast.Name.VA} - _, err = e.dbo.Put(ctx, 0, dkey.Encode(), ast.Encode()) + _, err = e.tx.Put(ctx, 0, dkey.Encode(), ast.Encode()) return @@ -73,11 +73,11 @@ func (e *executor) executeDefineLogin(ctx context.Context, ast *sql.DefineLoginS return nil, err } - e.dbo.AddNS(ctx, e.ns) + e.tx.AddNS(ctx, e.ns) // Save the login definition ukey := &keys.NU{KV: KV, NS: e.ns, US: ast.User.VA} - _, err = e.dbo.Put(ctx, 0, ukey.Encode(), ast.Encode()) + _, err = e.tx.Put(ctx, 0, ukey.Encode(), ast.Encode()) case sql.DATABASE: @@ -85,11 +85,11 @@ func (e *executor) executeDefineLogin(ctx context.Context, ast *sql.DefineLoginS return nil, err } - e.dbo.AddDB(ctx, e.ns, e.db) + e.tx.AddDB(ctx, e.ns, e.db) // Save the login definition ukey := &keys.DU{KV: KV, NS: e.ns, DB: e.db, US: ast.User.VA} - _, err = e.dbo.Put(ctx, 0, ukey.Encode(), ast.Encode()) + _, err = e.tx.Put(ctx, 0, ukey.Encode(), ast.Encode()) } @@ -106,11 +106,11 @@ func (e *executor) executeDefineToken(ctx context.Context, ast *sql.DefineTokenS return nil, err } - e.dbo.AddNS(ctx, e.ns) + e.tx.AddNS(ctx, e.ns) // Save the token definition tkey := &keys.NT{KV: KV, NS: e.ns, TK: ast.Name.VA} - _, err = e.dbo.Put(ctx, 0, tkey.Encode(), ast.Encode()) + _, err = e.tx.Put(ctx, 0, tkey.Encode(), ast.Encode()) case sql.DATABASE: @@ -118,11 +118,11 @@ func (e *executor) executeDefineToken(ctx context.Context, ast *sql.DefineTokenS return nil, err } - e.dbo.AddDB(ctx, e.ns, e.db) + e.tx.AddDB(ctx, e.ns, e.db) // Save the token definition tkey := &keys.DT{KV: KV, NS: e.ns, DB: e.db, TK: ast.Name.VA} - _, err = e.dbo.Put(ctx, 0, tkey.Encode(), ast.Encode()) + _, err = e.tx.Put(ctx, 0, tkey.Encode(), ast.Encode()) case sql.SCOPE: @@ -130,11 +130,11 @@ func (e *executor) executeDefineToken(ctx context.Context, ast *sql.DefineTokenS return nil, err } - e.dbo.AddDB(ctx, e.ns, e.db) + e.tx.AddDB(ctx, e.ns, e.db) // Save the token definition tkey := &keys.ST{KV: KV, NS: e.ns, DB: e.db, SC: ast.What.VA, TK: ast.Name.VA} - _, err = e.dbo.Put(ctx, 0, tkey.Encode(), ast.Encode()) + _, err = e.tx.Put(ctx, 0, tkey.Encode(), ast.Encode()) } @@ -150,11 +150,11 @@ func (e *executor) executeDefineScope(ctx context.Context, ast *sql.DefineScopeS ast.Code = rand.New(128) - e.dbo.AddDB(ctx, e.ns, e.db) + e.tx.AddDB(ctx, e.ns, e.db) // Remove the scope definition skey := &keys.SC{KV: KV, NS: e.ns, DB: e.db, SC: ast.Name.VA} - _, err = e.dbo.Put(ctx, 0, skey.Encode(), ast.Encode()) + _, err = e.tx.Put(ctx, 0, skey.Encode(), ast.Encode()) return @@ -168,11 +168,11 @@ func (e *executor) executeDefineEvent(ctx context.Context, ast *sql.DefineEventS for _, TB := range ast.What { - e.dbo.AddTB(ctx, e.ns, e.db, TB.TB) + e.tx.AddTB(ctx, e.ns, e.db, TB.TB) // Remove the event definition ekey := &keys.EV{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB, EV: ast.Name.VA} - if _, err = e.dbo.Put(ctx, 0, ekey.Encode(), ast.Encode()); err != nil { + if _, err = e.tx.Put(ctx, 0, ekey.Encode(), ast.Encode()); err != nil { return nil, err } @@ -190,11 +190,11 @@ func (e *executor) executeDefineField(ctx context.Context, ast *sql.DefineFieldS for _, TB := range ast.What { - e.dbo.AddTB(ctx, e.ns, e.db, TB.TB) + e.tx.AddTB(ctx, e.ns, e.db, TB.TB) // Save the field definition fkey := &keys.FD{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB, FD: ast.Name.VA} - if _, err = e.dbo.Put(ctx, 0, fkey.Encode(), ast.Encode()); err != nil { + if _, err = e.tx.Put(ctx, 0, fkey.Encode(), ast.Encode()); err != nil { return nil, err } @@ -212,17 +212,17 @@ func (e *executor) executeDefineIndex(ctx context.Context, ast *sql.DefineIndexS for _, TB := range ast.What { - e.dbo.AddTB(ctx, e.ns, e.db, TB.TB) + e.tx.AddTB(ctx, e.ns, e.db, TB.TB) // Save the index definition ikey := &keys.IX{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB, IX: ast.Name.VA} - if _, err = e.dbo.Put(ctx, 0, ikey.Encode(), ast.Encode()); err != nil { + if _, err = e.tx.Put(ctx, 0, ikey.Encode(), ast.Encode()); err != nil { return nil, err } // Remove the index resource data dkey := &keys.Index{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB, IX: ast.Name.VA, FD: keys.Ignore} - if _, err = e.dbo.ClrP(ctx, dkey.Encode(), 0); err != nil { + if _, err = e.tx.ClrP(ctx, dkey.Encode(), 0); err != nil { return nil, err } @@ -245,7 +245,7 @@ func (e *executor) executeDefineTable(ctx context.Context, ast *sql.DefineTableS return nil, err } - e.dbo.AddDB(ctx, e.ns, e.db) + e.tx.AddDB(ctx, e.ns, e.db) for _, TB := range ast.What { @@ -253,7 +253,7 @@ func (e *executor) executeDefineTable(ctx context.Context, ast *sql.DefineTableS // Save the table definition tkey := &keys.TB{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB} - if _, err = e.dbo.Put(ctx, 0, tkey.Encode(), ast.Encode()); err != nil { + if _, err = e.tx.Put(ctx, 0, tkey.Encode(), ast.Encode()); err != nil { return nil, err } @@ -261,7 +261,7 @@ func (e *executor) executeDefineTable(ctx context.Context, ast *sql.DefineTableS // Remove the table resource data dkey := &keys.Table{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB} - if _, err = e.dbo.ClrP(ctx, dkey.Encode(), 0); err != nil { + if _, err = e.tx.ClrP(ctx, dkey.Encode(), 0); err != nil { return nil, err } @@ -269,7 +269,7 @@ func (e *executor) executeDefineTable(ctx context.Context, ast *sql.DefineTableS // Save the foreign table definition tkey := &keys.FT{KV: KV, NS: e.ns, DB: e.db, TB: FT.TB, FT: TB.TB} - if _, err = e.dbo.Put(ctx, 0, tkey.Encode(), ast.Encode()); err != nil { + if _, err = e.tx.Put(ctx, 0, tkey.Encode(), ast.Encode()); err != nil { return nil, err } diff --git a/db/document.go b/db/document.go index e795ac32..0ab173a9 100644 --- a/db/document.go +++ b/db/document.go @@ -111,8 +111,13 @@ func (d *document) init(ctx context.Context) (err error) { if d.key == nil && d.val != nil { d.enc = d.val.Key() - d.key = &keys.Thing{} - d.key.Decode(d.enc) + if val, ok := keyCache.Get(d.val.Key()); ok { + d.key = val.(*keys.Thing) + } else { + d.key = &keys.Thing{} + d.key.Decode(d.enc) + keyCache.Set(d.val.Key(), d.key, 0) + } } return @@ -150,7 +155,7 @@ func (d *document) setup(ctx context.Context) (err error) { if d.key != nil && d.val == nil { d.enc = d.key.Encode() - d.val, err = d.i.e.dbo.Get(ctx, d.i.versn, d.enc) + d.val, err = d.i.e.tx.Get(ctx, d.i.versn, d.enc) if err != nil { return } @@ -163,9 +168,8 @@ func (d *document) setup(ctx context.Context) (err error) { // maniuplate the virtual document. if d.doc != nil { - enc := d.doc.Encode() - d.initial = data.New().Decode(enc) - d.current = data.New().Decode(enc) + d.initial = d.doc + d.current = d.doc } // The requested record has been loaded @@ -186,8 +190,14 @@ func (d *document) setup(ctx context.Context) (err error) { // processing any record changes. if d.doc == nil && d.val != nil && d.val.Exi() == true { - d.initial = data.New().Decode(d.val.Val()) - d.current = data.New().Decode(d.val.Val()) + if val, ok := valCache.Get(d.val.Val()); ok { + d.initial = val.(*data.Doc) + d.current = d.initial + } else { + d.initial = data.New().Decode(d.val.Val()) + d.current = d.initial + valCache.Set(d.val.Val(), d.current, 0) + } } // Finally if we are dealing with a record @@ -219,7 +229,7 @@ func (d *document) shouldDrop(ctx context.Context) (bool, error) { // that the table should drop // writes, and if so, then return. - tb, err := d.i.e.dbo.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) + tb, err := d.i.e.tx.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return false, err } @@ -234,7 +244,7 @@ func (d *document) shouldVersn(ctx context.Context) (bool, error) { // that the table should keep // all document versions. - tb, err := d.i.e.dbo.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) + tb, err := d.i.e.tx.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return false, err } @@ -267,9 +277,9 @@ func (d *document) storeThing(ctx context.Context) (err error) { if ok, err := d.shouldVersn(ctx); err != nil { return err } else if ok == true { - _, err = d.i.e.dbo.Put(ctx, d.i.e.time, d.enc, d.current.Encode()) + _, err = d.i.e.tx.Put(ctx, d.i.e.time.UnixNano(), d.enc, d.current.Encode()) } else if ok == false { - _, err = d.i.e.dbo.Put(ctx, 0, d.enc, d.current.Encode()) + _, err = d.i.e.tx.Put(ctx, 0, d.enc, d.current.Encode()) } return @@ -293,9 +303,9 @@ func (d *document) purgeThing(ctx context.Context) (err error) { if ok, err := d.shouldVersn(ctx); err != nil { return err } else if ok == true { - _, err = d.i.e.dbo.Put(ctx, d.i.e.time, d.enc, nil) + _, err = d.i.e.tx.Put(ctx, d.i.e.time.UnixNano(), d.enc, nil) } else if ok == false { - _, err = d.i.e.dbo.Clr(ctx, d.enc) + _, err = d.i.e.tx.Clr(ctx, d.enc) } return @@ -327,7 +337,7 @@ func (d *document) storeIndex(ctx context.Context) (err error) { // for this table, loop through // them, and compute the changes. - ixs, err := d.i.e.dbo.AllIX(ctx, d.key.NS, d.key.DB, d.key.TB) + ixs, err := d.i.e.tx.AllIX(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } @@ -345,12 +355,12 @@ func (d *document) storeIndex(ctx context.Context) (err error) { for _, f := range del { enfd := data.Consume(f).Encode() didx := &keys.Index{KV: d.key.KV, NS: d.key.NS, DB: d.key.DB, TB: d.key.TB, IX: ix.Name.VA, FD: enfd} - d.i.e.dbo.DelC(ctx, d.i.e.time, didx.Encode(), d.id.Bytes()) + d.i.e.tx.DelC(ctx, d.i.e.time.UnixNano(), didx.Encode(), d.id.Bytes()) } for _, f := range add { enfd := data.Consume(f).Encode() aidx := &keys.Index{KV: d.key.KV, NS: d.key.NS, DB: d.key.DB, TB: d.key.TB, IX: ix.Name.VA, FD: enfd} - if _, err = d.i.e.dbo.PutC(ctx, 0, aidx.Encode(), d.id.Bytes(), nil); err != nil { + if _, err = d.i.e.tx.PutC(ctx, 0, aidx.Encode(), d.id.Bytes(), nil); err != nil { return &IndexError{tb: d.key.TB, name: ix.Name, cols: ix.Cols, vals: f} } } @@ -360,12 +370,12 @@ func (d *document) storeIndex(ctx context.Context) (err error) { for _, f := range del { enfd := data.Consume(f).Encode() didx := &keys.Point{KV: d.key.KV, NS: d.key.NS, DB: d.key.DB, TB: d.key.TB, IX: ix.Name.VA, FD: enfd, ID: d.key.ID} - d.i.e.dbo.DelC(ctx, d.i.e.time, didx.Encode(), d.id.Bytes()) + d.i.e.tx.DelC(ctx, d.i.e.time.UnixNano(), didx.Encode(), d.id.Bytes()) } for _, f := range add { enfd := data.Consume(f).Encode() aidx := &keys.Point{KV: d.key.KV, NS: d.key.NS, DB: d.key.DB, TB: d.key.TB, IX: ix.Name.VA, FD: enfd, ID: d.key.ID} - if _, err = d.i.e.dbo.PutC(ctx, 0, aidx.Encode(), d.id.Bytes(), nil); err != nil { + if _, err = d.i.e.tx.PutC(ctx, 0, aidx.Encode(), d.id.Bytes(), nil); err != nil { return &IndexError{tb: d.key.TB, name: ix.Name, cols: ix.Cols, vals: f} } } @@ -402,7 +412,7 @@ func (d *document) purgeIndex(ctx context.Context) (err error) { // for this table, loop through // them, and compute the changes. - ixs, err := d.i.e.dbo.AllIX(ctx, d.key.NS, d.key.DB, d.key.TB) + ixs, err := d.i.e.tx.AllIX(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } @@ -414,14 +424,14 @@ func (d *document) purgeIndex(ctx context.Context) (err error) { if ix.Uniq == true { for _, v := range del { key := &keys.Index{KV: d.key.KV, NS: d.key.NS, DB: d.key.DB, TB: d.key.TB, IX: ix.Name.VA, FD: v} - d.i.e.dbo.DelC(ctx, 0, key.Encode(), d.id.Bytes()) + d.i.e.tx.DelC(ctx, 0, key.Encode(), d.id.Bytes()) } } if ix.Uniq == false { for _, v := range del { key := &keys.Point{KV: d.key.KV, NS: d.key.NS, DB: d.key.DB, TB: d.key.TB, IX: ix.Name.VA, FD: v, ID: d.key.ID} - d.i.e.dbo.DelC(ctx, 0, key.Encode(), d.id.Bytes()) + d.i.e.tx.DelC(ctx, 0, key.Encode(), d.id.Bytes()) } } diff --git a/db/event.go b/db/event.go index 19921e4c..736b6947 100644 --- a/db/event.go +++ b/db/event.go @@ -47,7 +47,7 @@ func (d *document) event(ctx context.Context, met method) (err error) { // for this table, loop through // them, and compute the events. - evs, err := d.i.e.dbo.AllEV(ctx, d.key.NS, d.key.DB, d.key.TB) + evs, err := d.i.e.tx.AllEV(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } diff --git a/db/executor.go b/db/executor.go index cfe7decb..d5497585 100644 --- a/db/executor.go +++ b/db/executor.go @@ -15,6 +15,7 @@ package db import ( + "sync" "time" "context" @@ -23,20 +24,22 @@ import ( "github.com/abcum/surreal/kvs" "github.com/abcum/surreal/log" - "github.com/abcum/surreal/mem" "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/txn" ) type executor struct { - id string - ns string - db string - dbo *mem.Cache - time int64 - lock *mutex - opts *options - send chan *Response - cache *cache + id string + ns string + db string + tx *txn.TX + err error + buf []*Response + time time.Time + lock *mutex + opts *options + data sync.Map + send chan *Response } func newExecutor(id, ns, db string) (e *executor) { @@ -47,14 +50,14 @@ func newExecutor(id, ns, db string) (e *executor) { e.ns = ns e.db = db - e.dbo = mem.New() + e.err = nil + + e.data = sync.Map{} e.opts = newOptions() e.send = make(chan *Response) - e.cache = new(cache) - return } @@ -78,8 +81,8 @@ func (e *executor) execute(ctx context.Context, ast *sql.Query) { // query set, then cancel the transaction. defer func() { - if e.dbo.TX != nil { - e.dbo.Cancel() + if e.tx != nil { + e.tx.Cancel() clear(e.id) } }() @@ -115,18 +118,15 @@ func (e *executor) execute(ctx context.Context, ast *sql.Query) { func (e *executor) conduct(ctx context.Context, stm sql.Statement) { - var err error - var now time.Time var rsp *Response - var buf []*Response var res []interface{} // If we are not inside a global transaction // then reset the error to nil so that the // next statement is not ignored. - if e.dbo.TX == nil { - err, now = nil, time.Now() + if e.tx == nil { + e.err = nil } // Check to see if the current statement is @@ -135,20 +135,22 @@ func (e *executor) conduct(ctx context.Context, stm sql.Statement) { switch stm.(type) { case *sql.BeginStatement: - e.lock = new(mutex) - err = e.begin(ctx, true) + e.err = e.begin(ctx, true) + if e.err != nil { + clear(e.id) + } return case *sql.CancelStatement: - err, buf = e.cancel(buf, err, e.send) - if err != nil { + e.err = e.cancel(e.send) + if e.err != nil { clear(e.id) } else { clear(e.id) } return case *sql.CommitStatement: - err, buf = e.commit(buf, err, e.send) - if err != nil { + e.err = e.commit(e.send) + if e.err != nil { clear(e.id) } else { flush(e.id) @@ -160,16 +162,18 @@ func (e *executor) conduct(ctx context.Context, stm sql.Statement) { // a global transaction, then ignore all // subsequent statements in the transaction. - if err == nil { - res, err = e.operate(ctx, stm) + if e.err == nil { + res, e.err = e.operate(ctx, stm) } else { - res, err = []interface{}{}, errQueryNotExecuted + res, e.err = []interface{}{}, errQueryNotExecuted } + // Generate the response + rsp = &Response{ - Time: time.Since(now).String(), - Status: status(err), - Detail: detail(err), + Time: time.Since(e.time).String(), + Status: status(e.err), + Detail: detail(e.err), Result: append([]interface{}{}, res...), } @@ -177,7 +181,7 @@ func (e *executor) conduct(ctx context.Context, stm sql.Statement) { // query duration time, and mark it as // an error if the query failed. - switch err.(type) { + switch e.err.(type) { default: if log.IsDebug() { log.WithPrefix(logKeySql).WithFields(map[string]interface{}{ @@ -186,7 +190,7 @@ func (e *executor) conduct(ctx context.Context, stm sql.Statement) { logKeyDB: e.db, logKeyKind: ctx.Value(ctxKeyKind), logKeyVars: ctx.Value(ctxKeyVars), - logKeyTime: time.Since(now).String(), + logKeyTime: time.Since(e.time).String(), }).Debugln(stm) } case error: @@ -197,8 +201,8 @@ func (e *executor) conduct(ctx context.Context, stm sql.Statement) { logKeyDB: e.db, logKeyKind: ctx.Value(ctxKeyKind), logKeyVars: ctx.Value(ctxKeyVars), - logKeyTime: time.Since(now).String(), - logKeyError: detail(err), + logKeyTime: time.Since(e.time).String(), + logKeyError: detail(e.err), }).Errorln(stm) } } @@ -207,7 +211,7 @@ func (e *executor) conduct(ctx context.Context, stm sql.Statement) { // then we can output the statement response // immediately to the channel. - if e.dbo.TX == nil { + if e.tx == nil { e.send <- rsp } @@ -215,12 +219,16 @@ func (e *executor) conduct(ctx context.Context, stm sql.Statement) { // must buffer the responses for output at // the end of the transaction. - if e.dbo.TX != nil { + if e.tx != nil { switch stm.(type) { case *sql.ReturnStatement: - buf = groupd(buf, rsp) + for i := len(e.buf) - 1; i >= 0; i-- { + e.buf[len(e.buf)-1] = nil + e.buf = e.buf[:len(e.buf)-1] + } + e.buf = append(e.buf, rsp) default: - buf = append(buf, rsp) + e.buf = append(e.buf, rsp) } } @@ -236,15 +244,13 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf // then grab a new transaction, ensuring that // it is closed at the end. - if e.dbo.TX == nil { - - loc = true + if e.tx == nil { switch stm := stm.(type) { case sql.WriteableStatement: - trw = stm.Writeable() + loc, trw = true, stm.Writeable() default: - trw = false + loc, trw = true, false } err = e.begin(ctx, trw) @@ -252,13 +258,10 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf return } - defer e.dbo.Cancel() - - // Let's create a new mutex for just this - // local transaction, so we can track any - // recursive queries and race errors. - - e.lock = new(mutex) + defer func() { + e.tx.Cancel() + e.tx = nil + }() } @@ -278,12 +281,6 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf } } - // Specify a new time for the current executor - // iteration, so that all subqueries and async - // events are saved with the same version time. - - e.time = time.Now().UnixNano() - // Execute the defined statement, receiving the // result set, and any errors which occured // while processing the query. @@ -385,8 +382,7 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf case <-ctx.Done(): - e.dbo.Cancel() - e.dbo.Reset() + e.tx.Cancel() clear(e.id) default: @@ -395,20 +391,14 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf // current statement, then commit or cancel // depending on the result error. - if loc && e.dbo.Closed() == false { - - // As this is a local transaction then - // make sure we reset the transaction - // context. - - defer e.dbo.Reset() + if loc { // If there was an error with the query // then clear the queued changes and // return immediately. if err != nil { - e.dbo.Cancel() + e.tx.Cancel() clear(e.id) return } @@ -418,13 +408,13 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf // Cancel or Commit, returning any errors. if !trw { - if err = e.dbo.Cancel(); err != nil { + if err = e.tx.Cancel(); err != nil { clear(e.id) } else { clear(e.id) } } else { - if err = e.dbo.Commit(); err != nil { + if err = e.tx.Commit(); err != nil { clear(e.id) } else { flush(e.id) @@ -440,55 +430,51 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf } func (e *executor) begin(ctx context.Context, rw bool) (err error) { - if e.dbo.TX == nil { - e.dbo = mem.New() - e.dbo.TX, err = db.Begin(ctx, rw) - } + e.tx, err = txn.New(ctx, rw) + e.time = time.Now() + e.lock = new(mutex) return } -func (e *executor) cancel(buf []*Response, err error, chn chan<- *Response) (error, []*Response) { +func (e *executor) cancel(chn chan<- *Response) (err error) { - defer e.dbo.Reset() + defer func() { + e.tx.Cancel() + e.tx = nil + e.buf = nil + e.err = nil + }() - if e.dbo.TX == nil { - return nil, buf - } - - err = e.dbo.Cancel() - - for _, v := range buf { + for _, v := range e.buf { + v.Time = time.Since(e.time).String() v.Status = "ERR" v.Result = []interface{}{} v.Detail = "Transaction cancelled" chn <- v } - for i := len(buf) - 1; i >= 0; i-- { - buf[len(buf)-1] = nil - buf = buf[:len(buf)-1] - } - - return err, buf + return } -func (e *executor) commit(buf []*Response, err error, chn chan<- *Response) (error, []*Response) { +func (e *executor) commit(chn chan<- *Response) (err error) { - defer e.dbo.Reset() + defer func() { + e.tx.Cancel() + e.tx = nil + e.buf = nil + e.err = nil + }() - if e.dbo.TX == nil { - return nil, buf - } - - if err != nil { - err = e.dbo.Cancel() + if e.err != nil { + err = e.tx.Cancel() } else { - err = e.dbo.Commit() + err = e.tx.Commit() } - for _, v := range buf { + for _, v := range e.buf { if err != nil { + v.Time = time.Since(e.time).String() v.Status = "ERR" v.Result = []interface{}{} v.Detail = "Transaction failed: " + err.Error() @@ -496,12 +482,7 @@ func (e *executor) commit(buf []*Response, err error, chn chan<- *Response) (err chn <- v } - for i := len(buf) - 1; i >= 0; i-- { - buf[len(buf)-1] = nil - buf = buf[:len(buf)-1] - } - - return err, buf + return } @@ -536,11 +517,3 @@ func detail(e error) (s string) { return err.Error() } } - -func groupd(buf []*Response, rsp *Response) []*Response { - for i := len(buf) - 1; i >= 0; i-- { - buf[len(buf)-1] = nil - buf = buf[:len(buf)-1] - } - return append(buf, rsp) -} diff --git a/db/export.go b/db/export.go index dd974543..7227ecd9 100644 --- a/db/export.go +++ b/db/export.go @@ -56,7 +56,7 @@ func export(c *fibre.Context, NS, DB string) error { // Tokens // ------------------------------ - dts, err := exe.dbo.AllDT(ctx, NS, DB) + dts, err := exe.tx.AllDT(ctx, NS, DB) if err != nil { return err } @@ -73,7 +73,7 @@ func export(c *fibre.Context, NS, DB string) error { // Logins // ------------------------------ - dus, err := exe.dbo.AllDU(ctx, NS, DB) + dus, err := exe.tx.AllDU(ctx, NS, DB) if err != nil { return err } @@ -90,7 +90,7 @@ func export(c *fibre.Context, NS, DB string) error { // Scopes // ------------------------------ - scs, err := exe.dbo.AllSC(ctx, NS, DB) + scs, err := exe.tx.AllSC(ctx, NS, DB) if err != nil { return err } @@ -109,7 +109,7 @@ func export(c *fibre.Context, NS, DB string) error { // Tokens // ------------------------------ - sct, err := exe.dbo.AllST(ctx, NS, DB, v.Name.VA) + sct, err := exe.tx.AllST(ctx, NS, DB, v.Name.VA) if err != nil { return err } @@ -130,7 +130,7 @@ func export(c *fibre.Context, NS, DB string) error { // Tables // ------------------------------ - tbs, err := exe.dbo.AllTB(ctx, NS, DB) + tbs, err := exe.tx.AllTB(ctx, NS, DB) if err != nil { return err } @@ -161,7 +161,7 @@ func export(c *fibre.Context, NS, DB string) error { // Events // ------------------------------ - evs, err := exe.dbo.AllEV(ctx, NS, DB, TB.Name.VA) + evs, err := exe.tx.AllEV(ctx, NS, DB, TB.Name.VA) if err != nil { return err } @@ -177,7 +177,7 @@ func export(c *fibre.Context, NS, DB string) error { // Fields // ------------------------------ - fds, err := exe.dbo.AllFD(ctx, NS, DB, TB.Name.VA) + fds, err := exe.tx.AllFD(ctx, NS, DB, TB.Name.VA) if err != nil { return err } @@ -193,7 +193,7 @@ func export(c *fibre.Context, NS, DB string) error { // Indexes // ------------------------------ - ixs, err := exe.dbo.AllIX(ctx, NS, DB, TB.Name.VA) + ixs, err := exe.tx.AllIX(ctx, NS, DB, TB.Name.VA) if err != nil { return err } @@ -236,9 +236,9 @@ TB: var vls []kvs.KV if TB.Vers { - vls, err = exe.dbo.AllR(ctx, min, max, 10000) + vls, err = exe.tx.AllR(ctx, min, max, 10000) } else { - vls, err = exe.dbo.GetR(ctx, math.MaxInt64, min, max, 10000) + vls, err = exe.tx.GetR(ctx, math.MaxInt64, min, max, 10000) } if err != nil { diff --git a/db/fetch.go b/db/fetch.go index aa5c7ca1..db729369 100644 --- a/db/fetch.go +++ b/db/fetch.go @@ -16,7 +16,6 @@ package db import ( "context" - "fmt" "math" "reflect" "regexp" @@ -28,7 +27,6 @@ import ( "golang.org/x/text/search" "github.com/abcum/surreal/cnf" - "github.com/abcum/surreal/log" "github.com/abcum/surreal/sql" "github.com/abcum/surreal/util/data" "github.com/abcum/surreal/util/deep" @@ -344,10 +342,8 @@ func (e *executor) fetchThing(ctx context.Context, val *sql.Thing, doc *data.Doc return nil, err } - key := fmt.Sprintf("%d %s", ver, val) - - if e.cache.Has(key) { - return e.cache.Get(key), nil + if val, ok := e.data.Load(val.String()); ok { + return val, nil } stm := &sql.SelectStatement{ @@ -356,21 +352,13 @@ func (e *executor) fetchThing(ctx context.Context, val *sql.Thing, doc *data.Doc Version: sql.Expr(ver), } - if log.IsTrace() { - log.WithPrefix(logKeyExe).WithFields(map[string]interface{}{ - logKeyId: e.id, - logKeyNS: e.ns, - logKeyDB: e.db, - }).Traceln(stm) - } - res, err := e.executeSelect(ctx, stm) if err != nil { return nil, err } if len(res) > 0 { - e.cache.Put(key, res[0]) + e.data.Store(val.String(), res[0]) return res[0], nil } @@ -378,47 +366,6 @@ func (e *executor) fetchThing(ctx context.Context, val *sql.Thing, doc *data.Doc } -func (e *executor) fetchArray(ctx context.Context, val []interface{}, doc *data.Doc) (interface{}, error) { - - ver, err := e.fetchVersion(ctx, ctx.Value(ctxKeyVersion)) - if err != nil { - return nil, err - } - - key := fmt.Sprintf("%d %s", ver, val) - - if e.cache.Has(key) { - return e.cache.Get(key), nil - } - - stm := &sql.SelectStatement{ - Expr: []*sql.Field{{Expr: &sql.All{}}}, - What: []sql.Expr{val}, - Version: sql.Expr(ver), - } - - if log.IsTrace() { - log.WithPrefix(logKeyExe).WithFields(map[string]interface{}{ - logKeyId: e.id, - logKeyNS: e.ns, - logKeyDB: e.db, - }).Traceln(stm) - } - - res, err := e.executeSelect(ctx, stm) - if err != nil { - return nil, err - } - - if len(res) > 0 { - e.cache.Put(key, res) - return res, nil - } - - return nil, nil - -} - func (e *executor) fetchPerms(ctx context.Context, val sql.Expr, tb *sql.Ident) error { // If the table does exist we reset the diff --git a/db/gen.go b/db/gen.go index 9fde5d5f..a7d04222 100644 --- a/db/gen.go +++ b/db/gen.go @@ -14,5 +14,5 @@ package db -//go:generate go get -u github.com/ugorji/go/codec/codecgen@v0.0.0-20181204163529-d75b2dcb6bc8 +//go:generate go get -u github.com/ugorji/go/codec/codecgen //go:generate codecgen -o db.gen.go db.go diff --git a/db/info.go b/db/info.go index 483f93e0..550ee7db 100644 --- a/db/info.go +++ b/db/info.go @@ -47,7 +47,7 @@ func (e *executor) executeInfoKV(ctx context.Context, ast *sql.InfoStatement) (o return nil, err } - ns, err := e.dbo.AllNS(ctx) + ns, err := e.tx.AllNS(ctx) if err != nil { return nil, err } @@ -71,17 +71,17 @@ func (e *executor) executeInfoNS(ctx context.Context, ast *sql.InfoStatement) (o return nil, err } - db, err := e.dbo.AllDB(ctx, e.ns) + db, err := e.tx.AllDB(ctx, e.ns) if err != nil { return nil, err } - nt, err := e.dbo.AllNT(ctx, e.ns) + nt, err := e.tx.AllNT(ctx, e.ns) if err != nil { return nil, err } - nu, err := e.dbo.AllNU(ctx, e.ns) + nu, err := e.tx.AllNU(ctx, e.ns) if err != nil { return nil, err } @@ -117,22 +117,22 @@ func (e *executor) executeInfoDB(ctx context.Context, ast *sql.InfoStatement) (o return nil, err } - tb, err := e.dbo.AllTB(ctx, e.ns, e.db) + tb, err := e.tx.AllTB(ctx, e.ns, e.db) if err != nil { return nil, err } - dt, err := e.dbo.AllDT(ctx, e.ns, e.db) + dt, err := e.tx.AllDT(ctx, e.ns, e.db) if err != nil { return nil, err } - du, err := e.dbo.AllDU(ctx, e.ns, e.db) + du, err := e.tx.AllDU(ctx, e.ns, e.db) if err != nil { return nil, err } - sc, err := e.dbo.AllSC(ctx, e.ns, e.db) + sc, err := e.tx.AllSC(ctx, e.ns, e.db) if err != nil { return nil, err } @@ -174,7 +174,7 @@ func (e *executor) executeInfoSC(ctx context.Context, ast *sql.InfoStatement) (o return nil, err } - st, err := e.dbo.AllST(ctx, e.ns, e.db, ast.What.VA) + st, err := e.tx.AllST(ctx, e.ns, e.db, ast.What.VA) if err != nil { return nil, err } @@ -198,22 +198,27 @@ func (e *executor) executeInfoTB(ctx context.Context, ast *sql.InfoStatement) (o return nil, err } - ev, err := e.dbo.AllEV(ctx, e.ns, e.db, ast.What.VA) + ev, err := e.tx.AllEV(ctx, e.ns, e.db, ast.What.VA) if err != nil { return nil, err } - fd, err := e.dbo.AllFD(ctx, e.ns, e.db, ast.What.VA) + fd, err := e.tx.AllFD(ctx, e.ns, e.db, ast.What.VA) if err != nil { return nil, err } - ix, err := e.dbo.AllIX(ctx, e.ns, e.db, ast.What.VA) + ix, err := e.tx.AllIX(ctx, e.ns, e.db, ast.What.VA) if err != nil { return nil, err } - ft, err := e.dbo.AllFT(ctx, e.ns, e.db, ast.What.VA) + ft, err := e.tx.AllFT(ctx, e.ns, e.db, ast.What.VA) + if err != nil { + return nil, err + } + + lv, err := e.tx.AllLV(ctx, e.ns, e.db, ast.What.VA) if err != nil { return nil, err } @@ -240,10 +245,16 @@ func (e *executor) executeInfoTB(ctx context.Context, ast *sql.InfoStatement) (o table[v.Name.VA] = v.String() } + lives := make(map[string]interface{}) + for _, v := range lv { + lives[v.ID] = v.String() + } + res.Set(event, "event") res.Set(field, "field") res.Set(index, "index") res.Set(table, "table") + res.Set(lives, "lives") return []interface{}{res.Data()}, nil diff --git a/db/iterator.go b/db/iterator.go index 9f029449..e89b4f88 100644 --- a/db/iterator.go +++ b/db/iterator.go @@ -375,7 +375,7 @@ func (i *iterator) processPerms(ctx context.Context, nsv, dbv, tbv string) { // we need to fetch the table to ensure // that the table is not a view table. - tb, i.err = i.e.dbo.AddTB(ctx, nsv, dbv, tbv) + tb, i.err = i.e.tx.AddTB(ctx, nsv, dbv, tbv) if i.err != nil { close(i.stop) return @@ -425,7 +425,7 @@ func (i *iterator) processPerms(ctx context.Context, nsv, dbv, tbv string) { // otherwise, the scoped authentication // request can not do anything. - _, i.err = i.e.dbo.GetNS(ctx, nsv) + _, i.err = i.e.tx.GetNS(ctx, nsv) if i.err != nil { close(i.stop) return @@ -435,7 +435,7 @@ func (i *iterator) processPerms(ctx context.Context, nsv, dbv, tbv string) { // otherwise, the scoped authentication // request can not do anything. - _, i.err = i.e.dbo.GetDB(ctx, nsv, dbv) + _, i.err = i.e.tx.GetDB(ctx, nsv, dbv) if i.err != nil { close(i.stop) return @@ -445,7 +445,7 @@ func (i *iterator) processPerms(ctx context.Context, nsv, dbv, tbv string) { // otherwise, the scoped authentication // request can not do anything. - tb, i.err = i.e.dbo.GetTB(ctx, nsv, dbv, tbv) + tb, i.err = i.e.tx.GetTB(ctx, nsv, dbv, tbv) if i.err != nil { close(i.stop) return @@ -549,7 +549,7 @@ func (i *iterator) processTable(ctx context.Context, key *keys.Table) { return } - vals, i.err = i.e.dbo.GetR(ctx, i.versn, min, max, 10000) + vals, i.err = i.e.tx.GetR(ctx, i.versn, min, max, 10000) if i.err != nil { close(i.stop) return diff --git a/db/lives.go b/db/lives.go index 20f3b857..5f25032a 100644 --- a/db/lives.go +++ b/db/lives.go @@ -42,7 +42,7 @@ func (d *document) lives(ctx context.Context, when method) (err error) { // specified for this table, and // update values which have changed. - lvs, err := d.i.e.dbo.AllLV(ctx, d.key.NS, d.key.DB, d.key.TB) + lvs, err := d.i.e.tx.AllLV(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } diff --git a/db/merge.go b/db/merge.go index 0e500d16..c6517e8c 100644 --- a/db/merge.go +++ b/db/merge.go @@ -35,6 +35,10 @@ var main = map[string]struct{}{ func (d *document) merge(ctx context.Context, met method, data sql.Expr) (err error) { + if err = d.defDoc(ctx, met); err != nil { + return + } + if err = d.defFld(ctx, met); err != nil { return } @@ -80,6 +84,14 @@ func (d *document) merge(ctx context.Context, met method, data sql.Expr) (err er } +func (d *document) defDoc(ctx context.Context, met method) (err error) { + + d.current = d.current.Copy() + + return + +} + func (d *document) defFld(ctx context.Context, met method) (err error) { switch d.i.vir { @@ -100,7 +112,7 @@ func (d *document) defFld(ctx context.Context, met method) (err error) { func (d *document) delFld(ctx context.Context, met method) (err error) { - tb, err := d.i.e.dbo.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) + tb, err := d.i.e.tx.GetTB(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } @@ -111,7 +123,7 @@ func (d *document) delFld(ctx context.Context, met method) (err error) { // Get the defined fields - fds, err := d.i.e.dbo.AllFD(ctx, d.key.NS, d.key.DB, d.key.TB) + fds, err := d.i.e.tx.AllFD(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } @@ -269,7 +281,7 @@ func (d *document) mrgSet(ctx context.Context, met method, expr *sql.DataExpress func (d *document) mrgFld(ctx context.Context, met method) (err error) { - fds, err := d.i.e.dbo.AllFD(ctx, d.key.NS, d.key.DB, d.key.TB) + fds, err := d.i.e.tx.AllFD(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } diff --git a/db/perms.go b/db/perms.go index c8848939..11bf0ad1 100644 --- a/db/perms.go +++ b/db/perms.go @@ -45,7 +45,7 @@ func (d *document) perms(ctx context.Context, doc *data.Doc) (err error) { // check if the permissions allow us // to view each field. - fds, err := d.i.e.dbo.AllFD(ctx, d.key.NS, d.key.DB, d.key.TB) + fds, err := d.i.e.tx.AllFD(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } diff --git a/db/remove.go b/db/remove.go index 228f2356..d12eddcf 100644 --- a/db/remove.go +++ b/db/remove.go @@ -28,15 +28,15 @@ func (e *executor) executeRemoveNamespace(ctx context.Context, ast *sql.RemoveNa return nil, err } - e.dbo.DelNS(ast.Name.VA) + e.tx.DelNS(ast.Name.VA) // Remove the namespace definition nkey := &keys.NS{KV: KV, NS: ast.Name.VA} - _, err = e.dbo.Clr(ctx, nkey.Encode()) + _, err = e.tx.Clr(ctx, nkey.Encode()) // Remove the namespace resource data akey := &keys.Namespace{KV: KV, NS: ast.Name.VA} - _, err = e.dbo.ClrP(ctx, akey.Encode(), 0) + _, err = e.tx.ClrP(ctx, akey.Encode(), 0) return @@ -48,15 +48,15 @@ func (e *executor) executeRemoveDatabase(ctx context.Context, ast *sql.RemoveDat return nil, err } - e.dbo.DelDB(e.ns, ast.Name.VA) + e.tx.DelDB(e.ns, ast.Name.VA) // Remove the database definition dkey := &keys.DB{KV: KV, NS: e.ns, DB: ast.Name.VA} - _, err = e.dbo.Clr(ctx, dkey.Encode()) + _, err = e.tx.Clr(ctx, dkey.Encode()) // Remove the database resource data akey := &keys.Database{KV: KV, NS: e.ns, DB: ast.Name.VA} - _, err = e.dbo.ClrP(ctx, akey.Encode(), 0) + _, err = e.tx.ClrP(ctx, akey.Encode(), 0) return @@ -73,7 +73,7 @@ func (e *executor) executeRemoveLogin(ctx context.Context, ast *sql.RemoveLoginS // Remove the login definition ukey := &keys.NU{KV: KV, NS: e.ns, US: ast.User.VA} - _, err = e.dbo.ClrP(ctx, ukey.Encode(), 0) + _, err = e.tx.ClrP(ctx, ukey.Encode(), 0) case sql.DATABASE: @@ -83,7 +83,7 @@ func (e *executor) executeRemoveLogin(ctx context.Context, ast *sql.RemoveLoginS // Remove the login definition ukey := &keys.DU{KV: KV, NS: e.ns, DB: e.db, US: ast.User.VA} - _, err = e.dbo.ClrP(ctx, ukey.Encode(), 0) + _, err = e.tx.ClrP(ctx, ukey.Encode(), 0) } @@ -106,7 +106,7 @@ func (e *executor) executeRemoveToken(ctx context.Context, ast *sql.RemoveTokenS // Remove the token definition tkey := &keys.NT{KV: KV, NS: e.ns, TK: ast.Name.VA} - _, err = e.dbo.ClrP(ctx, tkey.Encode(), 0) + _, err = e.tx.ClrP(ctx, tkey.Encode(), 0) case sql.DATABASE: @@ -116,7 +116,7 @@ func (e *executor) executeRemoveToken(ctx context.Context, ast *sql.RemoveTokenS // Remove the token definition tkey := &keys.DT{KV: KV, NS: e.ns, DB: e.db, TK: ast.Name.VA} - _, err = e.dbo.ClrP(ctx, tkey.Encode(), 0) + _, err = e.tx.ClrP(ctx, tkey.Encode(), 0) case sql.SCOPE: @@ -126,7 +126,7 @@ func (e *executor) executeRemoveToken(ctx context.Context, ast *sql.RemoveTokenS // Remove the token definition tkey := &keys.ST{KV: KV, NS: e.ns, DB: e.db, SC: ast.What.VA, TK: ast.Name.VA} - _, err = e.dbo.ClrP(ctx, tkey.Encode(), 0) + _, err = e.tx.ClrP(ctx, tkey.Encode(), 0) } @@ -142,7 +142,7 @@ func (e *executor) executeRemoveScope(ctx context.Context, ast *sql.RemoveScopeS // Remove the scope definition skey := &keys.SC{KV: KV, NS: e.ns, DB: e.db, SC: ast.Name.VA} - _, err = e.dbo.ClrP(ctx, skey.Encode(), 0) + _, err = e.tx.ClrP(ctx, skey.Encode(), 0) return @@ -156,11 +156,11 @@ func (e *executor) executeRemoveEvent(ctx context.Context, ast *sql.RemoveEventS for _, TB := range ast.What { - e.dbo.DelEV(e.ns, e.db, TB.TB, ast.Name.VA) + e.tx.DelEV(e.ns, e.db, TB.TB, ast.Name.VA) // Remove the event definition ekey := &keys.EV{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB, EV: ast.Name.VA} - if _, err = e.dbo.ClrP(ctx, ekey.Encode(), 0); err != nil { + if _, err = e.tx.ClrP(ctx, ekey.Encode(), 0); err != nil { return nil, err } @@ -178,11 +178,11 @@ func (e *executor) executeRemoveField(ctx context.Context, ast *sql.RemoveFieldS for _, TB := range ast.What { - e.dbo.DelFD(e.ns, e.db, TB.TB, ast.Name.VA) + e.tx.DelFD(e.ns, e.db, TB.TB, ast.Name.VA) // Remove the field definition fkey := &keys.FD{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB, FD: ast.Name.VA} - if _, err = e.dbo.ClrP(ctx, fkey.Encode(), 0); err != nil { + if _, err = e.tx.ClrP(ctx, fkey.Encode(), 0); err != nil { return nil, err } @@ -200,17 +200,17 @@ func (e *executor) executeRemoveIndex(ctx context.Context, ast *sql.RemoveIndexS for _, TB := range ast.What { - e.dbo.DelIX(e.ns, e.db, TB.TB, ast.Name.VA) + e.tx.DelIX(e.ns, e.db, TB.TB, ast.Name.VA) // Remove the index definition ikey := &keys.IX{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB, IX: ast.Name.VA} - if _, err = e.dbo.ClrP(ctx, ikey.Encode(), 0); err != nil { + if _, err = e.tx.ClrP(ctx, ikey.Encode(), 0); err != nil { return nil, err } // Remove the index resource data dkey := &keys.Index{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB, IX: ast.Name.VA, FD: keys.Ignore} - if _, err = e.dbo.ClrP(ctx, dkey.Encode(), 0); err != nil { + if _, err = e.tx.ClrP(ctx, dkey.Encode(), 0); err != nil { return nil, err } @@ -228,23 +228,23 @@ func (e *executor) executeRemoveTable(ctx context.Context, ast *sql.RemoveTableS for _, TB := range ast.What { - e.dbo.DelTB(e.ns, e.db, TB.TB) + e.tx.DelTB(e.ns, e.db, TB.TB) - tb, err := e.dbo.GetTB(ctx, e.ns, e.db, TB.TB) + tb, err := e.tx.GetTB(ctx, e.ns, e.db, TB.TB) if err != nil { return nil, err } // Remove the table definition tkey := &keys.TB{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB} - _, err = e.dbo.Clr(ctx, tkey.Encode()) + _, err = e.tx.Clr(ctx, tkey.Encode()) if err != nil { return nil, err } // Remove the table resource data dkey := &keys.Table{KV: KV, NS: e.ns, DB: e.db, TB: TB.TB} - _, err = e.dbo.ClrP(ctx, dkey.Encode(), 0) + _, err = e.tx.ClrP(ctx, dkey.Encode(), 0) if err != nil { return nil, err } @@ -255,7 +255,7 @@ func (e *executor) executeRemoveTable(ctx context.Context, ast *sql.RemoveTableS // Remove the foreign table definition tkey := &keys.FT{KV: KV, NS: e.ns, DB: e.db, TB: FT.TB, FT: TB.TB} - if _, err = e.dbo.ClrP(ctx, tkey.Encode(), 0); err != nil { + if _, err = e.tx.ClrP(ctx, tkey.Encode(), 0); err != nil { return nil, err } diff --git a/db/socket.go b/db/socket.go index f6135b1e..aa88a627 100644 --- a/db/socket.go +++ b/db/socket.go @@ -23,6 +23,7 @@ import ( "github.com/abcum/fibre" "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" "github.com/abcum/surreal/sql" "github.com/abcum/surreal/util/data" "github.com/abcum/surreal/util/keys" @@ -150,7 +151,7 @@ func (s *socket) check(e *executor, ctx context.Context, ns, db, tb string) (err // otherwise, the scoped authentication // request can not do anything. - _, err = e.dbo.GetNS(ctx, ns) + _, err = e.tx.GetNS(ctx, ns) if err != nil { return err } @@ -159,7 +160,7 @@ func (s *socket) check(e *executor, ctx context.Context, ns, db, tb string) (err // otherwise, the scoped authentication // request can not do anything. - _, err = e.dbo.GetDB(ctx, ns, db) + _, err = e.tx.GetDB(ctx, ns, db) if err != nil { return err } @@ -168,7 +169,7 @@ func (s *socket) check(e *executor, ctx context.Context, ns, db, tb string) (err // otherwise, the scoped authentication // request can not do anything. - tbv, err = e.dbo.GetTB(ctx, ns, db, tb) + tbv, err = e.tx.GetTB(ctx, ns, db, tb) if err != nil { return err } @@ -192,7 +193,7 @@ func (s *socket) deregister(id string) { ctx := context.Background() - txn, _ := db.Begin(ctx, true) + txn, _ := kvs.Begin(ctx, true) defer txn.Commit() @@ -261,14 +262,14 @@ func (s *socket) executeLive(e *executor, ctx context.Context, stm *sql.LiveStat case *sql.Table: key := &keys.LV{KV: KV, NS: stm.NS, DB: stm.DB, TB: what.TB, LV: stm.ID} - if _, err = e.dbo.Put(ctx, 0, key.Encode(), stm.Encode()); err != nil { + if _, err = e.tx.Put(ctx, 0, key.Encode(), stm.Encode()); err != nil { return nil, err } case *sql.Ident: key := &keys.LV{KV: KV, NS: stm.NS, DB: stm.DB, TB: what.VA, LV: stm.ID} - if _, err = e.dbo.Put(ctx, 0, key.Encode(), stm.Encode()); err != nil { + if _, err = e.tx.Put(ctx, 0, key.Encode(), stm.Encode()); err != nil { return nil, err } @@ -320,11 +321,11 @@ func (s *socket) executeKill(e *executor, ctx context.Context, stm *sql.KillStat case *sql.Table: key := &keys.LV{KV: KV, NS: qry.NS, DB: qry.DB, TB: what.TB, LV: qry.ID} - _, err = e.dbo.Clr(ctx, key.Encode()) + _, err = e.tx.Clr(ctx, key.Encode()) case *sql.Ident: key := &keys.LV{KV: KV, NS: qry.NS, DB: qry.DB, TB: what.VA, LV: qry.ID} - _, err = e.dbo.Clr(ctx, key.Encode()) + _, err = e.tx.Clr(ctx, key.Encode()) } diff --git a/db/table.go b/db/table.go index a3edc53b..4a8b6da0 100644 --- a/db/table.go +++ b/db/table.go @@ -51,7 +51,7 @@ func (d *document) table(ctx context.Context, when method) (err error) { // specified for this table, and // update values which have changed. - fts, err := d.i.e.dbo.AllFT(ctx, d.key.NS, d.key.DB, d.key.TB) + fts, err := d.i.e.tx.AllFT(ctx, d.key.NS, d.key.DB, d.key.TB) if err != nil { return err } diff --git a/go.mod b/go.mod index 6c8a2563..03d09667 100644 --- a/go.mod +++ b/go.mod @@ -2,11 +2,14 @@ module github.com/abcum/surreal go 1.13 +replace github.com/abcum/fibre => /Users/tobie/Repositories/fibre + require ( github.com/abcum/bump v0.0.0-20190929092354-46a9c9dbf9ab github.com/abcum/cork v0.0.0-20190929093632-f45e788b8f1b github.com/abcum/fibre v0.0.0-20191003170635-45f18bd55f9a github.com/abcum/rixxdb v0.0.0-20191008002349-42eb662df538 + github.com/dgraph-io/ristretto v0.0.0-20191114170855-99d1bbbf28e6 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/elithrar/simple-scrypt v1.3.0 github.com/gorilla/websocket v1.4.1 @@ -21,7 +24,8 @@ require ( github.com/sirupsen/logrus v1.4.2 github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 github.com/spf13/cobra v0.0.5 - github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 + github.com/stackimpact/stackimpact-go v2.3.10+incompatible + github.com/ugorji/go/codec v1.1.7 golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 golang.org/x/text v0.3.2 diff --git a/go.sum b/go.sum index 532c756a..ada5de25 100644 --- a/go.sum +++ b/go.sum @@ -1,21 +1,27 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/abcum/bump v0.0.0-20190929092354-46a9c9dbf9ab h1:S7Bp0inII96zGek8nipouocogy9xjMcJuDUKIb/+jkw= github.com/abcum/bump v0.0.0-20190929092354-46a9c9dbf9ab/go.mod h1:nhz3F2Uy1ra958EB0V4uR1WjTdLmpiznz7sqMdRBi7A= github.com/abcum/cork v0.0.0-20190929093632-f45e788b8f1b h1:R/fzwNDZALJjuU9zjtJ8z1YTp03xkePY7ITjfaTppbA= github.com/abcum/cork v0.0.0-20190929093632-f45e788b8f1b/go.mod h1:t54olPax+YxSe0VIdutFPcEupQhkg7Y3QA8FzxNe6Po= -github.com/abcum/fibre v0.0.0-20191003170635-45f18bd55f9a h1:w7vwArRjHlY/Kvi4f86O0nhQxSbC1ovnZ+Yvla7aUjI= -github.com/abcum/fibre v0.0.0-20191003170635-45f18bd55f9a/go.mod h1:CPo8U5dmWBEajd6U7ozAQRp0b1zbuRkaAyZJneBZ63g= github.com/abcum/rixxdb v0.0.0-20191008002349-42eb662df538 h1:y1Qj5WC/jAYWRQt/z00RCUB7XgFm7K5ej7S6lqE9whA= github.com/abcum/rixxdb v0.0.0-20191008002349-42eb662df538/go.mod h1:6lIALuvT453ADA/5AFRXGLDNcc3sqIvt4ISaKyPeTLg= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgraph-io/ristretto v0.0.0-20191114170855-99d1bbbf28e6 h1:liDEMz8LbPxfuI8e/noprwccn6gZGv2rN1AgucbxjHs= +github.com/dgraph-io/ristretto v0.0.0-20191114170855-99d1bbbf28e6/go.mod h1:T40EBc7CJke8TkpiYfGGKAeFjSaxuFXhuXRyumBd6RE= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/elithrar/simple-scrypt v1.3.0 h1:KIlOlxdoQf9JWKl5lMAJ28SY2URB0XTRDn2TckyzAZg= github.com/elithrar/simple-scrypt v1.3.0/go.mod h1:U2XQRI95XHY0St410VE3UjT7vuKb1qPwrl/EJwEqnZo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -32,11 +38,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -47,9 +48,11 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyex github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/newrelic/go-agent v2.13.0+incompatible h1:Dl6m75MHAzfB0kicv9GiLxzQatRjTLUAdrnYyoT8s4M= -github.com/newrelic/go-agent v2.13.0+incompatible/go.mod h1:a8Fv1b/fYhFSReoTU6HDkTYIMZeSVNffmoS726Y0LzQ= +github.com/ory/graceful v0.1.1 h1:zx+8tDObLPrG+7Tc8jKYlXsqWnLtOQA1IZ/FAAKHMXU= +github.com/ory/graceful v0.1.1/go.mod h1:zqu70l95WrKHF4AZ6tXHvAqAvpY6M7g6ttaAVcMm7KU= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.3.0 h1:OQIvuDgm00gWVWGTf4m4mCt6W1/0YqU7Ntg0mySWgaI= github.com/pkg/profile v1.3.0/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -61,6 +64,8 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/segmentio/ksuid v1.0.2 h1:9yBfKyw4ECGTdALaF09Snw3sLJmYIX6AbPJrAy6MrDc= +github.com/segmentio/ksuid v1.0.2/go.mod h1:BXuJDr2byAiHuQaQtSKoXh1J0YmUDurywOXgB2w+OSU= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= @@ -69,6 +74,8 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykE github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8= github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= @@ -77,11 +84,17 @@ github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb6 github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/stackimpact/stackimpact-go v2.3.10+incompatible h1:ySvQuFaxqpFEMq/IZElqt1nvYgWMoRpkQ9VAzZoDpJ0= +github.com/stackimpact/stackimpact-go v2.3.10+incompatible/go.mod h1:Seecan0KCHJ0D5MYjIhx9TddZ0p53TicSrE9sBdovcU= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 h1:3SVOIvH7Ae1KRYyQWRjXWJEA9sS/c/pjvH++55Gr648= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -89,7 +102,6 @@ golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc h1:c0o/qxkaO2LF5t6fQrT4b5 golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 h1:2mqDk8w/o6UmeUCu5Qiq2y7iMf6anbx+YA8d1JFoFrs= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -104,9 +116,6 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384 h1:TFlARGu6Czu1z7q93HTxcP1P+/ZFC/IKythI5RzrnRg= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/tylerb/graceful.v1 v1.2.15 h1:1JmOyhKqAyX3BgTXMI84LwT6FOJ4tP2N9e2kwTCM0nQ= -gopkg.in/tylerb/graceful.v1 v1.2.15/go.mod h1:yBhekWvR20ACXVObSSdD3u6S9DeSylanL2PAbAC/uJ8= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/kvs/ds.go b/kvs/ds.go index 524ee8e3..3721b1a3 100644 --- a/kvs/ds.go +++ b/kvs/ds.go @@ -22,8 +22,6 @@ import ( "github.com/abcum/surreal/cnf" ) -var stores = make(map[string]func(*cnf.Options) (DB, error)) - // DB represents a backing datastore. type DS struct { db DB @@ -80,10 +78,3 @@ func (ds *DS) Export(w io.Writer) (err error) { func (ds *DS) Close() (err error) { return ds.db.Close() } - -// Register registers a new database type with -// the kvs package, enabling it's use as a -// backing datastore within SurrealDB. -func Register(name string, constructor func(*cnf.Options) (DB, error)) { - stores[name] = constructor -} diff --git a/kvs/main.go b/kvs/main.go new file mode 100644 index 00000000..4cad1863 --- /dev/null +++ b/kvs/main.go @@ -0,0 +1,77 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package kvs + +import ( + "context" + "io" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/log" +) + +var ds *DS + +// Stores the different backend implementations +var stores = make(map[string]func(*cnf.Options) (DB, error)) + +// Setup sets up the connection with the data layer +func Setup(opts *cnf.Options) (err error) { + log.WithPrefix("kvs").Infof("Starting kvs storage at %s", opts.DB.Path) + ds, err = New(opts) + log.WithPrefix("kvs").Infof("Started kvs storage at %s", opts.DB.Path) + return +} + +// Exit shuts down the connection with the data layer +func Exit(opts *cnf.Options) (err error) { + log.WithPrefix("kvs").Infof("Shutting down kvs storage at %s", opts.DB.Path) + return ds.Close() +} + +// Begin begins a new read / write transaction +// with the underlying database, and returns +// the transaction, or any error which occured. +func Begin(ctx context.Context, writable bool) (txn TX, err error) { + return ds.db.Begin(ctx, writable) +} + +// Import loads database operations from a reader. +// This can be used to playback a database snapshot +// into an already running database. +func Import(r io.Reader) (err error) { + return ds.db.Import(r) +} + +// Export saves all database operations to a writer. +// This can be used to save a database snapshot +// to a secondary file or stream. +func Export(w io.Writer) (err error) { + return ds.db.Export(w) +} + +// Close closes the underlying rixxdb / dendrodb +// database connection, enabling the underlying +// database to clean up remainging transactions. +func Close() (err error) { + return ds.db.Close() +} + +// Register registers a new database type with +// the kvs package, enabling it's use as a +// backing datastore within SurrealDB. +func Register(name string, constructor func(*cnf.Options) (DB, error)) { + stores[name] = constructor +} diff --git a/kvs/tx.go b/kvs/tx.go index a1868a87..302d429e 100644 --- a/kvs/tx.go +++ b/kvs/tx.go @@ -30,6 +30,9 @@ type TX interface { ClrP(context.Context, []byte, uint64) ([]KV, error) ClrR(context.Context, []byte, []byte, uint64) ([]KV, error) + Put(context.Context, int64, []byte, []byte) (KV, error) + PutC(context.Context, int64, []byte, []byte, []byte) (KV, error) + Get(context.Context, int64, []byte) (KV, error) GetP(context.Context, int64, []byte, uint64) ([]KV, error) GetR(context.Context, int64, []byte, []byte, uint64) ([]KV, error) @@ -38,7 +41,4 @@ type TX interface { DelC(context.Context, int64, []byte, []byte) (KV, error) DelP(context.Context, int64, []byte, uint64) ([]KV, error) DelR(context.Context, int64, []byte, []byte, uint64) ([]KV, error) - - Put(context.Context, int64, []byte, []byte) (KV, error) - PutC(context.Context, int64, []byte, []byte, []byte) (KV, error) } diff --git a/main.go b/main.go index e001694d..145f2d0d 100644 --- a/main.go +++ b/main.go @@ -22,6 +22,8 @@ import ( "github.com/pkg/profile" "github.com/abcum/surreal/cli" + + "github.com/stackimpact/stackimpact-go" ) func main() { @@ -35,6 +37,11 @@ func main() { defer profile.Start(profile.BlockProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop() } + stackimpact.Start(stackimpact.Options{ + AgentKey: "3326cc7b7c7de70cf2a29f8320c42c31149f39da", + AppName: "Surreal", + }) + runtime.GOMAXPROCS(runtime.NumCPU()) cli.Init() diff --git a/mem/mem.go b/mem/mem.go deleted file mode 100644 index d7ded929..00000000 --- a/mem/mem.go +++ /dev/null @@ -1,936 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mem - -import ( - "sync" - - "context" - - "github.com/abcum/surreal/cnf" - "github.com/abcum/surreal/kvs" - "github.com/abcum/surreal/sql" - "github.com/abcum/surreal/util/keys" -) - -type Cache struct { - kvs.TX - lock sync.RWMutex - data map[string]interface{} - locks struct { - ns sync.RWMutex - db sync.RWMutex - tb sync.RWMutex - } -} - -func New() (c *Cache) { - return &Cache{ - data: make(map[string]interface{}), - } -} - -func NewWithTX(tx kvs.TX) (c *Cache) { - return &Cache{ - TX: tx, - data: make(map[string]interface{}), - } -} - -func (c *Cache) Reset() { - c.TX = nil -} - -func (c *Cache) get(key keys.Key) (out interface{}, ok bool) { - c.lock.RLock() - out, ok = c.data[key.String()] - c.lock.RUnlock() - return -} - -func (c *Cache) put(key keys.Key, val interface{}) { - c.lock.Lock() - c.data[key.String()] = val - c.lock.Unlock() -} - -func (c *Cache) del(key keys.Key) { - c.lock.Lock() - delete(c.data, key.String()) - c.lock.Unlock() -} - -// -------------------------------------------------- - -func (c *Cache) AllNS(ctx context.Context) (out []*sql.DefineNamespaceStatement, err error) { - - var kvs []kvs.KV - - c.locks.ns.RLock() - defer c.locks.ns.RUnlock() - - key := &keys.NS{KV: cnf.Settings.DB.Base, NS: keys.Ignore} - - if out, ok := c.get(key); ok { - return out.([]*sql.DefineNamespaceStatement), nil - } - - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineNamespaceStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - c.put(key, out) - - return - -} - -func (c *Cache) GetNS(ctx context.Context, ns string) (val *sql.DefineNamespaceStatement, err error) { - - var kv kvs.KV - - c.locks.ns.RLock() - defer c.locks.ns.RUnlock() - - key := &keys.NS{KV: cnf.Settings.DB.Base, NS: ns} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineNamespaceStatement), nil - } - - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorNSNotFound - } - - val = &sql.DefineNamespaceStatement{} - val.Decode(kv.Val()) - - c.put(key, val) - - return - -} - -func (c *Cache) AddNS(ctx context.Context, ns string) (val *sql.DefineNamespaceStatement, err error) { - - var kv kvs.KV - - c.locks.ns.Lock() - defer c.locks.ns.Unlock() - - key := &keys.NS{KV: cnf.Settings.DB.Base, NS: ns} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineNamespaceStatement), nil - } - - if kv, _ = c.TX.Get(ctx, 0, key.Encode()); kv.Exi() { - val = &sql.DefineNamespaceStatement{} - val.Decode(kv.Val()) - c.put(key, val) - return - } - - val = &sql.DefineNamespaceStatement{Name: sql.NewIdent(ns)} - c.TX.PutC(ctx, 0, key.Encode(), val.Encode(), nil) - - c.put(key, val) - - return - -} - -func (c *Cache) DelNS(ns string) { - - c.del(&keys.NS{KV: cnf.Settings.DB.Base, NS: keys.Ignore}) - - c.del(&keys.NS{KV: cnf.Settings.DB.Base, NS: ns}) - -} - -// -------------------------------------------------- - -func (c *Cache) AllNT(ctx context.Context, ns string) (out []*sql.DefineTokenStatement, err error) { - - var kvs []kvs.KV - - key := &keys.NT{KV: cnf.Settings.DB.Base, NS: ns, TK: keys.Ignore} - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineTokenStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - return - -} - -func (c *Cache) GetNT(ctx context.Context, ns, tk string) (val *sql.DefineTokenStatement, err error) { - - var kv kvs.KV - - key := &keys.NT{KV: cnf.Settings.DB.Base, NS: ns, TK: tk} - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorNTNotFound - } - - val = &sql.DefineTokenStatement{} - val.Decode(kv.Val()) - - return - -} - -// -------------------------------------------------- - -func (c *Cache) AllNU(ctx context.Context, ns string) (out []*sql.DefineLoginStatement, err error) { - - var kvs []kvs.KV - - key := &keys.NU{KV: cnf.Settings.DB.Base, NS: ns, US: keys.Ignore} - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineLoginStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - return - -} - -func (c *Cache) GetNU(ctx context.Context, ns, us string) (val *sql.DefineLoginStatement, err error) { - - var kv kvs.KV - - key := &keys.NU{KV: cnf.Settings.DB.Base, NS: ns, US: us} - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorNUNotFound - } - - val = &sql.DefineLoginStatement{} - val.Decode(kv.Val()) - - return - -} - -// -------------------------------------------------- - -func (c *Cache) AllDB(ctx context.Context, ns string) (out []*sql.DefineDatabaseStatement, err error) { - - var kvs []kvs.KV - - c.locks.db.RLock() - defer c.locks.db.RUnlock() - - key := &keys.DB{KV: cnf.Settings.DB.Base, NS: ns, DB: keys.Ignore} - - if out, ok := c.get(key); ok { - return out.([]*sql.DefineDatabaseStatement), nil - } - - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineDatabaseStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - c.put(key, out) - - return - -} - -func (c *Cache) GetDB(ctx context.Context, ns, db string) (val *sql.DefineDatabaseStatement, err error) { - - var kv kvs.KV - - c.locks.db.RLock() - defer c.locks.db.RUnlock() - - key := &keys.DB{KV: cnf.Settings.DB.Base, NS: ns, DB: db} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineDatabaseStatement), nil - } - - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorDBNotFound - } - - val = &sql.DefineDatabaseStatement{} - val.Decode(kv.Val()) - - c.put(key, val) - - return - -} - -func (c *Cache) AddDB(ctx context.Context, ns, db string) (val *sql.DefineDatabaseStatement, err error) { - - if _, err = c.AddNS(ctx, ns); err != nil { - return - } - - var kv kvs.KV - - c.locks.db.Lock() - defer c.locks.db.Unlock() - - key := &keys.DB{KV: cnf.Settings.DB.Base, NS: ns, DB: db} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineDatabaseStatement), nil - } - - if kv, _ = c.TX.Get(ctx, 0, key.Encode()); kv.Exi() { - val = &sql.DefineDatabaseStatement{} - val.Decode(kv.Val()) - c.put(key, val) - return - } - - val = &sql.DefineDatabaseStatement{Name: sql.NewIdent(db)} - c.TX.PutC(ctx, 0, key.Encode(), val.Encode(), nil) - - c.put(key, val) - - return - -} - -func (c *Cache) DelDB(ns, db string) { - - c.del(&keys.DB{KV: cnf.Settings.DB.Base, NS: ns, DB: keys.Ignore}) - - c.del(&keys.DB{KV: cnf.Settings.DB.Base, NS: ns, DB: db}) - -} - -// -------------------------------------------------- - -func (c *Cache) AllDT(ctx context.Context, ns, db string) (out []*sql.DefineTokenStatement, err error) { - - var kvs []kvs.KV - - key := &keys.DT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TK: keys.Ignore} - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineTokenStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - return - -} - -func (c *Cache) GetDT(ctx context.Context, ns, db, tk string) (val *sql.DefineTokenStatement, err error) { - - var kv kvs.KV - - key := &keys.DT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TK: tk} - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorDTNotFound - } - - val = &sql.DefineTokenStatement{} - val.Decode(kv.Val()) - - return - -} - -// -------------------------------------------------- - -func (c *Cache) AllDU(ctx context.Context, ns, db string) (out []*sql.DefineLoginStatement, err error) { - - var kvs []kvs.KV - - key := &keys.DU{KV: cnf.Settings.DB.Base, NS: ns, DB: db, US: keys.Ignore} - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineLoginStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - return - -} - -func (c *Cache) GetDU(ctx context.Context, ns, db, us string) (val *sql.DefineLoginStatement, err error) { - - var kv kvs.KV - - key := &keys.DU{KV: cnf.Settings.DB.Base, NS: ns, DB: db, US: us} - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorDUNotFound - } - - val = &sql.DefineLoginStatement{} - val.Decode(kv.Val()) - - return - -} - -// -------------------------------------------------- - -func (c *Cache) AllSC(ctx context.Context, ns, db string) (out []*sql.DefineScopeStatement, err error) { - - var kvs []kvs.KV - - key := &keys.SC{KV: cnf.Settings.DB.Base, NS: ns, DB: db, SC: keys.Ignore} - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineScopeStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - return - -} - -func (c *Cache) GetSC(ctx context.Context, ns, db, sc string) (val *sql.DefineScopeStatement, err error) { - - var kv kvs.KV - - key := &keys.SC{KV: cnf.Settings.DB.Base, NS: ns, DB: db, SC: sc} - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorSCNotFound - } - - val = &sql.DefineScopeStatement{} - val.Decode(kv.Val()) - - return - -} - -// -------------------------------------------------- - -func (c *Cache) AllST(ctx context.Context, ns, db, sc string) (out []*sql.DefineTokenStatement, err error) { - - var kvs []kvs.KV - - key := &keys.ST{KV: cnf.Settings.DB.Base, NS: ns, DB: db, SC: sc, TK: keys.Ignore} - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineTokenStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - return - -} - -func (c *Cache) GetST(ctx context.Context, ns, db, sc, tk string) (val *sql.DefineTokenStatement, err error) { - - var kv kvs.KV - - key := &keys.ST{KV: cnf.Settings.DB.Base, NS: ns, DB: db, SC: sc, TK: tk} - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorSTNotFound - } - - val = &sql.DefineTokenStatement{} - val.Decode(kv.Val()) - - return - -} - -// -------------------------------------------------- - -func (c *Cache) AllTB(ctx context.Context, ns, db string) (out []*sql.DefineTableStatement, err error) { - - var kvs []kvs.KV - - c.locks.tb.RLock() - defer c.locks.tb.RUnlock() - - key := &keys.TB{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: keys.Ignore} - - if out, ok := c.get(key); ok { - return out.([]*sql.DefineTableStatement), nil - } - - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineTableStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - c.put(key, out) - - return - -} - -func (c *Cache) GetTB(ctx context.Context, ns, db, tb string) (val *sql.DefineTableStatement, err error) { - - var kv kvs.KV - - c.locks.tb.RLock() - defer c.locks.tb.RUnlock() - - key := &keys.TB{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineTableStatement), nil - } - - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorTBNotFound - } - - val = &sql.DefineTableStatement{} - val.Decode(kv.Val()) - - c.put(key, val) - - return - -} - -func (c *Cache) AddTB(ctx context.Context, ns, db, tb string) (val *sql.DefineTableStatement, err error) { - - if _, err = c.AddDB(ctx, ns, db); err != nil { - return - } - - var kv kvs.KV - - c.locks.tb.Lock() - defer c.locks.tb.Unlock() - - key := &keys.TB{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineTableStatement), nil - } - - if kv, _ = c.TX.Get(ctx, 0, key.Encode()); kv.Exi() { - val = &sql.DefineTableStatement{} - val.Decode(kv.Val()) - c.put(key, val) - return - } - - val = &sql.DefineTableStatement{Name: sql.NewIdent(tb)} - c.TX.PutC(ctx, 0, key.Encode(), val.Encode(), nil) - - c.put(key, val) - - return - -} - -func (c *Cache) DelTB(ns, db, tb string) { - - c.del(&keys.TB{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: keys.Ignore}) - - c.del(&keys.TB{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb}) - -} - -// -------------------------------------------------- - -func (c *Cache) AllEV(ctx context.Context, ns, db, tb string) (out []*sql.DefineEventStatement, err error) { - - var kvs []kvs.KV - - key := &keys.EV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, EV: keys.Ignore} - - if out, ok := c.get(key); ok { - return out.([]*sql.DefineEventStatement), nil - } - - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineEventStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - c.put(key, out) - - return - -} - -func (c *Cache) GetEV(ctx context.Context, ns, db, tb, ev string) (val *sql.DefineEventStatement, err error) { - - var kv kvs.KV - - key := &keys.EV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, EV: ev} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineEventStatement), nil - } - - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorEVNotFound - } - - val = &sql.DefineEventStatement{} - val.Decode(kv.Val()) - - c.put(key, val) - - return - -} - -func (c *Cache) DelEV(ns, db, tb, ev string) { - - c.del(&keys.EV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, EV: keys.Ignore}) - - c.del(&keys.EV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, EV: ev}) - -} - -// -------------------------------------------------- - -func (c *Cache) AllFD(ctx context.Context, ns, db, tb string) (out []*sql.DefineFieldStatement, err error) { - - var kvs []kvs.KV - - key := &keys.FD{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FD: keys.Ignore} - - if out, ok := c.get(key); ok { - return out.([]*sql.DefineFieldStatement), nil - } - - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineFieldStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - c.put(key, out) - - return - -} - -func (c *Cache) GetFD(ctx context.Context, ns, db, tb, fd string) (val *sql.DefineFieldStatement, err error) { - - var kv kvs.KV - - key := &keys.FD{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FD: fd} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineFieldStatement), nil - } - - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorFDNotFound - } - - val = &sql.DefineFieldStatement{} - val.Decode(kv.Val()) - - c.put(key, val) - - return - -} - -func (c *Cache) DelFD(ns, db, tb, fd string) { - - c.del(&keys.FD{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FD: keys.Ignore}) - - c.del(&keys.FD{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FD: fd}) - -} - -// -------------------------------------------------- - -func (c *Cache) AllIX(ctx context.Context, ns, db, tb string) (out []*sql.DefineIndexStatement, err error) { - - var kvs []kvs.KV - - key := &keys.IX{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, IX: keys.Ignore} - - if out, ok := c.get(key); ok { - return out.([]*sql.DefineIndexStatement), nil - } - - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineIndexStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - c.put(key, out) - - return - -} - -func (c *Cache) GetIX(ctx context.Context, ns, db, tb, ix string) (val *sql.DefineIndexStatement, err error) { - - var kv kvs.KV - - key := &keys.IX{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, IX: ix} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineIndexStatement), nil - } - - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorIXNotFound - } - - val = &sql.DefineIndexStatement{} - val.Decode(kv.Val()) - - c.put(key, val) - - return - -} - -func (c *Cache) DelIX(ns, db, tb, ix string) { - - c.del(&keys.IX{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, IX: keys.Ignore}) - - c.del(&keys.IX{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, IX: ix}) - -} - -// -------------------------------------------------- - -func (c *Cache) AllFT(ctx context.Context, ns, db, tb string) (out []*sql.DefineTableStatement, err error) { - - var kvs []kvs.KV - - key := &keys.FT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FT: keys.Ignore} - - if out, ok := c.get(key); ok { - return out.([]*sql.DefineTableStatement), nil - } - - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.DefineTableStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - c.put(key, out) - - return - -} - -func (c *Cache) GetFT(ctx context.Context, ns, db, tb, ft string) (val *sql.DefineTableStatement, err error) { - - var kv kvs.KV - - key := &keys.FT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FT: ft} - - if out, ok := c.get(key); ok { - return out.(*sql.DefineTableStatement), nil - } - - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorFTNotFound - } - - val = &sql.DefineTableStatement{} - val.Decode(kv.Val()) - - c.put(key, val) - - return - -} - -func (c *Cache) DelFT(ns, db, tb, ft string) { - - c.del(&keys.FT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FT: keys.Ignore}) - - c.del(&keys.FT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FT: ft}) - -} - -// -------------------------------------------------- - -func (c *Cache) AllLV(ctx context.Context, ns, db, tb string) (out []*sql.LiveStatement, err error) { - - var kvs []kvs.KV - - key := &keys.LV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, LV: keys.Ignore} - - if out, ok := c.get(key); ok { - return out.([]*sql.LiveStatement), nil - } - - if kvs, err = c.TX.GetP(ctx, 0, key.Encode(), 0); err != nil { - return - } - - for _, kv := range kvs { - val := &sql.LiveStatement{} - val.Decode(kv.Val()) - out = append(out, val) - } - - c.put(key, out) - - return - -} - -func (c *Cache) GetLV(ctx context.Context, ns, db, tb, lv string) (val *sql.LiveStatement, err error) { - - var kv kvs.KV - - key := &keys.LV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, LV: lv} - - if out, ok := c.get(key); ok { - return out.(*sql.LiveStatement), nil - } - - if kv, err = c.TX.Get(ctx, 0, key.Encode()); err != nil { - return nil, err - } - - if !kv.Exi() { - return nil, ErrorLVNotFound - } - - val = &sql.LiveStatement{} - val.Decode(kv.Val()) - - c.put(key, val) - - return - -} - -func (c *Cache) DelLV(ns, db, tb, lv string) { - - c.del(&keys.LV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, LV: keys.Ignore}) - - c.del(&keys.LV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, LV: lv}) - -} diff --git a/sql/ast.gen.go b/sql/ast.gen.go index 10ad6ebb..e620e389 100644 --- a/sql/ast.gen.go +++ b/sql/ast.gen.go @@ -1,3 +1,5 @@ +// +build go1.6 + // Code generated by codecgen - DO NOT EDIT. package sql @@ -13,118 +15,98 @@ import ( const ( // ----- content types ---- - codecSelferCcUTF85048 = 1 - codecSelferCcRAW5048 = 255 + codecSelferCcUTF87834 = 1 + codecSelferCcRAW7834 = 255 // ----- value types used ---- - codecSelferValueTypeArray5048 = 10 - codecSelferValueTypeMap5048 = 9 - codecSelferValueTypeString5048 = 6 - codecSelferValueTypeInt5048 = 2 - codecSelferValueTypeUint5048 = 3 - codecSelferValueTypeFloat5048 = 4 - codecSelferBitsize5048 = uint8(32 << (^uint(0) >> 63)) + codecSelferValueTypeArray7834 = 10 + codecSelferValueTypeMap7834 = 9 + codecSelferValueTypeString7834 = 6 + codecSelferValueTypeInt7834 = 2 + codecSelferValueTypeUint7834 = 3 + codecSelferValueTypeFloat7834 = 4 + codecSelferValueTypeNil7834 = 1 + codecSelferBitsize7834 = uint8(32 << (^uint(0) >> 63)) + codecSelferDecContainerLenNil7834 = -2147483648 ) var ( - errCodecSelferOnlyMapOrArrayEncodeToStruct5048 = errors.New(`only encoded map or array can be decoded into a struct`) + errCodecSelferOnlyMapOrArrayEncodeToStruct7834 = errors.New(`only encoded map or array can be decoded into a struct`) ) -type codecSelfer5048 struct{} +type codecSelfer7834 struct{} + +func codecSelfer7834False() bool { return false } func init() { - if codec1978.GenVersion != 10 { + if codec1978.GenVersion != 16 { _, file, _, _ := runtime.Caller(0) - panic("codecgen version mismatch: current: 10, need " + strconv.FormatInt(int64(codec1978.GenVersion), 10) + ". Re-generate file: " + file) + ver := strconv.FormatInt(int64(codec1978.GenVersion), 10) + panic("codecgen version mismatch: current: 16, need " + ver + ". Re-generate file: " + file) } - if false { - var _ byte = 0 // reference the types, but skip this branch at build/run time - var v0 pkg1_language.Tag - var v1 time.Duration - _, _ = v0, v1 + if false { // reference the types, but skip this branch at build/run time + var _ pkg1_language.Tag + var _ time.Duration } } func (x *Query) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + x.Statements.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Statements\"") } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Statements == nil { - r.EncodeNil() - } else { - x.Statements.CodecEncodeSelf(e) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Statements\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Statements`) - } - r.WriteMapElemValue() - if x.Statements == nil { - r.EncodeNil() - } else { - x.Statements.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`Statements`) } + z.EncWriteMapElemValue() + x.Statements.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *Query) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Query{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Query) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -134,29 +116,24 @@ func (x *Query) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Statements": - if r.TryDecodeAsNil() { - x.Statements = nil - } else { - x.Statements.CodecDecodeSelf(d) - } + x.Statements.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Query) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -166,160 +143,115 @@ func (x *Query) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Statements = nil - } else { - x.Statements.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.Statements.CodecDecodeSelf(d) for { yyj5++ if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x Statements) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encStatements((Statements)(x), e) - } - } + h.encStatements((Statements)(x), e) + } // end block: if x slice == nil } func (x *Statements) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decStatements((*Statements)(x), d) - } + h.decStatements((*Statements)(x), d) } func (x *UseStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + r.EncodeString(string(x.NS)) + z.EncWriteArrayElem() + r.EncodeString(string(x.DB)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"NS\"") } else { - r.WriteMapStart(2) + r.EncodeString(`NS`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.NS)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.NS)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"DB\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"NS\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `NS`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.NS)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.DB)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"DB\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `DB`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.DB)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`DB`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.DB)) + z.EncWriteMapEnd() } } } func (x *UseStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = UseStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *UseStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -329,35 +261,26 @@ func (x *UseStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "NS": - if r.TryDecodeAsNil() { - x.NS = "" - } else { - x.NS = (string)(r.DecodeString()) - } + x.NS = (string)(string(r.DecodeStringAsBytes())) case "DB": - if r.TryDecodeAsNil() { - x.DB = "" - } else { - x.DB = (string)(r.DecodeString()) - } + x.DB = (string)(string(r.DecodeStringAsBytes())) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *UseStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -367,148 +290,109 @@ func (x *UseStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.NS = "" - } else { - x.NS = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.NS = (string)(string(r.DecodeStringAsBytes())) yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.DB = "" - } else { - x.DB = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.DB = (string)(string(r.DecodeStringAsBytes())) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *OptStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + r.EncodeString(string(x.Name)) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.What)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(2) + r.EncodeString(`Name`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Name)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Name)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.What)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.What)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`What`) } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.What)) + z.EncWriteMapEnd() } } } func (x *OptStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = OptStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *OptStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -518,35 +402,26 @@ func (x *OptStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = (string)(r.DecodeString()) - } + x.Name = (string)(string(r.DecodeStringAsBytes())) case "What": - if r.TryDecodeAsNil() { - x.What = false - } else { - x.What = (bool)(r.DecodeBool()) - } + x.What = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *OptStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -556,110 +431,89 @@ func (x *OptStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Name = (string)(string(r.DecodeStringAsBytes())) yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = false - } else { - x.What = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.What = (bool)(r.DecodeBool()) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *BeginStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(0) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapStart(0) + z.EncWriteMapEnd() } } } func (x *BeginStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = BeginStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *BeginStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -669,23 +523,22 @@ func (x *BeginStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *BeginStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj4 int @@ -696,77 +549,64 @@ func (x *BeginStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl4 { yyb4 = yyj4 > l } else { - yyb4 = r.CheckBreak() + yyb4 = z.DecCheckBreak() } if yyb4 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj4-1, "") } - r.ReadArrayEnd() } func (x *CancelStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(0) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapStart(0) + z.EncWriteMapEnd() } } } func (x *CancelStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = CancelStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *CancelStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -776,23 +616,22 @@ func (x *CancelStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *CancelStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj4 int @@ -803,77 +642,64 @@ func (x *CancelStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl4 { yyb4 = yyj4 > l } else { - yyb4 = r.CheckBreak() + yyb4 = z.DecCheckBreak() } if yyb4 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj4-1, "") } - r.ReadArrayEnd() } func (x *CommitStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(0) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapStart(0) + z.EncWriteMapEnd() } } } func (x *CommitStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = CommitStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *CommitStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -883,23 +709,22 @@ func (x *CommitStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *CommitStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj4 int @@ -910,144 +735,110 @@ func (x *CommitStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl4 { yyb4 = yyj4 > l } else { - yyb4 = r.CheckBreak() + yyb4 = z.DecCheckBreak() } if yyb4 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj4-1, "") } - r.ReadArrayEnd() } func (x *InfoStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.What == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { + z.EncExtension(x.Kind, yyxt5) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) + } else { + r.EncodeInt(int64(x.Kind)) + } + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Kind\"") } else { - r.WriteMapStart(2) + r.EncodeString(`Kind`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Kind)); yyxt4 != nil { - z.EncExtension(x.Kind, yyxt4) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + z.EncWriteMapElemValue() + if yyxt7 := z.Extension(z.I2Rtid(x.Kind)); yyxt7 != nil { + z.EncExtension(x.Kind, yyxt7) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Kind\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Kind`) - } - r.WriteMapElemValue() - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.EncExtension(x.Kind, yyxt5) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + r.EncodeInt(int64(x.Kind)) } - var yyn6 bool - if x.What == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapEnd() + x.What.CodecEncodeSelf(e) } + z.EncWriteMapEnd() } } } func (x *InfoStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = InfoStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *InfoStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -1057,48 +848,41 @@ func (x *InfoStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Kind": - if r.TryDecodeAsNil() { - x.Kind = 0 + if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { + z.DecExtension(x.Kind, yyxt5) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.DecExtension(x.Kind, yyxt5) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "What": - if r.TryDecodeAsNil() { - if true && x.What != nil { + if r.TryNil() { + if x.What != nil { // remove the if-true x.What = nil } } else { if x.What == nil { x.What = new(Ident) } - x.What.CodecDecodeSelf(d) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *InfoStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj7 int @@ -1108,45 +892,39 @@ func (x *InfoStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Kind = 0 + z.DecReadArrayElem() + if yyxt9 := z.Extension(z.I2Rtid(x.Kind)); yyxt9 != nil { + z.DecExtension(x.Kind, yyxt9) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt9 := z.Extension(z.I2Rtid(x.Kind)); yyxt9 != nil { - z.DecExtension(x.Kind, yyxt9) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.What != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.What != nil { // remove the if-true x.What = nil } } else { if x.What == nil { x.What = new(Ident) } - x.What.CodecDecodeSelf(d) } for { @@ -1154,127 +932,92 @@ func (x *InfoStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj7-1, "") } - r.ReadArrayEnd() } func (x *RunStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.RW)) + z.EncWriteArrayElem() + if yyxt6 := z.Extension(z.I2Rtid(x.Expr)); yyxt6 != nil { + z.EncExtension(x.Expr, yyxt6) + } else { + z.EncFallback(x.Expr) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"RW\"") } else { - r.WriteMapStart(2) + r.EncodeString(`RW`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.RW)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"RW\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `RW`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Expr)); yyxt7 != nil { - z.EncExtension(x.Expr, yyxt7) - } else { - z.EncFallback(x.Expr) - } - } + z.EncWriteMapElemValue() + if yyxt8 := z.Extension(z.I2Rtid(x.Expr)); yyxt8 != nil { + z.EncExtension(x.Expr, yyxt8) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Expr)); yyxt8 != nil { - z.EncExtension(x.Expr, yyxt8) - } else { - z.EncFallback(x.Expr) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Expr) } + z.EncWriteMapEnd() } } } func (x *RunStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RunStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RunStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -1284,40 +1027,30 @@ func (x *RunStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "RW": - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + x.RW = (bool)(r.DecodeBool()) case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil + if yyxt6 := z.Extension(z.I2Rtid(x.Expr)); yyxt6 != nil { + z.DecExtension(x.Expr, yyxt6) } else { - if false { - } else if yyxt6 := z.Extension(z.I2Rtid(x.Expr)); yyxt6 != nil { - z.DecExtension(x.Expr, yyxt6) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RunStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj7 int @@ -1327,201 +1060,141 @@ func (x *RunStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.RW = (bool)(r.DecodeBool()) yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil + z.DecReadArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Expr)); yyxt10 != nil { + z.DecExtension(x.Expr, yyxt10) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Expr)); yyxt10 != nil { - z.DecExtension(x.Expr, yyxt10) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } for { yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj7-1, "") } - r.ReadArrayEnd() } func (x *LetStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.RW)) + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.What)); yyxt8 != nil { + z.EncExtension(x.What, yyxt8) + } else { + z.EncFallback(x.What) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) + z.EncWriteMapStart(3) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"RW\"") } else { - r.WriteMapStart(3) + r.EncodeString(`RW`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.RW)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"RW\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `RW`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + r.EncodeString(`Name`) } - var yyn6 bool - if x.Name == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.What)); yyxt10 != nil { - z.EncExtension(x.What, yyxt10) - } else { - z.EncFallback(x.What) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.What)); yyxt11 != nil { - z.EncExtension(x.What, yyxt11) - } else { - z.EncFallback(x.What) - } - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyxt11 := z.Extension(z.I2Rtid(x.What)); yyxt11 != nil { + z.EncExtension(x.What, yyxt11) } else { - r.WriteMapEnd() + z.EncFallback(x.What) } + z.EncWriteMapEnd() } } } func (x *LetStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = LetStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *LetStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -1531,52 +1204,41 @@ func (x *LetStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "RW": - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + x.RW = (bool)(r.DecodeBool()) case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - x.What = nil + if yyxt7 := z.Extension(z.I2Rtid(x.What)); yyxt7 != nil { + z.DecExtension(x.What, yyxt7) } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.What)); yyxt7 != nil { - z.DecExtension(x.What, yyxt7) - } else { - z.DecFallback(&x.What, true) - } + z.DecFallback(&x.What, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *LetStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj8 int @@ -1586,326 +1248,212 @@ func (x *LetStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.RW = (bool)(r.DecodeBool()) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil + z.DecReadArrayElem() + if yyxt12 := z.Extension(z.I2Rtid(x.What)); yyxt12 != nil { + z.DecExtension(x.What, yyxt12) } else { - if false { - } else if yyxt12 := z.Extension(z.I2Rtid(x.What)); yyxt12 != nil { - z.DecExtension(x.What, yyxt12) - } else { - z.DecFallback(&x.What, true) - } + z.DecFallback(&x.What, true) } for { yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - r.ReadArrayEnd() } func (x *LiveStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(9) + z.EncWriteArrayElem() + r.EncodeString(string(x.ID)) + z.EncWriteArrayElem() + r.EncodeString(string(x.FB)) + z.EncWriteArrayElem() + r.EncodeString(string(x.NS)) + z.EncWriteArrayElem() + r.EncodeString(string(x.DB)) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Diff)) + z.EncWriteArrayElem() + x.Expr.CodecEncodeSelf(e) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt19 := z.Extension(z.I2Rtid(x.Cond)); yyxt19 != nil { + z.EncExtension(x.Cond, yyxt19) + } else { + z.EncFallback(x.Cond) + } + z.EncWriteArrayElem() + x.Fetch.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(9) + z.EncWriteMapStart(9) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"ID\"") } else { - r.WriteMapStart(9) + r.EncodeString(`ID`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.ID)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.ID)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FB\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"ID\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `ID`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.ID)) - } + r.EncodeString(`FB`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.FB)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.FB)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"NS\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"FB\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `FB`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.FB)) - } + r.EncodeString(`NS`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.NS)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.NS)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"DB\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"NS\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `NS`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.NS)) - } + r.EncodeString(`DB`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.DB)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.DB)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Diff\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"DB\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `DB`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.DB)) - } + r.EncodeString(`Diff`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Diff)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Diff)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Diff\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Diff`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Diff)) - } + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - x.Expr.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.Expr.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - x.Expr.CodecEncodeSelf(e) - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Cond\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`Cond`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt25 := z.Extension(z.I2Rtid(x.Cond)); yyxt25 != nil { - z.EncExtension(x.Cond, yyxt25) - } else { - z.EncFallback(x.Cond) - } - } + z.EncWriteMapElemValue() + if yyxt28 := z.Extension(z.I2Rtid(x.Cond)); yyxt28 != nil { + z.EncExtension(x.Cond, yyxt28) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Cond\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Cond`) - } - r.WriteMapElemValue() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt26 := z.Extension(z.I2Rtid(x.Cond)); yyxt26 != nil { - z.EncExtension(x.Cond, yyxt26) - } else { - z.EncFallback(x.Cond) - } - } + z.EncFallback(x.Cond) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Fetch == nil { - r.EncodeNil() - } else { - x.Fetch.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Fetch\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Fetch\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Fetch`) - } - r.WriteMapElemValue() - if x.Fetch == nil { - r.EncodeNil() - } else { - x.Fetch.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`Fetch`) } + z.EncWriteMapElemValue() + x.Fetch.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *LiveStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = LiveStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *LiveStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -1915,82 +1463,44 @@ func (x *LiveStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - x.ID = (string)(r.DecodeString()) - } + x.ID = (string)(string(r.DecodeStringAsBytes())) case "FB": - if r.TryDecodeAsNil() { - x.FB = "" - } else { - x.FB = (string)(r.DecodeString()) - } + x.FB = (string)(string(r.DecodeStringAsBytes())) case "NS": - if r.TryDecodeAsNil() { - x.NS = "" - } else { - x.NS = (string)(r.DecodeString()) - } + x.NS = (string)(string(r.DecodeStringAsBytes())) case "DB": - if r.TryDecodeAsNil() { - x.DB = "" - } else { - x.DB = (string)(r.DecodeString()) - } + x.DB = (string)(string(r.DecodeStringAsBytes())) case "Diff": - if r.TryDecodeAsNil() { - x.Diff = false - } else { - x.Diff = (bool)(r.DecodeBool()) - } + x.Diff = (bool)(r.DecodeBool()) case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - x.Expr.CodecDecodeSelf(d) - } + x.Expr.CodecDecodeSelf(d) case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Cond": - if r.TryDecodeAsNil() { - x.Cond = nil + if yyxt12 := z.Extension(z.I2Rtid(x.Cond)); yyxt12 != nil { + z.DecExtension(x.Cond, yyxt12) } else { - if false { - } else if yyxt12 := z.Extension(z.I2Rtid(x.Cond)); yyxt12 != nil { - z.DecExtension(x.Cond, yyxt12) - } else { - z.DecFallback(&x.Cond, true) - } + z.DecFallback(&x.Cond, true) } case "Fetch": - if r.TryDecodeAsNil() { - x.Fetch = nil - } else { - x.Fetch.CodecDecodeSelf(d) - } + x.Fetch.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *LiveStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj14 int @@ -2000,267 +1510,197 @@ func (x *LiveStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.ID = "" + z.DecReadArrayElem() + x.ID = (string)(string(r.DecodeStringAsBytes())) + yyj14++ + if yyhl14 { + yyb14 = yyj14 > l } else { - x.ID = (string)(r.DecodeString()) + yyb14 = z.DecCheckBreak() + } + if yyb14 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.FB = (string)(string(r.DecodeStringAsBytes())) + yyj14++ + if yyhl14 { + yyb14 = yyj14 > l + } else { + yyb14 = z.DecCheckBreak() + } + if yyb14 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.NS = (string)(string(r.DecodeStringAsBytes())) + yyj14++ + if yyhl14 { + yyb14 = yyj14 > l + } else { + yyb14 = z.DecCheckBreak() + } + if yyb14 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.DB = (string)(string(r.DecodeStringAsBytes())) + yyj14++ + if yyhl14 { + yyb14 = yyj14 > l + } else { + yyb14 = z.DecCheckBreak() + } + if yyb14 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Diff = (bool)(r.DecodeBool()) + yyj14++ + if yyhl14 { + yyb14 = yyj14 > l + } else { + yyb14 = z.DecCheckBreak() + } + if yyb14 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Expr.CodecDecodeSelf(d) + yyj14++ + if yyhl14 { + yyb14 = yyj14 > l + } else { + yyb14 = z.DecCheckBreak() + } + if yyb14 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) + yyj14++ + if yyhl14 { + yyb14 = yyj14 > l + } else { + yyb14 = z.DecCheckBreak() + } + if yyb14 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt23 := z.Extension(z.I2Rtid(x.Cond)); yyxt23 != nil { + z.DecExtension(x.Cond, yyxt23) + } else { + z.DecFallback(&x.Cond, true) } yyj14++ if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.FB = "" - } else { - x.FB = (string)(r.DecodeString()) - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.NS = "" - } else { - x.NS = (string)(r.DecodeString()) - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.DB = "" - } else { - x.DB = (string)(r.DecodeString()) - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Diff = false - } else { - x.Diff = (bool)(r.DecodeBool()) - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - x.Expr.CodecDecodeSelf(d) - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cond = nil - } else { - if false { - } else if yyxt23 := z.Extension(z.I2Rtid(x.Cond)); yyxt23 != nil { - z.DecExtension(x.Cond, yyxt23) - } else { - z.DecFallback(&x.Cond, true) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Fetch = nil - } else { - x.Fetch.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.Fetch.CodecDecodeSelf(d) for { yyj14++ if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj14-1, "") } - r.ReadArrayEnd() } func (x *KillStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + r.EncodeString(string(x.FB)) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FB\"") } else { - r.WriteMapStart(2) + r.EncodeString(`FB`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.FB)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.FB)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"FB\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `FB`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.FB)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`What`) } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *KillStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = KillStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *KillStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -2270,35 +1710,26 @@ func (x *KillStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "FB": - if r.TryDecodeAsNil() { - x.FB = "" - } else { - x.FB = (string)(r.DecodeString()) - } + x.FB = (string)(string(r.DecodeStringAsBytes())) case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *KillStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -2308,150 +1739,109 @@ func (x *KillStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.FB = "" - } else { - x.FB = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.FB = (string)(string(r.DecodeStringAsBytes())) yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *ReturnStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.RW)) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"RW\"") } else { - r.WriteMapStart(2) + r.EncodeString(`RW`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.RW)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"RW\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `RW`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`What`) } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *ReturnStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = ReturnStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *ReturnStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -2461,35 +1851,26 @@ func (x *ReturnStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "RW": - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + x.RW = (bool)(r.DecodeBool()) case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *ReturnStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -2499,202 +1880,137 @@ func (x *ReturnStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.RW = (bool)(r.DecodeBool()) yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *IfelseStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(4) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.RW)) + z.EncWriteArrayElem() + x.Cond.CodecEncodeSelf(e) + z.EncWriteArrayElem() + x.Then.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Else)); yyxt10 != nil { + z.EncExtension(x.Else, yyxt10) + } else { + z.EncFallback(x.Else) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) + z.EncWriteMapStart(4) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"RW\"") } else { - r.WriteMapStart(4) + r.EncodeString(`RW`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.RW)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Cond\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"RW\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `RW`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + r.EncodeString(`Cond`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Cond == nil { - r.EncodeNil() - } else { - x.Cond.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.Cond.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Then\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Cond\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Cond`) - } - r.WriteMapElemValue() - if x.Cond == nil { - r.EncodeNil() - } else { - x.Cond.CodecEncodeSelf(e) - } + r.EncodeString(`Then`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Then == nil { - r.EncodeNil() - } else { - x.Then.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.Then.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Else\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Then\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Then`) - } - r.WriteMapElemValue() - if x.Then == nil { - r.EncodeNil() - } else { - x.Then.CodecEncodeSelf(e) - } + r.EncodeString(`Else`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Else == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Else)); yyxt13 != nil { - z.EncExtension(x.Else, yyxt13) - } else { - z.EncFallback(x.Else) - } - } + z.EncWriteMapElemValue() + if yyxt14 := z.Extension(z.I2Rtid(x.Else)); yyxt14 != nil { + z.EncExtension(x.Else, yyxt14) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Else\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Else`) - } - r.WriteMapElemValue() - if x.Else == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Else)); yyxt14 != nil { - z.EncExtension(x.Else, yyxt14) - } else { - z.EncFallback(x.Else) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Else) } + z.EncWriteMapEnd() } } } func (x *IfelseStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = IfelseStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *IfelseStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -2704,52 +2020,34 @@ func (x *IfelseStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "RW": - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + x.RW = (bool)(r.DecodeBool()) case "Cond": - if r.TryDecodeAsNil() { - x.Cond = nil - } else { - x.Cond.CodecDecodeSelf(d) - } + x.Cond.CodecDecodeSelf(d) case "Then": - if r.TryDecodeAsNil() { - x.Then = nil - } else { - x.Then.CodecDecodeSelf(d) - } + x.Then.CodecDecodeSelf(d) case "Else": - if r.TryDecodeAsNil() { - x.Else = nil + if yyxt8 := z.Extension(z.I2Rtid(x.Else)); yyxt8 != nil { + z.DecExtension(x.Else, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Else)); yyxt8 != nil { - z.DecExtension(x.Else, yyxt8) - } else { - z.DecFallback(&x.Else, true) - } + z.DecFallback(&x.Else, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *IfelseStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj9 int @@ -2759,458 +2057,287 @@ func (x *IfelseStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.RW = (bool)(r.DecodeBool()) yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cond = nil - } else { - x.Cond.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.Cond.CodecDecodeSelf(d) yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Then = nil - } else { - x.Then.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.Then.CodecDecodeSelf(d) yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Else = nil + z.DecReadArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Else)); yyxt14 != nil { + z.DecExtension(x.Else, yyxt14) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Else)); yyxt14 != nil { - z.DecExtension(x.Else, yyxt14) - } else { - z.DecFallback(&x.Else, true) - } + z.DecFallback(&x.Else, true) } for { yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } - r.ReadArrayEnd() } func (x *SelectStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(13) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.RW)) + z.EncWriteArrayElem() + x.Expr.CodecEncodeSelf(e) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt19 := z.Extension(z.I2Rtid(x.Cond)); yyxt19 != nil { + z.EncExtension(x.Cond, yyxt19) + } else { + z.EncFallback(x.Cond) + } + z.EncWriteArrayElem() + x.Split.CodecEncodeSelf(e) + z.EncWriteArrayElem() + x.Group.CodecEncodeSelf(e) + z.EncWriteArrayElem() + x.Order.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt23 := z.Extension(z.I2Rtid(x.Limit)); yyxt23 != nil { + z.EncExtension(x.Limit, yyxt23) + } else { + z.EncFallback(x.Limit) + } + z.EncWriteArrayElem() + if yyxt24 := z.Extension(z.I2Rtid(x.Start)); yyxt24 != nil { + z.EncExtension(x.Start, yyxt24) + } else { + z.EncFallback(x.Start) + } + z.EncWriteArrayElem() + x.Fetch.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt26 := z.Extension(z.I2Rtid(x.Version)); yyxt26 != nil { + z.EncExtension(x.Version, yyxt26) + } else { + z.EncFallback(x.Version) + } + z.EncWriteArrayElem() + if yyxt27 := z.Extension(z.I2Rtid(x.Timeout)); yyxt27 != nil { + z.EncExtension(x.Timeout, yyxt27) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(13) + z.EncWriteMapStart(13) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"RW\"") } else { - r.WriteMapStart(13) + r.EncodeString(`RW`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.RW)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"RW\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `RW`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.RW)) - } + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - x.Expr.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.Expr.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - x.Expr.CodecEncodeSelf(e) - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Cond\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`Cond`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Cond)); yyxt13 != nil { - z.EncExtension(x.Cond, yyxt13) - } else { - z.EncFallback(x.Cond) - } - } + z.EncWriteMapElemValue() + if yyxt32 := z.Extension(z.I2Rtid(x.Cond)); yyxt32 != nil { + z.EncExtension(x.Cond, yyxt32) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Cond\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Cond`) - } - r.WriteMapElemValue() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Cond)); yyxt14 != nil { - z.EncExtension(x.Cond, yyxt14) - } else { - z.EncFallback(x.Cond) - } - } + z.EncFallback(x.Cond) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Split == nil { - r.EncodeNil() - } else { - x.Split.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Split\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Split\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Split`) - } - r.WriteMapElemValue() - if x.Split == nil { - r.EncodeNil() - } else { - x.Split.CodecEncodeSelf(e) - } + r.EncodeString(`Split`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Group == nil { - r.EncodeNil() - } else { - x.Group.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.Split.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Group\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Group\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Group`) - } - r.WriteMapElemValue() - if x.Group == nil { - r.EncodeNil() - } else { - x.Group.CodecEncodeSelf(e) - } + r.EncodeString(`Group`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Order == nil { - r.EncodeNil() - } else { - x.Order.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.Group.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Order\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Order\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Order`) - } - r.WriteMapElemValue() - if x.Order == nil { - r.EncodeNil() - } else { - x.Order.CodecEncodeSelf(e) - } + r.EncodeString(`Order`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Limit == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt25 := z.Extension(z.I2Rtid(x.Limit)); yyxt25 != nil { - z.EncExtension(x.Limit, yyxt25) - } else { - z.EncFallback(x.Limit) - } - } + z.EncWriteMapElemValue() + x.Order.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Limit\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Limit\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Limit`) - } - r.WriteMapElemValue() - if x.Limit == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt26 := z.Extension(z.I2Rtid(x.Limit)); yyxt26 != nil { - z.EncExtension(x.Limit, yyxt26) - } else { - z.EncFallback(x.Limit) - } - } + r.EncodeString(`Limit`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Start == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt28 := z.Extension(z.I2Rtid(x.Start)); yyxt28 != nil { - z.EncExtension(x.Start, yyxt28) - } else { - z.EncFallback(x.Start) - } - } + z.EncWriteMapElemValue() + if yyxt36 := z.Extension(z.I2Rtid(x.Limit)); yyxt36 != nil { + z.EncExtension(x.Limit, yyxt36) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Start\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Start`) - } - r.WriteMapElemValue() - if x.Start == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt29 := z.Extension(z.I2Rtid(x.Start)); yyxt29 != nil { - z.EncExtension(x.Start, yyxt29) - } else { - z.EncFallback(x.Start) - } - } + z.EncFallback(x.Limit) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Fetch == nil { - r.EncodeNil() - } else { - x.Fetch.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Start\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Fetch\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Fetch`) - } - r.WriteMapElemValue() - if x.Fetch == nil { - r.EncodeNil() - } else { - x.Fetch.CodecEncodeSelf(e) - } + r.EncodeString(`Start`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Version == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt34 := z.Extension(z.I2Rtid(x.Version)); yyxt34 != nil { - z.EncExtension(x.Version, yyxt34) - } else { - z.EncFallback(x.Version) - } - } + z.EncWriteMapElemValue() + if yyxt37 := z.Extension(z.I2Rtid(x.Start)); yyxt37 != nil { + z.EncExtension(x.Start, yyxt37) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Version\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Version`) - } - r.WriteMapElemValue() - if x.Version == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt35 := z.Extension(z.I2Rtid(x.Version)); yyxt35 != nil { - z.EncExtension(x.Version, yyxt35) - } else { - z.EncFallback(x.Version) - } - } + z.EncFallback(x.Start) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt37 := z.Extension(z.I2Rtid(x.Timeout)); yyxt37 != nil { - z.EncExtension(x.Timeout, yyxt37) - } else { - r.EncodeInt(int64(x.Timeout)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Fetch\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Timeout\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Timeout`) - } - r.WriteMapElemValue() - if false { - } else if yyxt38 := z.Extension(z.I2Rtid(x.Timeout)); yyxt38 != nil { - z.EncExtension(x.Timeout, yyxt38) - } else { - r.EncodeInt(int64(x.Timeout)) - } + r.EncodeString(`Fetch`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + z.EncWriteMapElemValue() + x.Fetch.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Version\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Parallel\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Parallel`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + r.EncodeString(`Version`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyxt39 := z.Extension(z.I2Rtid(x.Version)); yyxt39 != nil { + z.EncExtension(x.Version, yyxt39) } else { - r.WriteMapEnd() + z.EncFallback(x.Version) } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Timeout\"") + } else { + r.EncodeString(`Timeout`) + } + z.EncWriteMapElemValue() + if yyxt40 := z.Extension(z.I2Rtid(x.Timeout)); yyxt40 != nil { + z.EncExtension(x.Timeout, yyxt40) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Parallel\"") + } else { + r.EncodeString(`Parallel`) + } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteMapEnd() } } } func (x *SelectStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = SelectStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *SelectStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -3220,126 +2347,68 @@ func (x *SelectStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "RW": - if r.TryDecodeAsNil() { - x.RW = false - } else { - x.RW = (bool)(r.DecodeBool()) - } + x.RW = (bool)(r.DecodeBool()) case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - x.Expr.CodecDecodeSelf(d) - } + x.Expr.CodecDecodeSelf(d) case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Cond": - if r.TryDecodeAsNil() { - x.Cond = nil + if yyxt8 := z.Extension(z.I2Rtid(x.Cond)); yyxt8 != nil { + z.DecExtension(x.Cond, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Cond)); yyxt8 != nil { - z.DecExtension(x.Cond, yyxt8) - } else { - z.DecFallback(&x.Cond, true) - } + z.DecFallback(&x.Cond, true) } case "Split": - if r.TryDecodeAsNil() { - x.Split = nil - } else { - x.Split.CodecDecodeSelf(d) - } + x.Split.CodecDecodeSelf(d) case "Group": - if r.TryDecodeAsNil() { - x.Group = nil - } else { - x.Group.CodecDecodeSelf(d) - } + x.Group.CodecDecodeSelf(d) case "Order": - if r.TryDecodeAsNil() { - x.Order = nil - } else { - x.Order.CodecDecodeSelf(d) - } + x.Order.CodecDecodeSelf(d) case "Limit": - if r.TryDecodeAsNil() { - x.Limit = nil + if yyxt13 := z.Extension(z.I2Rtid(x.Limit)); yyxt13 != nil { + z.DecExtension(x.Limit, yyxt13) } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Limit)); yyxt13 != nil { - z.DecExtension(x.Limit, yyxt13) - } else { - z.DecFallback(&x.Limit, true) - } + z.DecFallback(&x.Limit, true) } case "Start": - if r.TryDecodeAsNil() { - x.Start = nil + if yyxt15 := z.Extension(z.I2Rtid(x.Start)); yyxt15 != nil { + z.DecExtension(x.Start, yyxt15) } else { - if false { - } else if yyxt15 := z.Extension(z.I2Rtid(x.Start)); yyxt15 != nil { - z.DecExtension(x.Start, yyxt15) - } else { - z.DecFallback(&x.Start, true) - } + z.DecFallback(&x.Start, true) } case "Fetch": - if r.TryDecodeAsNil() { - x.Fetch = nil - } else { - x.Fetch.CodecDecodeSelf(d) - } + x.Fetch.CodecDecodeSelf(d) case "Version": - if r.TryDecodeAsNil() { - x.Version = nil + if yyxt18 := z.Extension(z.I2Rtid(x.Version)); yyxt18 != nil { + z.DecExtension(x.Version, yyxt18) } else { - if false { - } else if yyxt18 := z.Extension(z.I2Rtid(x.Version)); yyxt18 != nil { - z.DecExtension(x.Version, yyxt18) - } else { - z.DecFallback(&x.Version, true) - } + z.DecFallback(&x.Version, true) } case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 + if yyxt20 := z.Extension(z.I2Rtid(x.Timeout)); yyxt20 != nil { + z.DecExtension(x.Timeout, yyxt20) } else { - if false { - } else if yyxt20 := z.Extension(z.I2Rtid(x.Timeout)); yyxt20 != nil { - z.DecExtension(x.Timeout, yyxt20) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } case "Parallel": - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + x.Parallel = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *SelectStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj22 int @@ -3349,436 +2418,323 @@ func (x *SelectStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl22 { yyb22 = yyj22 > l } else { - yyb22 = r.CheckBreak() + yyb22 = z.DecCheckBreak() } if yyb22 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.RW = false + z.DecReadArrayElem() + x.RW = (bool)(r.DecodeBool()) + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l } else { - x.RW = (bool)(r.DecodeBool()) + yyb22 = z.DecCheckBreak() + } + if yyb22 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Expr.CodecDecodeSelf(d) + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = z.DecCheckBreak() + } + if yyb22 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = z.DecCheckBreak() + } + if yyb22 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt27 := z.Extension(z.I2Rtid(x.Cond)); yyxt27 != nil { + z.DecExtension(x.Cond, yyxt27) + } else { + z.DecFallback(&x.Cond, true) } yyj22++ if yyhl22 { yyb22 = yyj22 > l } else { - yyb22 = r.CheckBreak() + yyb22 = z.DecCheckBreak() } if yyb22 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil + z.DecReadArrayElem() + x.Split.CodecDecodeSelf(d) + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l } else { - x.Expr.CodecDecodeSelf(d) + yyb22 = z.DecCheckBreak() + } + if yyb22 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Group.CodecDecodeSelf(d) + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = z.DecCheckBreak() + } + if yyb22 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Order.CodecDecodeSelf(d) + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l + } else { + yyb22 = z.DecCheckBreak() + } + if yyb22 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt32 := z.Extension(z.I2Rtid(x.Limit)); yyxt32 != nil { + z.DecExtension(x.Limit, yyxt32) + } else { + z.DecFallback(&x.Limit, true) } yyj22++ if yyhl22 { yyb22 = yyj22 > l } else { - yyb22 = r.CheckBreak() + yyb22 = z.DecCheckBreak() } if yyb22 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil + z.DecReadArrayElem() + if yyxt34 := z.Extension(z.I2Rtid(x.Start)); yyxt34 != nil { + z.DecExtension(x.Start, yyxt34) } else { - x.What.CodecDecodeSelf(d) + z.DecFallback(&x.Start, true) } yyj22++ if yyhl22 { yyb22 = yyj22 > l } else { - yyb22 = r.CheckBreak() + yyb22 = z.DecCheckBreak() } if yyb22 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cond = nil + z.DecReadArrayElem() + x.Fetch.CodecDecodeSelf(d) + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l } else { - if false { - } else if yyxt27 := z.Extension(z.I2Rtid(x.Cond)); yyxt27 != nil { - z.DecExtension(x.Cond, yyxt27) - } else { - z.DecFallback(&x.Cond, true) - } + yyb22 = z.DecCheckBreak() + } + if yyb22 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt37 := z.Extension(z.I2Rtid(x.Version)); yyxt37 != nil { + z.DecExtension(x.Version, yyxt37) + } else { + z.DecFallback(&x.Version, true) } yyj22++ if yyhl22 { yyb22 = yyj22 > l } else { - yyb22 = r.CheckBreak() + yyb22 = z.DecCheckBreak() } if yyb22 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Split = nil + z.DecReadArrayElem() + if yyxt39 := z.Extension(z.I2Rtid(x.Timeout)); yyxt39 != nil { + z.DecExtension(x.Timeout, yyxt39) } else { - x.Split.CodecDecodeSelf(d) + x.Timeout = (time.Duration)(r.DecodeInt64()) } yyj22++ if yyhl22 { yyb22 = yyj22 > l } else { - yyb22 = r.CheckBreak() + yyb22 = z.DecCheckBreak() } if yyb22 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Group = nil - } else { - x.Group.CodecDecodeSelf(d) - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Order = nil - } else { - x.Order.CodecDecodeSelf(d) - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Limit = nil - } else { - if false { - } else if yyxt32 := z.Extension(z.I2Rtid(x.Limit)); yyxt32 != nil { - z.DecExtension(x.Limit, yyxt32) - } else { - z.DecFallback(&x.Limit, true) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Start = nil - } else { - if false { - } else if yyxt34 := z.Extension(z.I2Rtid(x.Start)); yyxt34 != nil { - z.DecExtension(x.Start, yyxt34) - } else { - z.DecFallback(&x.Start, true) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Fetch = nil - } else { - x.Fetch.CodecDecodeSelf(d) - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Version = nil - } else { - if false { - } else if yyxt37 := z.Extension(z.I2Rtid(x.Version)); yyxt37 != nil { - z.DecExtension(x.Version, yyxt37) - } else { - z.DecFallback(&x.Version, true) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - if false { - } else if yyxt39 := z.Extension(z.I2Rtid(x.Timeout)); yyxt39 != nil { - z.DecExtension(x.Timeout, yyxt39) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Parallel = (bool)(r.DecodeBool()) for { yyj22++ if yyhl22 { yyb22 = yyj22 > l } else { - yyb22 = r.CheckBreak() + yyb22 = z.DecCheckBreak() } if yyb22 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj22-1, "") } - r.ReadArrayEnd() } func (x *CreateStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(5) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt9 := z.Extension(z.I2Rtid(x.Data)); yyxt9 != nil { + z.EncExtension(x.Data, yyxt9) + } else { + z.EncFallback(x.Data) + } + z.EncWriteArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { + z.EncExtension(x.Echo, yyxt10) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) + } else { + r.EncodeInt(int64(x.Echo)) + } + z.EncWriteArrayElem() + if yyxt11 := z.Extension(z.I2Rtid(x.Timeout)); yyxt11 != nil { + z.EncExtension(x.Timeout, yyxt11) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(5) + z.EncWriteMapStart(5) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapStart(5) + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Data)); yyxt7 != nil { - z.EncExtension(x.Data, yyxt7) - } else { - z.EncFallback(x.Data) - } - } + z.EncWriteMapElemValue() + if yyxt14 := z.Extension(z.I2Rtid(x.Data)); yyxt14 != nil { + z.EncExtension(x.Data, yyxt14) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { - z.EncExtension(x.Data, yyxt8) - } else { - z.EncFallback(x.Data) - } - } + z.EncFallback(x.Data) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { - z.EncExtension(x.Echo, yyxt10) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Echo\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Echo\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Echo`) - } - r.WriteMapElemValue() - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Echo)); yyxt11 != nil { - z.EncExtension(x.Echo, yyxt11) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + r.EncodeString(`Echo`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Timeout)); yyxt13 != nil { - z.EncExtension(x.Timeout, yyxt13) - } else { - r.EncodeInt(int64(x.Timeout)) - } + z.EncWriteMapElemValue() + if yyxt15 := z.Extension(z.I2Rtid(x.Echo)); yyxt15 != nil { + z.EncExtension(x.Echo, yyxt15) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Timeout\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Timeout`) - } - r.WriteMapElemValue() - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Timeout)); yyxt14 != nil { - z.EncExtension(x.Timeout, yyxt14) - } else { - r.EncodeInt(int64(x.Timeout)) - } + r.EncodeInt(int64(x.Echo)) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Timeout\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Parallel\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Parallel`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + r.EncodeString(`Timeout`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyxt16 := z.Extension(z.I2Rtid(x.Timeout)); yyxt16 != nil { + z.EncExtension(x.Timeout, yyxt16) } else { - r.WriteMapEnd() + r.EncodeInt(int64(x.Timeout)) } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Parallel\"") + } else { + r.EncodeString(`Parallel`) + } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteMapEnd() } } } func (x *CreateStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = CreateStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *CreateStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -3788,70 +2744,46 @@ func (x *CreateStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Data": - if r.TryDecodeAsNil() { - x.Data = nil + if yyxt6 := z.Extension(z.I2Rtid(x.Data)); yyxt6 != nil { + z.DecExtension(x.Data, yyxt6) } else { - if false { - } else if yyxt6 := z.Extension(z.I2Rtid(x.Data)); yyxt6 != nil { - z.DecExtension(x.Data, yyxt6) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } case "Echo": - if r.TryDecodeAsNil() { - x.Echo = 0 + if yyxt8 := z.Extension(z.I2Rtid(x.Echo)); yyxt8 != nil { + z.DecExtension(x.Echo, yyxt8) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Echo)); yyxt8 != nil { - z.DecExtension(x.Echo, yyxt8) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 + if yyxt10 := z.Extension(z.I2Rtid(x.Timeout)); yyxt10 != nil { + z.DecExtension(x.Timeout, yyxt10) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Timeout)); yyxt10 != nil { - z.DecExtension(x.Timeout, yyxt10) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } case "Parallel": - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + x.Parallel = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *CreateStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj12 int @@ -3861,331 +2793,239 @@ func (x *CreateStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l } else { - x.What.CodecDecodeSelf(d) + yyb12 = z.DecCheckBreak() + } + if yyb12 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt15 := z.Extension(z.I2Rtid(x.Data)); yyxt15 != nil { + z.DecExtension(x.Data, yyxt15) + } else { + z.DecFallback(&x.Data, true) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil + z.DecReadArrayElem() + if yyxt17 := z.Extension(z.I2Rtid(x.Echo)); yyxt17 != nil { + z.DecExtension(x.Echo, yyxt17) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt15 := z.Extension(z.I2Rtid(x.Data)); yyxt15 != nil { - z.DecExtension(x.Data, yyxt15) - } else { - z.DecFallback(&x.Data, true) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Echo = 0 + z.DecReadArrayElem() + if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { + z.DecExtension(x.Timeout, yyxt19) } else { - if false { - } else if yyxt17 := z.Extension(z.I2Rtid(x.Echo)); yyxt17 != nil { - z.DecExtension(x.Echo, yyxt17) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { - z.DecExtension(x.Timeout, yyxt19) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Parallel = (bool)(r.DecodeBool()) for { yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj12-1, "") } - r.ReadArrayEnd() } func (x *UpdateStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(6) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Data)); yyxt10 != nil { + z.EncExtension(x.Data, yyxt10) + } else { + z.EncFallback(x.Data) + } + z.EncWriteArrayElem() + if yyxt11 := z.Extension(z.I2Rtid(x.Cond)); yyxt11 != nil { + z.EncExtension(x.Cond, yyxt11) + } else { + z.EncFallback(x.Cond) + } + z.EncWriteArrayElem() + if yyxt12 := z.Extension(z.I2Rtid(x.Echo)); yyxt12 != nil { + z.EncExtension(x.Echo, yyxt12) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) + } else { + r.EncodeInt(int64(x.Echo)) + } + z.EncWriteArrayElem() + if yyxt13 := z.Extension(z.I2Rtid(x.Timeout)); yyxt13 != nil { + z.EncExtension(x.Timeout, yyxt13) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(6) + z.EncWriteMapStart(6) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapStart(6) + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Data)); yyxt7 != nil { - z.EncExtension(x.Data, yyxt7) - } else { - z.EncFallback(x.Data) - } - } + z.EncWriteMapElemValue() + if yyxt16 := z.Extension(z.I2Rtid(x.Data)); yyxt16 != nil { + z.EncExtension(x.Data, yyxt16) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { - z.EncExtension(x.Data, yyxt8) - } else { - z.EncFallback(x.Data) - } - } + z.EncFallback(x.Data) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Cond)); yyxt10 != nil { - z.EncExtension(x.Cond, yyxt10) - } else { - z.EncFallback(x.Cond) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Cond\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Cond\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Cond`) - } - r.WriteMapElemValue() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Cond)); yyxt11 != nil { - z.EncExtension(x.Cond, yyxt11) - } else { - z.EncFallback(x.Cond) - } - } + r.EncodeString(`Cond`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Echo)); yyxt13 != nil { - z.EncExtension(x.Echo, yyxt13) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + z.EncWriteMapElemValue() + if yyxt17 := z.Extension(z.I2Rtid(x.Cond)); yyxt17 != nil { + z.EncExtension(x.Cond, yyxt17) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Echo\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Echo`) - } - r.WriteMapElemValue() - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Echo)); yyxt14 != nil { - z.EncExtension(x.Echo, yyxt14) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + z.EncFallback(x.Cond) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt16 := z.Extension(z.I2Rtid(x.Timeout)); yyxt16 != nil { - z.EncExtension(x.Timeout, yyxt16) - } else { - r.EncodeInt(int64(x.Timeout)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Echo\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Timeout\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Timeout`) - } - r.WriteMapElemValue() - if false { - } else if yyxt17 := z.Extension(z.I2Rtid(x.Timeout)); yyxt17 != nil { - z.EncExtension(x.Timeout, yyxt17) - } else { - r.EncodeInt(int64(x.Timeout)) - } + r.EncodeString(`Echo`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + z.EncWriteMapElemValue() + if yyxt18 := z.Extension(z.I2Rtid(x.Echo)); yyxt18 != nil { + z.EncExtension(x.Echo, yyxt18) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Parallel\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Parallel`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + r.EncodeInt(int64(x.Echo)) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Timeout\"") } else { - r.WriteMapEnd() + r.EncodeString(`Timeout`) } + z.EncWriteMapElemValue() + if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { + z.EncExtension(x.Timeout, yyxt19) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Parallel\"") + } else { + r.EncodeString(`Parallel`) + } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteMapEnd() } } } func (x *UpdateStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = UpdateStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *UpdateStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -4195,81 +3035,52 @@ func (x *UpdateStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Data": - if r.TryDecodeAsNil() { - x.Data = nil + if yyxt6 := z.Extension(z.I2Rtid(x.Data)); yyxt6 != nil { + z.DecExtension(x.Data, yyxt6) } else { - if false { - } else if yyxt6 := z.Extension(z.I2Rtid(x.Data)); yyxt6 != nil { - z.DecExtension(x.Data, yyxt6) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } case "Cond": - if r.TryDecodeAsNil() { - x.Cond = nil + if yyxt8 := z.Extension(z.I2Rtid(x.Cond)); yyxt8 != nil { + z.DecExtension(x.Cond, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Cond)); yyxt8 != nil { - z.DecExtension(x.Cond, yyxt8) - } else { - z.DecFallback(&x.Cond, true) - } + z.DecFallback(&x.Cond, true) } case "Echo": - if r.TryDecodeAsNil() { - x.Echo = 0 + if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { + z.DecExtension(x.Echo, yyxt10) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { - z.DecExtension(x.Echo, yyxt10) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 + if yyxt12 := z.Extension(z.I2Rtid(x.Timeout)); yyxt12 != nil { + z.DecExtension(x.Timeout, yyxt12) } else { - if false { - } else if yyxt12 := z.Extension(z.I2Rtid(x.Timeout)); yyxt12 != nil { - z.DecExtension(x.Timeout, yyxt12) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } case "Parallel": - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + x.Parallel = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *UpdateStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj14 int @@ -4279,321 +3090,237 @@ func (x *UpdateStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) + yyj14++ + if yyhl14 { + yyb14 = yyj14 > l } else { - x.What.CodecDecodeSelf(d) + yyb14 = z.DecCheckBreak() + } + if yyb14 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt17 := z.Extension(z.I2Rtid(x.Data)); yyxt17 != nil { + z.DecExtension(x.Data, yyxt17) + } else { + z.DecFallback(&x.Data, true) } yyj14++ if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil + z.DecReadArrayElem() + if yyxt19 := z.Extension(z.I2Rtid(x.Cond)); yyxt19 != nil { + z.DecExtension(x.Cond, yyxt19) } else { - if false { - } else if yyxt17 := z.Extension(z.I2Rtid(x.Data)); yyxt17 != nil { - z.DecExtension(x.Data, yyxt17) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Cond, true) } yyj14++ if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cond = nil + z.DecReadArrayElem() + if yyxt21 := z.Extension(z.I2Rtid(x.Echo)); yyxt21 != nil { + z.DecExtension(x.Echo, yyxt21) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Cond)); yyxt19 != nil { - z.DecExtension(x.Cond, yyxt19) - } else { - z.DecFallback(&x.Cond, true) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj14++ if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Echo = 0 + z.DecReadArrayElem() + if yyxt23 := z.Extension(z.I2Rtid(x.Timeout)); yyxt23 != nil { + z.DecExtension(x.Timeout, yyxt23) } else { - if false { - } else if yyxt21 := z.Extension(z.I2Rtid(x.Echo)); yyxt21 != nil { - z.DecExtension(x.Echo, yyxt21) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } yyj14++ if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - if false { - } else if yyxt23 := z.Extension(z.I2Rtid(x.Timeout)); yyxt23 != nil { - z.DecExtension(x.Timeout, yyxt23) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Parallel = (bool)(r.DecodeBool()) for { yyj14++ if yyhl14 { yyb14 = yyj14 > l } else { - yyb14 = r.CheckBreak() + yyb14 = z.DecCheckBreak() } if yyb14 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj14-1, "") } - r.ReadArrayEnd() } func (x *DeleteStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(5) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt9 := z.Extension(z.I2Rtid(x.Cond)); yyxt9 != nil { + z.EncExtension(x.Cond, yyxt9) + } else { + z.EncFallback(x.Cond) + } + z.EncWriteArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { + z.EncExtension(x.Echo, yyxt10) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) + } else { + r.EncodeInt(int64(x.Echo)) + } + z.EncWriteArrayElem() + if yyxt11 := z.Extension(z.I2Rtid(x.Timeout)); yyxt11 != nil { + z.EncExtension(x.Timeout, yyxt11) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(5) + z.EncWriteMapStart(5) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapStart(5) + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Cond\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`Cond`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Cond)); yyxt7 != nil { - z.EncExtension(x.Cond, yyxt7) - } else { - z.EncFallback(x.Cond) - } - } + z.EncWriteMapElemValue() + if yyxt14 := z.Extension(z.I2Rtid(x.Cond)); yyxt14 != nil { + z.EncExtension(x.Cond, yyxt14) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Cond\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Cond`) - } - r.WriteMapElemValue() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Cond)); yyxt8 != nil { - z.EncExtension(x.Cond, yyxt8) - } else { - z.EncFallback(x.Cond) - } - } + z.EncFallback(x.Cond) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { - z.EncExtension(x.Echo, yyxt10) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Echo\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Echo\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Echo`) - } - r.WriteMapElemValue() - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Echo)); yyxt11 != nil { - z.EncExtension(x.Echo, yyxt11) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + r.EncodeString(`Echo`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Timeout)); yyxt13 != nil { - z.EncExtension(x.Timeout, yyxt13) - } else { - r.EncodeInt(int64(x.Timeout)) - } + z.EncWriteMapElemValue() + if yyxt15 := z.Extension(z.I2Rtid(x.Echo)); yyxt15 != nil { + z.EncExtension(x.Echo, yyxt15) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Timeout\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Timeout`) - } - r.WriteMapElemValue() - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Timeout)); yyxt14 != nil { - z.EncExtension(x.Timeout, yyxt14) - } else { - r.EncodeInt(int64(x.Timeout)) - } + r.EncodeInt(int64(x.Echo)) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Timeout\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Parallel\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Parallel`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + r.EncodeString(`Timeout`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyxt16 := z.Extension(z.I2Rtid(x.Timeout)); yyxt16 != nil { + z.EncExtension(x.Timeout, yyxt16) } else { - r.WriteMapEnd() + r.EncodeInt(int64(x.Timeout)) } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Parallel\"") + } else { + r.EncodeString(`Parallel`) + } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteMapEnd() } } } func (x *DeleteStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DeleteStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DeleteStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -4603,70 +3330,46 @@ func (x *DeleteStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Cond": - if r.TryDecodeAsNil() { - x.Cond = nil + if yyxt6 := z.Extension(z.I2Rtid(x.Cond)); yyxt6 != nil { + z.DecExtension(x.Cond, yyxt6) } else { - if false { - } else if yyxt6 := z.Extension(z.I2Rtid(x.Cond)); yyxt6 != nil { - z.DecExtension(x.Cond, yyxt6) - } else { - z.DecFallback(&x.Cond, true) - } + z.DecFallback(&x.Cond, true) } case "Echo": - if r.TryDecodeAsNil() { - x.Echo = 0 + if yyxt8 := z.Extension(z.I2Rtid(x.Echo)); yyxt8 != nil { + z.DecExtension(x.Echo, yyxt8) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Echo)); yyxt8 != nil { - z.DecExtension(x.Echo, yyxt8) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 + if yyxt10 := z.Extension(z.I2Rtid(x.Timeout)); yyxt10 != nil { + z.DecExtension(x.Timeout, yyxt10) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Timeout)); yyxt10 != nil { - z.DecExtension(x.Timeout, yyxt10) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } case "Parallel": - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + x.Parallel = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DeleteStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj12 int @@ -4676,371 +3379,259 @@ func (x *DeleteStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) + yyj12++ + if yyhl12 { + yyb12 = yyj12 > l } else { - x.What.CodecDecodeSelf(d) + yyb12 = z.DecCheckBreak() + } + if yyb12 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt15 := z.Extension(z.I2Rtid(x.Cond)); yyxt15 != nil { + z.DecExtension(x.Cond, yyxt15) + } else { + z.DecFallback(&x.Cond, true) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cond = nil + z.DecReadArrayElem() + if yyxt17 := z.Extension(z.I2Rtid(x.Echo)); yyxt17 != nil { + z.DecExtension(x.Echo, yyxt17) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt15 := z.Extension(z.I2Rtid(x.Cond)); yyxt15 != nil { - z.DecExtension(x.Cond, yyxt15) - } else { - z.DecFallback(&x.Cond, true) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Echo = 0 + z.DecReadArrayElem() + if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { + z.DecExtension(x.Timeout, yyxt19) } else { - if false { - } else if yyxt17 := z.Extension(z.I2Rtid(x.Echo)); yyxt17 != nil { - z.DecExtension(x.Echo, yyxt17) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { - z.DecExtension(x.Timeout, yyxt19) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Parallel = (bool)(r.DecodeBool()) for { yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj12-1, "") } - r.ReadArrayEnd() } func (x *RelateStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(8) + z.EncWriteArrayElem() + if yyxt11 := z.Extension(z.I2Rtid(x.Type)); yyxt11 != nil { + z.EncExtension(x.Type, yyxt11) + } else { + z.EncFallback(x.Type) + } + z.EncWriteArrayElem() + x.From.CodecEncodeSelf(e) + z.EncWriteArrayElem() + x.With.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Data)); yyxt14 != nil { + z.EncExtension(x.Data, yyxt14) + } else { + z.EncFallback(x.Data) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Uniq)) + z.EncWriteArrayElem() + if yyxt16 := z.Extension(z.I2Rtid(x.Echo)); yyxt16 != nil { + z.EncExtension(x.Echo, yyxt16) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) + } else { + r.EncodeInt(int64(x.Echo)) + } + z.EncWriteArrayElem() + if yyxt17 := z.Extension(z.I2Rtid(x.Timeout)); yyxt17 != nil { + z.EncExtension(x.Timeout, yyxt17) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(8) + z.EncWriteMapStart(8) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Type\"") } else { - r.WriteMapStart(8) + r.EncodeString(`Type`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Type == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Type)); yyxt4 != nil { - z.EncExtension(x.Type, yyxt4) - } else { - z.EncFallback(x.Type) - } - } + z.EncWriteMapElemValue() + if yyxt19 := z.Extension(z.I2Rtid(x.Type)); yyxt19 != nil { + z.EncExtension(x.Type, yyxt19) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Type\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Type`) - } - r.WriteMapElemValue() - if x.Type == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Type)); yyxt5 != nil { - z.EncExtension(x.Type, yyxt5) - } else { - z.EncFallback(x.Type) - } - } + z.EncFallback(x.Type) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.From == nil { - r.EncodeNil() - } else { - x.From.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"From\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"From\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `From`) - } - r.WriteMapElemValue() - if x.From == nil { - r.EncodeNil() - } else { - x.From.CodecEncodeSelf(e) - } + r.EncodeString(`From`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.With == nil { - r.EncodeNil() - } else { - x.With.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.From.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"With\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"With\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `With`) - } - r.WriteMapElemValue() - if x.With == nil { - r.EncodeNil() - } else { - x.With.CodecEncodeSelf(e) - } + r.EncodeString(`With`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Data)); yyxt13 != nil { - z.EncExtension(x.Data, yyxt13) - } else { - z.EncFallback(x.Data) - } - } + z.EncWriteMapElemValue() + x.With.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Data)); yyxt14 != nil { - z.EncExtension(x.Data, yyxt14) - } else { - z.EncFallback(x.Data) - } - } + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Uniq)) - } + z.EncWriteMapElemValue() + if yyxt22 := z.Extension(z.I2Rtid(x.Data)); yyxt22 != nil { + z.EncExtension(x.Data, yyxt22) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Uniq\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Uniq`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Uniq)) - } + z.EncFallback(x.Data) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Echo)); yyxt19 != nil { - z.EncExtension(x.Echo, yyxt19) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Uniq\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Echo\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Echo`) - } - r.WriteMapElemValue() - if false { - } else if yyxt20 := z.Extension(z.I2Rtid(x.Echo)); yyxt20 != nil { - z.EncExtension(x.Echo, yyxt20) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + r.EncodeString(`Uniq`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt22 := z.Extension(z.I2Rtid(x.Timeout)); yyxt22 != nil { - z.EncExtension(x.Timeout, yyxt22) - } else { - r.EncodeInt(int64(x.Timeout)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Uniq)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Echo\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Timeout\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Timeout`) - } - r.WriteMapElemValue() - if false { - } else if yyxt23 := z.Extension(z.I2Rtid(x.Timeout)); yyxt23 != nil { - z.EncExtension(x.Timeout, yyxt23) - } else { - r.EncodeInt(int64(x.Timeout)) - } + r.EncodeString(`Echo`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + z.EncWriteMapElemValue() + if yyxt24 := z.Extension(z.I2Rtid(x.Echo)); yyxt24 != nil { + z.EncExtension(x.Echo, yyxt24) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Parallel\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Parallel`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + r.EncodeInt(int64(x.Echo)) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Timeout\"") } else { - r.WriteMapEnd() + r.EncodeString(`Timeout`) } + z.EncWriteMapElemValue() + if yyxt25 := z.Extension(z.I2Rtid(x.Timeout)); yyxt25 != nil { + z.EncExtension(x.Timeout, yyxt25) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Parallel\"") + } else { + r.EncodeString(`Parallel`) + } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteMapEnd() } } } func (x *RelateStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RelateStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RelateStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -5050,93 +3641,56 @@ func (x *RelateStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Type": - if r.TryDecodeAsNil() { - x.Type = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Type)); yyxt5 != nil { + z.DecExtension(x.Type, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Type)); yyxt5 != nil { - z.DecExtension(x.Type, yyxt5) - } else { - z.DecFallback(&x.Type, true) - } + z.DecFallback(&x.Type, true) } case "From": - if r.TryDecodeAsNil() { - x.From = nil - } else { - x.From.CodecDecodeSelf(d) - } + x.From.CodecDecodeSelf(d) case "With": - if r.TryDecodeAsNil() { - x.With = nil - } else { - x.With.CodecDecodeSelf(d) - } + x.With.CodecDecodeSelf(d) case "Data": - if r.TryDecodeAsNil() { - x.Data = nil + if yyxt9 := z.Extension(z.I2Rtid(x.Data)); yyxt9 != nil { + z.DecExtension(x.Data, yyxt9) } else { - if false { - } else if yyxt9 := z.Extension(z.I2Rtid(x.Data)); yyxt9 != nil { - z.DecExtension(x.Data, yyxt9) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } case "Uniq": - if r.TryDecodeAsNil() { - x.Uniq = false - } else { - x.Uniq = (bool)(r.DecodeBool()) - } + x.Uniq = (bool)(r.DecodeBool()) case "Echo": - if r.TryDecodeAsNil() { - x.Echo = 0 + if yyxt12 := z.Extension(z.I2Rtid(x.Echo)); yyxt12 != nil { + z.DecExtension(x.Echo, yyxt12) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt12 := z.Extension(z.I2Rtid(x.Echo)); yyxt12 != nil { - z.DecExtension(x.Echo, yyxt12) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 + if yyxt14 := z.Extension(z.I2Rtid(x.Timeout)); yyxt14 != nil { + z.DecExtension(x.Timeout, yyxt14) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Timeout)); yyxt14 != nil { - z.DecExtension(x.Timeout, yyxt14) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } case "Parallel": - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + x.Parallel = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RelateStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj16 int @@ -5146,368 +3700,271 @@ func (x *RelateStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl16 { yyb16 = yyj16 > l } else { - yyb16 = r.CheckBreak() + yyb16 = z.DecCheckBreak() } if yyb16 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Type = nil + z.DecReadArrayElem() + if yyxt18 := z.Extension(z.I2Rtid(x.Type)); yyxt18 != nil { + z.DecExtension(x.Type, yyxt18) } else { - if false { - } else if yyxt18 := z.Extension(z.I2Rtid(x.Type)); yyxt18 != nil { - z.DecExtension(x.Type, yyxt18) - } else { - z.DecFallback(&x.Type, true) - } + z.DecFallback(&x.Type, true) } yyj16++ if yyhl16 { yyb16 = yyj16 > l } else { - yyb16 = r.CheckBreak() + yyb16 = z.DecCheckBreak() } if yyb16 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.From = nil + z.DecReadArrayElem() + x.From.CodecDecodeSelf(d) + yyj16++ + if yyhl16 { + yyb16 = yyj16 > l } else { - x.From.CodecDecodeSelf(d) + yyb16 = z.DecCheckBreak() + } + if yyb16 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.With.CodecDecodeSelf(d) + yyj16++ + if yyhl16 { + yyb16 = yyj16 > l + } else { + yyb16 = z.DecCheckBreak() + } + if yyb16 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt22 := z.Extension(z.I2Rtid(x.Data)); yyxt22 != nil { + z.DecExtension(x.Data, yyxt22) + } else { + z.DecFallback(&x.Data, true) } yyj16++ if yyhl16 { yyb16 = yyj16 > l } else { - yyb16 = r.CheckBreak() + yyb16 = z.DecCheckBreak() } if yyb16 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.With = nil + z.DecReadArrayElem() + x.Uniq = (bool)(r.DecodeBool()) + yyj16++ + if yyhl16 { + yyb16 = yyj16 > l } else { - x.With.CodecDecodeSelf(d) + yyb16 = z.DecCheckBreak() + } + if yyb16 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt25 := z.Extension(z.I2Rtid(x.Echo)); yyxt25 != nil { + z.DecExtension(x.Echo, yyxt25) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) + } else { + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj16++ if yyhl16 { yyb16 = yyj16 > l } else { - yyb16 = r.CheckBreak() + yyb16 = z.DecCheckBreak() } if yyb16 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil + z.DecReadArrayElem() + if yyxt27 := z.Extension(z.I2Rtid(x.Timeout)); yyxt27 != nil { + z.DecExtension(x.Timeout, yyxt27) } else { - if false { - } else if yyxt22 := z.Extension(z.I2Rtid(x.Data)); yyxt22 != nil { - z.DecExtension(x.Data, yyxt22) - } else { - z.DecFallback(&x.Data, true) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } yyj16++ if yyhl16 { yyb16 = yyj16 > l } else { - yyb16 = r.CheckBreak() + yyb16 = z.DecCheckBreak() } if yyb16 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Uniq = false - } else { - x.Uniq = (bool)(r.DecodeBool()) - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Echo = 0 - } else { - if false { - } else if yyxt25 := z.Extension(z.I2Rtid(x.Echo)); yyxt25 != nil { - z.DecExtension(x.Echo, yyxt25) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - if false { - } else if yyxt27 := z.Extension(z.I2Rtid(x.Timeout)); yyxt27 != nil { - z.DecExtension(x.Timeout, yyxt27) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Parallel = (bool)(r.DecodeBool()) for { yyj16++ if yyhl16 { yyb16 = yyj16 > l } else { - yyb16 = r.CheckBreak() + yyb16 = z.DecCheckBreak() } if yyb16 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj16-1, "") } - r.ReadArrayEnd() } func (x *InsertStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.Into == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(5) + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { + z.EncExtension(x.Data, yyxt8) + } else { + z.EncFallback(x.Data) + } + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Into.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { + z.EncExtension(x.Echo, yyxt10) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) + } else { + r.EncodeInt(int64(x.Echo)) + } + z.EncWriteArrayElem() + if yyxt11 := z.Extension(z.I2Rtid(x.Timeout)); yyxt11 != nil { + z.EncExtension(x.Timeout, yyxt11) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(5) + z.EncWriteMapStart(5) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapStart(5) + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Data)); yyxt4 != nil { - z.EncExtension(x.Data, yyxt4) - } else { - z.EncFallback(x.Data) - } - } + z.EncWriteMapElemValue() + if yyxt13 := z.Extension(z.I2Rtid(x.Data)); yyxt13 != nil { + z.EncExtension(x.Data, yyxt13) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.EncExtension(x.Data, yyxt5) - } else { - z.EncFallback(x.Data) - } - } + z.EncFallback(x.Data) } - var yyn6 bool - if x.Into == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Into == nil { - r.EncodeNil() - } else { - x.Into.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Into\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Into\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Into`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.Into == nil { - r.EncodeNil() - } else { - x.Into.CodecEncodeSelf(e) - } - } + r.EncodeString(`Into`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { - z.EncExtension(x.Echo, yyxt10) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Echo\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Echo`) - } - r.WriteMapElemValue() - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Echo)); yyxt11 != nil { - z.EncExtension(x.Echo, yyxt11) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + x.Into.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Timeout)); yyxt13 != nil { - z.EncExtension(x.Timeout, yyxt13) - } else { - r.EncodeInt(int64(x.Timeout)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Echo\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Timeout\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Timeout`) - } - r.WriteMapElemValue() - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Timeout)); yyxt14 != nil { - z.EncExtension(x.Timeout, yyxt14) - } else { - r.EncodeInt(int64(x.Timeout)) - } + r.EncodeString(`Echo`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + z.EncWriteMapElemValue() + if yyxt15 := z.Extension(z.I2Rtid(x.Echo)); yyxt15 != nil { + z.EncExtension(x.Echo, yyxt15) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Parallel\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Parallel`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + r.EncodeInt(int64(x.Echo)) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Timeout\"") } else { - r.WriteMapEnd() + r.EncodeString(`Timeout`) } + z.EncWriteMapElemValue() + if yyxt16 := z.Extension(z.I2Rtid(x.Timeout)); yyxt16 != nil { + z.EncExtension(x.Timeout, yyxt16) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Parallel\"") + } else { + r.EncodeString(`Parallel`) + } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteMapEnd() } } } func (x *InsertStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = InsertStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *InsertStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -5517,76 +3974,55 @@ func (x *InsertStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Data": - if r.TryDecodeAsNil() { - x.Data = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { + z.DecExtension(x.Data, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.DecExtension(x.Data, yyxt5) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } case "Into": - if r.TryDecodeAsNil() { - if true && x.Into != nil { + if r.TryNil() { + if x.Into != nil { // remove the if-true x.Into = nil } } else { if x.Into == nil { x.Into = new(Table) } - x.Into.CodecDecodeSelf(d) } case "Echo": - if r.TryDecodeAsNil() { - x.Echo = 0 + if yyxt8 := z.Extension(z.I2Rtid(x.Echo)); yyxt8 != nil { + z.DecExtension(x.Echo, yyxt8) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Echo)); yyxt8 != nil { - z.DecExtension(x.Echo, yyxt8) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 + if yyxt10 := z.Extension(z.I2Rtid(x.Timeout)); yyxt10 != nil { + z.DecExtension(x.Timeout, yyxt10) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Timeout)); yyxt10 != nil { - z.DecExtension(x.Timeout, yyxt10) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } case "Parallel": - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + x.Parallel = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *InsertStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj12 int @@ -5596,321 +4032,240 @@ func (x *InsertStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil + z.DecReadArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Data)); yyxt14 != nil { + z.DecExtension(x.Data, yyxt14) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Data)); yyxt14 != nil { - z.DecExtension(x.Data, yyxt14) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Into != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Into != nil { // remove the if-true x.Into = nil } } else { if x.Into == nil { x.Into = new(Table) } - x.Into.CodecDecodeSelf(d) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Echo = 0 + z.DecReadArrayElem() + if yyxt17 := z.Extension(z.I2Rtid(x.Echo)); yyxt17 != nil { + z.DecExtension(x.Echo, yyxt17) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt17 := z.Extension(z.I2Rtid(x.Echo)); yyxt17 != nil { - z.DecExtension(x.Echo, yyxt17) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Timeout = 0 + z.DecReadArrayElem() + if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { + z.DecExtension(x.Timeout, yyxt19) } else { - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { - z.DecExtension(x.Timeout, yyxt19) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Parallel = (bool)(r.DecodeBool()) for { yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj12-1, "") } - r.ReadArrayEnd() } func (x *UpsertStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.Into == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(5) + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { + z.EncExtension(x.Data, yyxt8) + } else { + z.EncFallback(x.Data) + } + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Into.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { + z.EncExtension(x.Echo, yyxt10) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) + } else { + r.EncodeInt(int64(x.Echo)) + } + z.EncWriteArrayElem() + if yyxt11 := z.Extension(z.I2Rtid(x.Timeout)); yyxt11 != nil { + z.EncExtension(x.Timeout, yyxt11) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(5) + z.EncWriteMapStart(5) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapStart(5) + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Data)); yyxt4 != nil { - z.EncExtension(x.Data, yyxt4) - } else { - z.EncFallback(x.Data) - } - } + z.EncWriteMapElemValue() + if yyxt13 := z.Extension(z.I2Rtid(x.Data)); yyxt13 != nil { + z.EncExtension(x.Data, yyxt13) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.EncExtension(x.Data, yyxt5) - } else { - z.EncFallback(x.Data) - } - } + z.EncFallback(x.Data) } - var yyn6 bool - if x.Into == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Into == nil { - r.EncodeNil() - } else { - x.Into.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Into\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Into\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Into`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.Into == nil { - r.EncodeNil() - } else { - x.Into.CodecEncodeSelf(e) - } - } + r.EncodeString(`Into`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Echo)); yyxt10 != nil { - z.EncExtension(x.Echo, yyxt10) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Echo\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Echo`) - } - r.WriteMapElemValue() - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Echo)); yyxt11 != nil { - z.EncExtension(x.Echo, yyxt11) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Echo) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Echo) - } else { - r.EncodeInt(int64(x.Echo)) - } + x.Into.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Timeout)); yyxt13 != nil { - z.EncExtension(x.Timeout, yyxt13) - } else { - r.EncodeInt(int64(x.Timeout)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Echo\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Timeout\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Timeout`) - } - r.WriteMapElemValue() - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Timeout)); yyxt14 != nil { - z.EncExtension(x.Timeout, yyxt14) - } else { - r.EncodeInt(int64(x.Timeout)) - } + r.EncodeString(`Echo`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + z.EncWriteMapElemValue() + if yyxt15 := z.Extension(z.I2Rtid(x.Echo)); yyxt15 != nil { + z.EncExtension(x.Echo, yyxt15) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Echo) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Echo) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Parallel\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Parallel`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Parallel)) - } + r.EncodeInt(int64(x.Echo)) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Timeout\"") } else { - r.WriteMapEnd() + r.EncodeString(`Timeout`) } + z.EncWriteMapElemValue() + if yyxt16 := z.Extension(z.I2Rtid(x.Timeout)); yyxt16 != nil { + z.EncExtension(x.Timeout, yyxt16) + } else { + r.EncodeInt(int64(x.Timeout)) + } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Parallel\"") + } else { + r.EncodeString(`Parallel`) + } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Parallel)) + z.EncWriteMapEnd() } } } func (x *UpsertStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = UpsertStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *UpsertStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -5920,76 +4275,55 @@ func (x *UpsertStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Data": - if r.TryDecodeAsNil() { - x.Data = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { + z.DecExtension(x.Data, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.DecExtension(x.Data, yyxt5) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } case "Into": - if r.TryDecodeAsNil() { - if true && x.Into != nil { + if r.TryNil() { + if x.Into != nil { // remove the if-true x.Into = nil } } else { if x.Into == nil { x.Into = new(Table) } - x.Into.CodecDecodeSelf(d) } case "Echo": - if r.TryDecodeAsNil() { - x.Echo = 0 + if yyxt8 := z.Extension(z.I2Rtid(x.Echo)); yyxt8 != nil { + z.DecExtension(x.Echo, yyxt8) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Echo)); yyxt8 != nil { - z.DecExtension(x.Echo, yyxt8) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 + if yyxt10 := z.Extension(z.I2Rtid(x.Timeout)); yyxt10 != nil { + z.DecExtension(x.Timeout, yyxt10) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Timeout)); yyxt10 != nil { - z.DecExtension(x.Timeout, yyxt10) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } case "Parallel": - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + x.Parallel = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *UpsertStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj12 int @@ -5999,217 +4333,168 @@ func (x *UpsertStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil + z.DecReadArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Data)); yyxt14 != nil { + z.DecExtension(x.Data, yyxt14) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Data)); yyxt14 != nil { - z.DecExtension(x.Data, yyxt14) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Into != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Into != nil { // remove the if-true x.Into = nil } } else { if x.Into == nil { x.Into = new(Table) } - x.Into.CodecDecodeSelf(d) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Echo = 0 + z.DecReadArrayElem() + if yyxt17 := z.Extension(z.I2Rtid(x.Echo)); yyxt17 != nil { + z.DecExtension(x.Echo, yyxt17) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Echo) } else { - if false { - } else if yyxt17 := z.Extension(z.I2Rtid(x.Echo)); yyxt17 != nil { - z.DecExtension(x.Echo, yyxt17) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Echo) - } else { - x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Echo = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Timeout = 0 + z.DecReadArrayElem() + if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { + z.DecExtension(x.Timeout, yyxt19) } else { - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Timeout)); yyxt19 != nil { - z.DecExtension(x.Timeout, yyxt19) - } else { - x.Timeout = (time.Duration)(r.DecodeInt64()) - } + x.Timeout = (time.Duration)(r.DecodeInt64()) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Parallel = false - } else { - x.Parallel = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Parallel = (bool)(r.DecodeBool()) for { yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj12-1, "") } - r.ReadArrayEnd() } func (x *DefineNamespaceStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + x.Name.CodecEncodeSelf(e) } + z.EncWriteMapEnd() } } } func (x *DefineNamespaceStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineNamespaceStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineNamespaceStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -6219,35 +4504,33 @@ func (x *DefineNamespaceStatement) codecDecodeSelfFromMap(l int, d *codec1978.De break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineNamespaceStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -6257,22 +4540,21 @@ func (x *DefineNamespaceStatement) codecDecodeSelfFromArray(l int, d *codec1978. if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } for { @@ -6280,113 +4562,84 @@ func (x *DefineNamespaceStatement) codecDecodeSelfFromArray(l int, d *codec1978. if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x *RemoveNamespaceStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + x.Name.CodecEncodeSelf(e) } + z.EncWriteMapEnd() } } } func (x *RemoveNamespaceStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveNamespaceStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveNamespaceStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -6396,35 +4649,33 @@ func (x *RemoveNamespaceStatement) codecDecodeSelfFromMap(l int, d *codec1978.De break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveNamespaceStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -6434,22 +4685,21 @@ func (x *RemoveNamespaceStatement) codecDecodeSelfFromArray(l int, d *codec1978. if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } for { @@ -6457,113 +4707,84 @@ func (x *RemoveNamespaceStatement) codecDecodeSelfFromArray(l int, d *codec1978. if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x *DefineDatabaseStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + x.Name.CodecEncodeSelf(e) } + z.EncWriteMapEnd() } } } func (x *DefineDatabaseStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineDatabaseStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineDatabaseStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -6573,35 +4794,33 @@ func (x *DefineDatabaseStatement) codecDecodeSelfFromMap(l int, d *codec1978.Dec break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineDatabaseStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -6611,22 +4830,21 @@ func (x *DefineDatabaseStatement) codecDecodeSelfFromArray(l int, d *codec1978.D if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } for { @@ -6634,113 +4852,84 @@ func (x *DefineDatabaseStatement) codecDecodeSelfFromArray(l int, d *codec1978.D if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x *RemoveDatabaseStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + x.Name.CodecEncodeSelf(e) } + z.EncWriteMapEnd() } } } func (x *RemoveDatabaseStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveDatabaseStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveDatabaseStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -6750,35 +4939,33 @@ func (x *RemoveDatabaseStatement) codecDecodeSelfFromMap(l int, d *codec1978.Dec break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveDatabaseStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -6788,22 +4975,21 @@ func (x *RemoveDatabaseStatement) codecDecodeSelfFromArray(l int, d *codec1978.D if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } for { @@ -6811,225 +4997,164 @@ func (x *RemoveDatabaseStatement) codecDecodeSelfFromArray(l int, d *codec1978.D if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x *DefineLoginStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.User == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(5) + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Kind)); yyxt8 != nil { + z.EncExtension(x.Kind, yyxt8) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) + } else { + r.EncodeInt(int64(x.Kind)) + } + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.User.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + if x.Pass == nil { + r.EncodeNil() + } else { + r.EncodeStringBytesRaw([]byte(x.Pass)) + } // end block: if x.Pass slice == nil + z.EncWriteArrayElem() + if x.Hash == nil { + r.EncodeNil() + } else { + r.EncodeStringBytesRaw([]byte(x.Hash)) + } // end block: if x.Hash slice == nil + z.EncWriteArrayElem() + if x.Code == nil { + r.EncodeNil() + } else { + r.EncodeStringBytesRaw([]byte(x.Code)) + } // end block: if x.Code slice == nil + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(5) + z.EncWriteMapStart(5) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Kind\"") } else { - r.WriteMapStart(5) + r.EncodeString(`Kind`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Kind)); yyxt4 != nil { - z.EncExtension(x.Kind, yyxt4) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + z.EncWriteMapElemValue() + if yyxt13 := z.Extension(z.I2Rtid(x.Kind)); yyxt13 != nil { + z.EncExtension(x.Kind, yyxt13) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Kind\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Kind`) - } - r.WriteMapElemValue() - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.EncExtension(x.Kind, yyxt5) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + r.EncodeInt(int64(x.Kind)) } - var yyn6 bool - if x.User == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.User == nil { - r.EncodeNil() - } else { - x.User.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"User\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"User\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `User`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.User == nil { - r.EncodeNil() - } else { - x.User.CodecEncodeSelf(e) - } - } + r.EncodeString(`User`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Pass == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Pass)) - } - } + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Pass\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Pass`) - } - r.WriteMapElemValue() - if x.Pass == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Pass)) - } - } + x.User.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Hash == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Hash)) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Pass\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Hash\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Hash`) - } - r.WriteMapElemValue() - if x.Hash == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Hash)) - } - } + r.EncodeString(`Pass`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Code == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Code)) - } - } + z.EncWriteMapElemValue() + if x.Pass == nil { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Code\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Code`) - } - r.WriteMapElemValue() - if x.Code == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Code)) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + r.EncodeStringBytesRaw([]byte(x.Pass)) + } // end block: if x.Pass slice == nil + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Hash\"") } else { - r.WriteMapEnd() + r.EncodeString(`Hash`) } + z.EncWriteMapElemValue() + if x.Hash == nil { + r.EncodeNil() + } else { + r.EncodeStringBytesRaw([]byte(x.Hash)) + } // end block: if x.Hash slice == nil + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Code\"") + } else { + r.EncodeString(`Code`) + } + z.EncWriteMapElemValue() + if x.Code == nil { + r.EncodeNil() + } else { + r.EncodeStringBytesRaw([]byte(x.Code)) + } // end block: if x.Code slice == nil + z.EncWriteMapEnd() } } } func (x *DefineLoginStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineLoginStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineLoginStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -7039,75 +5164,47 @@ func (x *DefineLoginStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Kind": - if r.TryDecodeAsNil() { - x.Kind = 0 + if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { + z.DecExtension(x.Kind, yyxt5) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.DecExtension(x.Kind, yyxt5) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "User": - if r.TryDecodeAsNil() { - if true && x.User != nil { + if r.TryNil() { + if x.User != nil { // remove the if-true x.User = nil } } else { if x.User == nil { x.User = new(Ident) } - x.User.CodecDecodeSelf(d) } case "Pass": - if r.TryDecodeAsNil() { - x.Pass = nil - } else { - if false { - } else { - x.Pass = r.DecodeBytes(([]byte)(x.Pass), false) - } - } + x.Pass = r.DecodeBytes(([]byte)(x.Pass), false) case "Hash": - if r.TryDecodeAsNil() { - x.Hash = nil - } else { - if false { - } else { - x.Hash = r.DecodeBytes(([]byte)(x.Hash), false) - } - } + x.Hash = r.DecodeBytes(([]byte)(x.Hash), false) case "Code": - if r.TryDecodeAsNil() { - x.Code = nil - } else { - if false { - } else { - x.Code = r.DecodeBytes(([]byte)(x.Code), false) - } - } + x.Code = r.DecodeBytes(([]byte)(x.Code), false) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineLoginStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj13 int @@ -7117,247 +5214,186 @@ func (x *DefineLoginStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl13 { yyb13 = yyj13 > l } else { - yyb13 = r.CheckBreak() + yyb13 = z.DecCheckBreak() } if yyb13 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Kind = 0 + z.DecReadArrayElem() + if yyxt15 := z.Extension(z.I2Rtid(x.Kind)); yyxt15 != nil { + z.DecExtension(x.Kind, yyxt15) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt15 := z.Extension(z.I2Rtid(x.Kind)); yyxt15 != nil { - z.DecExtension(x.Kind, yyxt15) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj13++ if yyhl13 { yyb13 = yyj13 > l } else { - yyb13 = r.CheckBreak() + yyb13 = z.DecCheckBreak() } if yyb13 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.User != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.User != nil { // remove the if-true x.User = nil } } else { if x.User == nil { x.User = new(Ident) } - x.User.CodecDecodeSelf(d) } yyj13++ if yyhl13 { yyb13 = yyj13 > l } else { - yyb13 = r.CheckBreak() + yyb13 = z.DecCheckBreak() } if yyb13 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Pass = nil - } else { - if false { - } else { - x.Pass = r.DecodeBytes(([]byte)(x.Pass), false) - } - } + z.DecReadArrayElem() + x.Pass = r.DecodeBytes(([]byte)(x.Pass), false) yyj13++ if yyhl13 { yyb13 = yyj13 > l } else { - yyb13 = r.CheckBreak() + yyb13 = z.DecCheckBreak() } if yyb13 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Hash = nil - } else { - if false { - } else { - x.Hash = r.DecodeBytes(([]byte)(x.Hash), false) - } - } + z.DecReadArrayElem() + x.Hash = r.DecodeBytes(([]byte)(x.Hash), false) yyj13++ if yyhl13 { yyb13 = yyj13 > l } else { - yyb13 = r.CheckBreak() + yyb13 = z.DecCheckBreak() } if yyb13 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Code = nil - } else { - if false { - } else { - x.Code = r.DecodeBytes(([]byte)(x.Code), false) - } - } + z.DecReadArrayElem() + x.Code = r.DecodeBytes(([]byte)(x.Code), false) for { yyj13++ if yyhl13 { yyb13 = yyj13 > l } else { - yyb13 = r.CheckBreak() + yyb13 = z.DecCheckBreak() } if yyb13 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj13-1, "") } - r.ReadArrayEnd() } func (x *RemoveLoginStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.User == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { + z.EncExtension(x.Kind, yyxt5) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) + } else { + r.EncodeInt(int64(x.Kind)) + } + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.User.CodecEncodeSelf(e) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Kind\"") } else { - r.WriteMapStart(2) + r.EncodeString(`Kind`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Kind)); yyxt4 != nil { - z.EncExtension(x.Kind, yyxt4) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + z.EncWriteMapElemValue() + if yyxt7 := z.Extension(z.I2Rtid(x.Kind)); yyxt7 != nil { + z.EncExtension(x.Kind, yyxt7) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Kind\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Kind`) - } - r.WriteMapElemValue() - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.EncExtension(x.Kind, yyxt5) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + r.EncodeInt(int64(x.Kind)) } - var yyn6 bool - if x.User == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.User == nil { - r.EncodeNil() - } else { - x.User.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"User\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"User\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `User`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.User == nil { - r.EncodeNil() - } else { - x.User.CodecEncodeSelf(e) - } - } + r.EncodeString(`User`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapEnd() + x.User.CodecEncodeSelf(e) } + z.EncWriteMapEnd() } } } func (x *RemoveLoginStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveLoginStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveLoginStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -7367,48 +5403,41 @@ func (x *RemoveLoginStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Kind": - if r.TryDecodeAsNil() { - x.Kind = 0 + if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { + z.DecExtension(x.Kind, yyxt5) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.DecExtension(x.Kind, yyxt5) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "User": - if r.TryDecodeAsNil() { - if true && x.User != nil { + if r.TryNil() { + if x.User != nil { // remove the if-true x.User = nil } } else { if x.User == nil { x.User = new(Ident) } - x.User.CodecDecodeSelf(d) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveLoginStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj7 int @@ -7418,45 +5447,39 @@ func (x *RemoveLoginStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Kind = 0 + z.DecReadArrayElem() + if yyxt9 := z.Extension(z.I2Rtid(x.Kind)); yyxt9 != nil { + z.DecExtension(x.Kind, yyxt9) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt9 := z.Extension(z.I2Rtid(x.Kind)); yyxt9 != nil { - z.DecExtension(x.Kind, yyxt9) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.User != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.User != nil { // remove the if-true x.User = nil } } else { if x.User == nil { x.User = new(Ident) } - x.User.CodecDecodeSelf(d) } for { @@ -7464,226 +5487,158 @@ func (x *RemoveLoginStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj7-1, "") } - r.ReadArrayEnd() } func (x *DefineTokenStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.Name == nil + var yyn5 bool = x.What == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(5) + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Kind)); yyxt8 != nil { + z.EncExtension(x.Kind, yyxt8) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) + } else { + r.EncodeInt(int64(x.Kind)) + } + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + if yyn5 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + r.EncodeString(string(x.Type)) + z.EncWriteArrayElem() + if x.Code == nil { + r.EncodeNil() + } else { + r.EncodeStringBytesRaw([]byte(x.Code)) + } // end block: if x.Code slice == nil + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(5) + z.EncWriteMapStart(5) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Kind\"") } else { - r.WriteMapStart(5) + r.EncodeString(`Kind`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Kind)); yyxt4 != nil { - z.EncExtension(x.Kind, yyxt4) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + z.EncWriteMapElemValue() + if yyxt13 := z.Extension(z.I2Rtid(x.Kind)); yyxt13 != nil { + z.EncExtension(x.Kind, yyxt13) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Kind\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Kind`) - } - r.WriteMapElemValue() - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.EncExtension(x.Kind, yyxt5) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + r.EncodeInt(int64(x.Kind)) } - var yyn6 bool - if x.Name == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + r.EncodeString(`Name`) } - var yyn9 bool - if x.What == nil { - yyn9 = true - goto LABEL9 - } - LABEL9: - if yyr2 || yy2arr2 { - if yyn9 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if yyn9 { - r.EncodeNil() - } else { - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Type)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Type\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Type`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Type)) - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Code == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Code)) - } - } + z.EncWriteMapElemValue() + if yyn5 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Code\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Code`) - } - r.WriteMapElemValue() - if x.Code == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Code)) - } - } + x.What.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Type\"") } else { - r.WriteMapEnd() + r.EncodeString(`Type`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Type)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Code\"") + } else { + r.EncodeString(`Code`) + } + z.EncWriteMapElemValue() + if x.Code == nil { + r.EncodeNil() + } else { + r.EncodeStringBytesRaw([]byte(x.Code)) + } // end block: if x.Code slice == nil + z.EncWriteMapEnd() } } } func (x *DefineTokenStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineTokenStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineTokenStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -7693,75 +5648,56 @@ func (x *DefineTokenStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Kind": - if r.TryDecodeAsNil() { - x.Kind = 0 + if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { + z.DecExtension(x.Kind, yyxt5) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.DecExtension(x.Kind, yyxt5) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - if true && x.What != nil { + if r.TryNil() { + if x.What != nil { // remove the if-true x.What = nil } } else { if x.What == nil { x.What = new(Ident) } - x.What.CodecDecodeSelf(d) } case "Type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = (string)(r.DecodeString()) - } + x.Type = (string)(string(r.DecodeStringAsBytes())) case "Code": - if r.TryDecodeAsNil() { - x.Code = nil - } else { - if false { - } else { - x.Code = r.DecodeBytes(([]byte)(x.Code), false) - } - } + x.Code = r.DecodeBytes(([]byte)(x.Code), false) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineTokenStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj11 int @@ -7771,283 +5707,215 @@ func (x *DefineTokenStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl11 { yyb11 = yyj11 > l } else { - yyb11 = r.CheckBreak() + yyb11 = z.DecCheckBreak() } if yyb11 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Kind = 0 + z.DecReadArrayElem() + if yyxt13 := z.Extension(z.I2Rtid(x.Kind)); yyxt13 != nil { + z.DecExtension(x.Kind, yyxt13) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Kind)); yyxt13 != nil { - z.DecExtension(x.Kind, yyxt13) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj11++ if yyhl11 { yyb11 = yyj11 > l } else { - yyb11 = r.CheckBreak() + yyb11 = z.DecCheckBreak() } if yyb11 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj11++ if yyhl11 { yyb11 = yyj11 > l } else { - yyb11 = r.CheckBreak() + yyb11 = z.DecCheckBreak() } if yyb11 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.What != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.What != nil { // remove the if-true x.What = nil } } else { if x.What == nil { x.What = new(Ident) } - x.What.CodecDecodeSelf(d) } yyj11++ if yyhl11 { yyb11 = yyj11 > l } else { - yyb11 = r.CheckBreak() + yyb11 = z.DecCheckBreak() } if yyb11 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Type = (string)(string(r.DecodeStringAsBytes())) yyj11++ if yyhl11 { yyb11 = yyj11 > l } else { - yyb11 = r.CheckBreak() + yyb11 = z.DecCheckBreak() } if yyb11 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Code = nil - } else { - if false { - } else { - x.Code = r.DecodeBytes(([]byte)(x.Code), false) - } - } + z.DecReadArrayElem() + x.Code = r.DecodeBytes(([]byte)(x.Code), false) for { yyj11++ if yyhl11 { yyb11 = yyj11 > l } else { - yyb11 = r.CheckBreak() + yyb11 = z.DecCheckBreak() } if yyb11 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj11-1, "") } - r.ReadArrayEnd() } func (x *RemoveTokenStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.Name == nil + var yyn5 bool = x.What == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + if yyxt6 := z.Extension(z.I2Rtid(x.Kind)); yyxt6 != nil { + z.EncExtension(x.Kind, yyxt6) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) + } else { + r.EncodeInt(int64(x.Kind)) + } + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + if yyn5 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) + z.EncWriteMapStart(3) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Kind\"") } else { - r.WriteMapStart(3) + r.EncodeString(`Kind`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Kind)); yyxt4 != nil { - z.EncExtension(x.Kind, yyxt4) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + z.EncWriteMapElemValue() + if yyxt9 := z.Extension(z.I2Rtid(x.Kind)); yyxt9 != nil { + z.EncExtension(x.Kind, yyxt9) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Kind) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Kind) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Kind\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Kind`) - } - r.WriteMapElemValue() - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.EncExtension(x.Kind, yyxt5) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Kind) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Kind) - } else { - r.EncodeInt(int64(x.Kind)) - } + r.EncodeInt(int64(x.Kind)) } - var yyn6 bool - if x.Name == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + r.EncodeString(`Name`) } - var yyn9 bool - if x.What == nil { - yyn9 = true - goto LABEL9 - } - LABEL9: - if yyr2 || yy2arr2 { - if yyn9 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if yyn9 { - r.EncodeNil() - } else { - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapEnd() + r.EncodeString(`What`) } + z.EncWriteMapElemValue() + if yyn5 { + r.EncodeNil() + } else { + x.What.CodecEncodeSelf(e) + } + z.EncWriteMapEnd() } } } func (x *RemoveTokenStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveTokenStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveTokenStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -8057,60 +5925,52 @@ func (x *RemoveTokenStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Kind": - if r.TryDecodeAsNil() { - x.Kind = 0 + if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { + z.DecExtension(x.Kind, yyxt5) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Kind)); yyxt5 != nil { - z.DecExtension(x.Kind, yyxt5) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - if true && x.What != nil { + if r.TryNil() { + if x.What != nil { // remove the if-true x.What = nil } } else { if x.What == nil { x.What = new(Ident) } - x.What.CodecDecodeSelf(d) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveTokenStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj8 int @@ -8120,67 +5980,60 @@ func (x *RemoveTokenStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Kind = 0 + z.DecReadArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Kind)); yyxt10 != nil { + z.DecExtension(x.Kind, yyxt10) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Kind) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Kind)); yyxt10 != nil { - z.DecExtension(x.Kind, yyxt10) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Kind) - } else { - x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Kind = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.What != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.What != nil { // remove the if-true x.What = nil } } else { if x.What == nil { x.What = new(Ident) } - x.What.CodecDecodeSelf(d) } for { @@ -8188,318 +6041,210 @@ func (x *RemoveTokenStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - r.ReadArrayEnd() } func (x *DefineScopeStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(8) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + if yyxt12 := z.Extension(z.I2Rtid(x.Time)); yyxt12 != nil { + z.EncExtension(x.Time, yyxt12) + } else { + r.EncodeInt(int64(x.Time)) + } + z.EncWriteArrayElem() + if x.Code == nil { + r.EncodeNil() + } else { + r.EncodeStringBytesRaw([]byte(x.Code)) + } // end block: if x.Code slice == nil + z.EncWriteArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Signup)); yyxt14 != nil { + z.EncExtension(x.Signup, yyxt14) + } else { + z.EncFallback(x.Signup) + } + z.EncWriteArrayElem() + if yyxt15 := z.Extension(z.I2Rtid(x.Signin)); yyxt15 != nil { + z.EncExtension(x.Signin, yyxt15) + } else { + z.EncFallback(x.Signin) + } + z.EncWriteArrayElem() + if yyxt16 := z.Extension(z.I2Rtid(x.Connect)); yyxt16 != nil { + z.EncExtension(x.Connect, yyxt16) + } else { + z.EncFallback(x.Connect) + } + z.EncWriteArrayElem() + if yyxt17 := z.Extension(z.I2Rtid(x.OnSignup)); yyxt17 != nil { + z.EncExtension(x.OnSignup, yyxt17) + } else { + z.EncFallback(x.OnSignup) + } + z.EncWriteArrayElem() + if yyxt18 := z.Extension(z.I2Rtid(x.OnSignin)); yyxt18 != nil { + z.EncExtension(x.OnSignin, yyxt18) + } else { + z.EncFallback(x.OnSignin) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(8) + z.EncWriteMapStart(8) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(8) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Time)); yyxt7 != nil { - z.EncExtension(x.Time, yyxt7) - } else { - r.EncodeInt(int64(x.Time)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Time\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Time\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Time`) - } - r.WriteMapElemValue() - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Time)); yyxt8 != nil { - z.EncExtension(x.Time, yyxt8) - } else { - r.EncodeInt(int64(x.Time)) - } + r.EncodeString(`Time`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Code == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Code)) - } - } + z.EncWriteMapElemValue() + if yyxt20 := z.Extension(z.I2Rtid(x.Time)); yyxt20 != nil { + z.EncExtension(x.Time, yyxt20) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Code\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Code`) - } - r.WriteMapElemValue() - if x.Code == nil { - r.EncodeNil() - } else { - if false { - } else { - r.EncodeStringBytesRaw([]byte(x.Code)) - } - } + r.EncodeInt(int64(x.Time)) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Signup == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Signup)); yyxt13 != nil { - z.EncExtension(x.Signup, yyxt13) - } else { - z.EncFallback(x.Signup) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Code\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Signup\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Signup`) - } - r.WriteMapElemValue() - if x.Signup == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Signup)); yyxt14 != nil { - z.EncExtension(x.Signup, yyxt14) - } else { - z.EncFallback(x.Signup) - } - } + r.EncodeString(`Code`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Signin == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt16 := z.Extension(z.I2Rtid(x.Signin)); yyxt16 != nil { - z.EncExtension(x.Signin, yyxt16) - } else { - z.EncFallback(x.Signin) - } - } + z.EncWriteMapElemValue() + if x.Code == nil { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Signin\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Signin`) - } - r.WriteMapElemValue() - if x.Signin == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt17 := z.Extension(z.I2Rtid(x.Signin)); yyxt17 != nil { - z.EncExtension(x.Signin, yyxt17) - } else { - z.EncFallback(x.Signin) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Connect == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Connect)); yyxt19 != nil { - z.EncExtension(x.Connect, yyxt19) - } else { - z.EncFallback(x.Connect) - } - } + r.EncodeStringBytesRaw([]byte(x.Code)) + } // end block: if x.Code slice == nil + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Signup\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Connect\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Connect`) - } - r.WriteMapElemValue() - if x.Connect == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt20 := z.Extension(z.I2Rtid(x.Connect)); yyxt20 != nil { - z.EncExtension(x.Connect, yyxt20) - } else { - z.EncFallback(x.Connect) - } - } + r.EncodeString(`Signup`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.OnSignup == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt22 := z.Extension(z.I2Rtid(x.OnSignup)); yyxt22 != nil { - z.EncExtension(x.OnSignup, yyxt22) - } else { - z.EncFallback(x.OnSignup) - } - } + z.EncWriteMapElemValue() + if yyxt22 := z.Extension(z.I2Rtid(x.Signup)); yyxt22 != nil { + z.EncExtension(x.Signup, yyxt22) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"OnSignup\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `OnSignup`) - } - r.WriteMapElemValue() - if x.OnSignup == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt23 := z.Extension(z.I2Rtid(x.OnSignup)); yyxt23 != nil { - z.EncExtension(x.OnSignup, yyxt23) - } else { - z.EncFallback(x.OnSignup) - } - } + z.EncFallback(x.Signup) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.OnSignin == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt25 := z.Extension(z.I2Rtid(x.OnSignin)); yyxt25 != nil { - z.EncExtension(x.OnSignin, yyxt25) - } else { - z.EncFallback(x.OnSignin) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Signin\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"OnSignin\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `OnSignin`) - } - r.WriteMapElemValue() - if x.OnSignin == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt26 := z.Extension(z.I2Rtid(x.OnSignin)); yyxt26 != nil { - z.EncExtension(x.OnSignin, yyxt26) - } else { - z.EncFallback(x.OnSignin) - } - } + r.EncodeString(`Signin`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyxt23 := z.Extension(z.I2Rtid(x.Signin)); yyxt23 != nil { + z.EncExtension(x.Signin, yyxt23) } else { - r.WriteMapEnd() + z.EncFallback(x.Signin) } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Connect\"") + } else { + r.EncodeString(`Connect`) + } + z.EncWriteMapElemValue() + if yyxt24 := z.Extension(z.I2Rtid(x.Connect)); yyxt24 != nil { + z.EncExtension(x.Connect, yyxt24) + } else { + z.EncFallback(x.Connect) + } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"OnSignup\"") + } else { + r.EncodeString(`OnSignup`) + } + z.EncWriteMapElemValue() + if yyxt25 := z.Extension(z.I2Rtid(x.OnSignup)); yyxt25 != nil { + z.EncExtension(x.OnSignup, yyxt25) + } else { + z.EncFallback(x.OnSignup) + } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"OnSignin\"") + } else { + r.EncodeString(`OnSignin`) + } + z.EncWriteMapElemValue() + if yyxt26 := z.Extension(z.I2Rtid(x.OnSignin)); yyxt26 != nil { + z.EncExtension(x.OnSignin, yyxt26) + } else { + z.EncFallback(x.OnSignin) + } + z.EncWriteMapEnd() } } } func (x *DefineScopeStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineScopeStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineScopeStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -8509,110 +6254,71 @@ func (x *DefineScopeStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "Time": - if r.TryDecodeAsNil() { - x.Time = 0 + if yyxt6 := z.Extension(z.I2Rtid(x.Time)); yyxt6 != nil { + z.DecExtension(x.Time, yyxt6) } else { - if false { - } else if yyxt6 := z.Extension(z.I2Rtid(x.Time)); yyxt6 != nil { - z.DecExtension(x.Time, yyxt6) - } else { - x.Time = (time.Duration)(r.DecodeInt64()) - } + x.Time = (time.Duration)(r.DecodeInt64()) } case "Code": - if r.TryDecodeAsNil() { - x.Code = nil - } else { - if false { - } else { - x.Code = r.DecodeBytes(([]byte)(x.Code), false) - } - } + x.Code = r.DecodeBytes(([]byte)(x.Code), false) case "Signup": - if r.TryDecodeAsNil() { - x.Signup = nil + if yyxt10 := z.Extension(z.I2Rtid(x.Signup)); yyxt10 != nil { + z.DecExtension(x.Signup, yyxt10) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Signup)); yyxt10 != nil { - z.DecExtension(x.Signup, yyxt10) - } else { - z.DecFallback(&x.Signup, true) - } + z.DecFallback(&x.Signup, true) } case "Signin": - if r.TryDecodeAsNil() { - x.Signin = nil + if yyxt12 := z.Extension(z.I2Rtid(x.Signin)); yyxt12 != nil { + z.DecExtension(x.Signin, yyxt12) } else { - if false { - } else if yyxt12 := z.Extension(z.I2Rtid(x.Signin)); yyxt12 != nil { - z.DecExtension(x.Signin, yyxt12) - } else { - z.DecFallback(&x.Signin, true) - } + z.DecFallback(&x.Signin, true) } case "Connect": - if r.TryDecodeAsNil() { - x.Connect = nil + if yyxt14 := z.Extension(z.I2Rtid(x.Connect)); yyxt14 != nil { + z.DecExtension(x.Connect, yyxt14) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Connect)); yyxt14 != nil { - z.DecExtension(x.Connect, yyxt14) - } else { - z.DecFallback(&x.Connect, true) - } + z.DecFallback(&x.Connect, true) } case "OnSignup": - if r.TryDecodeAsNil() { - x.OnSignup = nil + if yyxt16 := z.Extension(z.I2Rtid(x.OnSignup)); yyxt16 != nil { + z.DecExtension(x.OnSignup, yyxt16) } else { - if false { - } else if yyxt16 := z.Extension(z.I2Rtid(x.OnSignup)); yyxt16 != nil { - z.DecExtension(x.OnSignup, yyxt16) - } else { - z.DecFallback(&x.OnSignup, true) - } + z.DecFallback(&x.OnSignup, true) } case "OnSignin": - if r.TryDecodeAsNil() { - x.OnSignin = nil + if yyxt18 := z.Extension(z.I2Rtid(x.OnSignin)); yyxt18 != nil { + z.DecExtension(x.OnSignin, yyxt18) } else { - if false { - } else if yyxt18 := z.Extension(z.I2Rtid(x.OnSignin)); yyxt18 != nil { - z.DecExtension(x.OnSignin, yyxt18) - } else { - z.DecFallback(&x.OnSignin, true) - } + z.DecFallback(&x.OnSignin, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineScopeStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj19 int @@ -8622,281 +6328,214 @@ func (x *DefineScopeStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl19 { yyb19 = yyj19 > l } else { - yyb19 = r.CheckBreak() + yyb19 = z.DecCheckBreak() } if yyb19 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj19++ if yyhl19 { yyb19 = yyj19 > l } else { - yyb19 = r.CheckBreak() + yyb19 = z.DecCheckBreak() } if yyb19 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Time = 0 + z.DecReadArrayElem() + if yyxt22 := z.Extension(z.I2Rtid(x.Time)); yyxt22 != nil { + z.DecExtension(x.Time, yyxt22) } else { - if false { - } else if yyxt22 := z.Extension(z.I2Rtid(x.Time)); yyxt22 != nil { - z.DecExtension(x.Time, yyxt22) - } else { - x.Time = (time.Duration)(r.DecodeInt64()) - } + x.Time = (time.Duration)(r.DecodeInt64()) } yyj19++ if yyhl19 { yyb19 = yyj19 > l } else { - yyb19 = r.CheckBreak() + yyb19 = z.DecCheckBreak() } if yyb19 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Code = nil + z.DecReadArrayElem() + x.Code = r.DecodeBytes(([]byte)(x.Code), false) + yyj19++ + if yyhl19 { + yyb19 = yyj19 > l } else { - if false { - } else { - x.Code = r.DecodeBytes(([]byte)(x.Code), false) - } + yyb19 = z.DecCheckBreak() + } + if yyb19 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt26 := z.Extension(z.I2Rtid(x.Signup)); yyxt26 != nil { + z.DecExtension(x.Signup, yyxt26) + } else { + z.DecFallback(&x.Signup, true) } yyj19++ if yyhl19 { yyb19 = yyj19 > l } else { - yyb19 = r.CheckBreak() + yyb19 = z.DecCheckBreak() } if yyb19 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Signup = nil + z.DecReadArrayElem() + if yyxt28 := z.Extension(z.I2Rtid(x.Signin)); yyxt28 != nil { + z.DecExtension(x.Signin, yyxt28) } else { - if false { - } else if yyxt26 := z.Extension(z.I2Rtid(x.Signup)); yyxt26 != nil { - z.DecExtension(x.Signup, yyxt26) - } else { - z.DecFallback(&x.Signup, true) - } + z.DecFallback(&x.Signin, true) } yyj19++ if yyhl19 { yyb19 = yyj19 > l } else { - yyb19 = r.CheckBreak() + yyb19 = z.DecCheckBreak() } if yyb19 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Signin = nil + z.DecReadArrayElem() + if yyxt30 := z.Extension(z.I2Rtid(x.Connect)); yyxt30 != nil { + z.DecExtension(x.Connect, yyxt30) } else { - if false { - } else if yyxt28 := z.Extension(z.I2Rtid(x.Signin)); yyxt28 != nil { - z.DecExtension(x.Signin, yyxt28) - } else { - z.DecFallback(&x.Signin, true) - } + z.DecFallback(&x.Connect, true) } yyj19++ if yyhl19 { yyb19 = yyj19 > l } else { - yyb19 = r.CheckBreak() + yyb19 = z.DecCheckBreak() } if yyb19 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Connect = nil + z.DecReadArrayElem() + if yyxt32 := z.Extension(z.I2Rtid(x.OnSignup)); yyxt32 != nil { + z.DecExtension(x.OnSignup, yyxt32) } else { - if false { - } else if yyxt30 := z.Extension(z.I2Rtid(x.Connect)); yyxt30 != nil { - z.DecExtension(x.Connect, yyxt30) - } else { - z.DecFallback(&x.Connect, true) - } + z.DecFallback(&x.OnSignup, true) } yyj19++ if yyhl19 { yyb19 = yyj19 > l } else { - yyb19 = r.CheckBreak() + yyb19 = z.DecCheckBreak() } if yyb19 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.OnSignup = nil + z.DecReadArrayElem() + if yyxt34 := z.Extension(z.I2Rtid(x.OnSignin)); yyxt34 != nil { + z.DecExtension(x.OnSignin, yyxt34) } else { - if false { - } else if yyxt32 := z.Extension(z.I2Rtid(x.OnSignup)); yyxt32 != nil { - z.DecExtension(x.OnSignup, yyxt32) - } else { - z.DecFallback(&x.OnSignup, true) - } - } - yyj19++ - if yyhl19 { - yyb19 = yyj19 > l - } else { - yyb19 = r.CheckBreak() - } - if yyb19 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.OnSignin = nil - } else { - if false { - } else if yyxt34 := z.Extension(z.I2Rtid(x.OnSignin)); yyxt34 != nil { - z.DecExtension(x.OnSignin, yyxt34) - } else { - z.DecFallback(&x.OnSignin, true) - } + z.DecFallback(&x.OnSignin, true) } for { yyj19++ if yyhl19 { yyb19 = yyj19 > l } else { - yyb19 = r.CheckBreak() + yyb19 = z.DecCheckBreak() } if yyb19 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj19-1, "") } - r.ReadArrayEnd() } func (x *RemoveScopeStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + x.Name.CodecEncodeSelf(e) } + z.EncWriteMapEnd() } } } func (x *RemoveScopeStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveScopeStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveScopeStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -8906,35 +6545,33 @@ func (x *RemoveScopeStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveScopeStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -8944,22 +6581,21 @@ func (x *RemoveScopeStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } for { @@ -8967,335 +6603,200 @@ func (x *RemoveScopeStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x *DefineTableStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(11) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Full)) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Vers)) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Drop)) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Lock)) + z.EncWriteArrayElem() + x.Expr.CodecEncodeSelf(e) + z.EncWriteArrayElem() + x.From.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt22 := z.Extension(z.I2Rtid(x.Cond)); yyxt22 != nil { + z.EncExtension(x.Cond, yyxt22) + } else { + z.EncFallback(x.Cond) + } + z.EncWriteArrayElem() + x.Group.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt24 := z.Extension(z.I2Rtid(x.Perms)); yyxt24 != nil { + z.EncExtension(x.Perms, yyxt24) + } else { + z.EncFallback(x.Perms) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(11) + z.EncWriteMapStart(11) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(11) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Full)) - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Full\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Full\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Full`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Full)) - } + r.EncodeString(`Full`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Vers)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Full)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Vers\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Vers\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Vers`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Vers)) - } + r.EncodeString(`Vers`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Drop)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Vers)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Drop\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Drop\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Drop`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Drop)) - } + r.EncodeString(`Drop`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Lock)) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Drop)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Lock\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Lock\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Lock`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Lock)) - } + r.EncodeString(`Lock`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - x.Expr.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Lock)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - x.Expr.CodecEncodeSelf(e) - } + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.From == nil { - r.EncodeNil() - } else { - x.From.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.Expr.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"From\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"From\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `From`) - } - r.WriteMapElemValue() - if x.From == nil { - r.EncodeNil() - } else { - x.From.CodecEncodeSelf(e) - } + r.EncodeString(`From`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt28 := z.Extension(z.I2Rtid(x.Cond)); yyxt28 != nil { - z.EncExtension(x.Cond, yyxt28) - } else { - z.EncFallback(x.Cond) - } - } + z.EncWriteMapElemValue() + x.From.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Cond\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Cond\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Cond`) - } - r.WriteMapElemValue() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt29 := z.Extension(z.I2Rtid(x.Cond)); yyxt29 != nil { - z.EncExtension(x.Cond, yyxt29) - } else { - z.EncFallback(x.Cond) - } - } + r.EncodeString(`Cond`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Group == nil { - r.EncodeNil() - } else { - x.Group.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + if yyxt33 := z.Extension(z.I2Rtid(x.Cond)); yyxt33 != nil { + z.EncExtension(x.Cond, yyxt33) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Group\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Group`) - } - r.WriteMapElemValue() - if x.Group == nil { - r.EncodeNil() - } else { - x.Group.CodecEncodeSelf(e) - } + z.EncFallback(x.Cond) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Perms == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt34 := z.Extension(z.I2Rtid(x.Perms)); yyxt34 != nil { - z.EncExtension(x.Perms, yyxt34) - } else { - z.EncFallback(x.Perms) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Group\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Perms\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Perms`) - } - r.WriteMapElemValue() - if x.Perms == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt35 := z.Extension(z.I2Rtid(x.Perms)); yyxt35 != nil { - z.EncExtension(x.Perms, yyxt35) - } else { - z.EncFallback(x.Perms) - } - } + r.EncodeString(`Group`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + x.Group.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Perms\"") } else { - r.WriteMapEnd() + r.EncodeString(`Perms`) } + z.EncWriteMapElemValue() + if yyxt35 := z.Extension(z.I2Rtid(x.Perms)); yyxt35 != nil { + z.EncExtension(x.Perms, yyxt35) + } else { + z.EncFallback(x.Perms) + } + z.EncWriteMapEnd() } } } func (x *DefineTableStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineTableStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineTableStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -9305,105 +6806,61 @@ func (x *DefineTableStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Full": - if r.TryDecodeAsNil() { - x.Full = false - } else { - x.Full = (bool)(r.DecodeBool()) - } + x.Full = (bool)(r.DecodeBool()) case "Vers": - if r.TryDecodeAsNil() { - x.Vers = false - } else { - x.Vers = (bool)(r.DecodeBool()) - } + x.Vers = (bool)(r.DecodeBool()) case "Drop": - if r.TryDecodeAsNil() { - x.Drop = false - } else { - x.Drop = (bool)(r.DecodeBool()) - } + x.Drop = (bool)(r.DecodeBool()) case "Lock": - if r.TryDecodeAsNil() { - x.Lock = false - } else { - x.Lock = (bool)(r.DecodeBool()) - } + x.Lock = (bool)(r.DecodeBool()) case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - x.Expr.CodecDecodeSelf(d) - } + x.Expr.CodecDecodeSelf(d) case "From": - if r.TryDecodeAsNil() { - x.From = nil - } else { - x.From.CodecDecodeSelf(d) - } + x.From.CodecDecodeSelf(d) case "Cond": - if r.TryDecodeAsNil() { - x.Cond = nil + if yyxt13 := z.Extension(z.I2Rtid(x.Cond)); yyxt13 != nil { + z.DecExtension(x.Cond, yyxt13) } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Cond)); yyxt13 != nil { - z.DecExtension(x.Cond, yyxt13) - } else { - z.DecFallback(&x.Cond, true) - } + z.DecFallback(&x.Cond, true) } case "Group": - if r.TryDecodeAsNil() { - x.Group = nil - } else { - x.Group.CodecDecodeSelf(d) - } + x.Group.CodecDecodeSelf(d) case "Perms": - if r.TryDecodeAsNil() { - x.Perms = nil + if yyxt16 := z.Extension(z.I2Rtid(x.Perms)); yyxt16 != nil { + z.DecExtension(x.Perms, yyxt16) } else { - if false { - } else if yyxt16 := z.Extension(z.I2Rtid(x.Perms)); yyxt16 != nil { - z.DecExtension(x.Perms, yyxt16) - } else { - z.DecFallback(&x.Perms, true) - } + z.DecFallback(&x.Perms, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineTableStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj17 int @@ -9413,291 +6870,224 @@ func (x *DefineTableStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl17 { yyb17 = yyj17 > l } else { - yyb17 = r.CheckBreak() + yyb17 = z.DecCheckBreak() } if yyb17 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj17++ if yyhl17 { yyb17 = yyj17 > l } else { - yyb17 = r.CheckBreak() + yyb17 = z.DecCheckBreak() } if yyb17 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) + yyj17++ + if yyhl17 { + yyb17 = yyj17 > l } else { - x.What.CodecDecodeSelf(d) + yyb17 = z.DecCheckBreak() + } + if yyb17 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Full = (bool)(r.DecodeBool()) + yyj17++ + if yyhl17 { + yyb17 = yyj17 > l + } else { + yyb17 = z.DecCheckBreak() + } + if yyb17 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Vers = (bool)(r.DecodeBool()) + yyj17++ + if yyhl17 { + yyb17 = yyj17 > l + } else { + yyb17 = z.DecCheckBreak() + } + if yyb17 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Drop = (bool)(r.DecodeBool()) + yyj17++ + if yyhl17 { + yyb17 = yyj17 > l + } else { + yyb17 = z.DecCheckBreak() + } + if yyb17 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Lock = (bool)(r.DecodeBool()) + yyj17++ + if yyhl17 { + yyb17 = yyj17 > l + } else { + yyb17 = z.DecCheckBreak() + } + if yyb17 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Expr.CodecDecodeSelf(d) + yyj17++ + if yyhl17 { + yyb17 = yyj17 > l + } else { + yyb17 = z.DecCheckBreak() + } + if yyb17 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.From.CodecDecodeSelf(d) + yyj17++ + if yyhl17 { + yyb17 = yyj17 > l + } else { + yyb17 = z.DecCheckBreak() + } + if yyb17 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt27 := z.Extension(z.I2Rtid(x.Cond)); yyxt27 != nil { + z.DecExtension(x.Cond, yyxt27) + } else { + z.DecFallback(&x.Cond, true) } yyj17++ if yyhl17 { yyb17 = yyj17 > l } else { - yyb17 = r.CheckBreak() + yyb17 = z.DecCheckBreak() } if yyb17 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Full = false - } else { - x.Full = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Group.CodecDecodeSelf(d) yyj17++ if yyhl17 { yyb17 = yyj17 > l } else { - yyb17 = r.CheckBreak() + yyb17 = z.DecCheckBreak() } if yyb17 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Vers = false + z.DecReadArrayElem() + if yyxt30 := z.Extension(z.I2Rtid(x.Perms)); yyxt30 != nil { + z.DecExtension(x.Perms, yyxt30) } else { - x.Vers = (bool)(r.DecodeBool()) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Drop = false - } else { - x.Drop = (bool)(r.DecodeBool()) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Lock = false - } else { - x.Lock = (bool)(r.DecodeBool()) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - x.Expr.CodecDecodeSelf(d) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.From = nil - } else { - x.From.CodecDecodeSelf(d) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cond = nil - } else { - if false { - } else if yyxt27 := z.Extension(z.I2Rtid(x.Cond)); yyxt27 != nil { - z.DecExtension(x.Cond, yyxt27) - } else { - z.DecFallback(&x.Cond, true) - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Group = nil - } else { - x.Group.CodecDecodeSelf(d) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Perms = nil - } else { - if false { - } else if yyxt30 := z.Extension(z.I2Rtid(x.Perms)); yyxt30 != nil { - z.DecExtension(x.Perms, yyxt30) - } else { - z.DecFallback(&x.Perms, true) - } + z.DecFallback(&x.Perms, true) } for { yyj17++ if yyhl17 { yyb17 = yyj17 > l } else { - yyb17 = r.CheckBreak() + yyb17 = z.DecCheckBreak() } if yyb17 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj17-1, "") } - r.ReadArrayEnd() } func (x *RemoveTableStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`What`) } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *RemoveTableStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveTableStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveTableStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -9707,29 +7097,24 @@ func (x *RemoveTableStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveTableStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -9739,213 +7124,143 @@ func (x *RemoveTableStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) for { yyj5++ if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x *DefineEventStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(4) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt9 := z.Extension(z.I2Rtid(x.When)); yyxt9 != nil { + z.EncExtension(x.When, yyxt9) + } else { + z.EncFallback(x.When) + } + z.EncWriteArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Then)); yyxt10 != nil { + z.EncExtension(x.Then, yyxt10) + } else { + z.EncFallback(x.Then) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) + z.EncWriteMapStart(4) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(4) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.When == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.When)); yyxt10 != nil { - z.EncExtension(x.When, yyxt10) - } else { - z.EncFallback(x.When) - } - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"When\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"When\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `When`) - } - r.WriteMapElemValue() - if x.When == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.When)); yyxt11 != nil { - z.EncExtension(x.When, yyxt11) - } else { - z.EncFallback(x.When) - } - } + r.EncodeString(`When`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Then == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Then)); yyxt13 != nil { - z.EncExtension(x.Then, yyxt13) - } else { - z.EncFallback(x.Then) - } - } + z.EncWriteMapElemValue() + if yyxt13 := z.Extension(z.I2Rtid(x.When)); yyxt13 != nil { + z.EncExtension(x.When, yyxt13) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Then\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Then`) - } - r.WriteMapElemValue() - if x.Then == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Then)); yyxt14 != nil { - z.EncExtension(x.Then, yyxt14) - } else { - z.EncFallback(x.Then) - } - } + z.EncFallback(x.When) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Then\"") } else { - r.WriteMapEnd() + r.EncodeString(`Then`) } + z.EncWriteMapElemValue() + if yyxt14 := z.Extension(z.I2Rtid(x.Then)); yyxt14 != nil { + z.EncExtension(x.Then, yyxt14) + } else { + z.EncFallback(x.Then) + } + z.EncWriteMapEnd() } } } func (x *DefineEventStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineEventStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineEventStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -9955,63 +7270,47 @@ func (x *DefineEventStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "When": - if r.TryDecodeAsNil() { - x.When = nil + if yyxt7 := z.Extension(z.I2Rtid(x.When)); yyxt7 != nil { + z.DecExtension(x.When, yyxt7) } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.When)); yyxt7 != nil { - z.DecExtension(x.When, yyxt7) - } else { - z.DecFallback(&x.When, true) - } + z.DecFallback(&x.When, true) } case "Then": - if r.TryDecodeAsNil() { - x.Then = nil + if yyxt9 := z.Extension(z.I2Rtid(x.Then)); yyxt9 != nil { + z.DecExtension(x.Then, yyxt9) } else { - if false { - } else if yyxt9 := z.Extension(z.I2Rtid(x.Then)); yyxt9 != nil { - z.DecExtension(x.Then, yyxt9) - } else { - z.DecFallback(&x.Then, true) - } + z.DecFallback(&x.Then, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineEventStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj10 int @@ -10021,215 +7320,160 @@ func (x *DefineEventStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l } else { - x.What.CodecDecodeSelf(d) + yyb10 = z.DecCheckBreak() + } + if yyb10 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.When)); yyxt14 != nil { + z.DecExtension(x.When, yyxt14) + } else { + z.DecFallback(&x.When, true) } yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.When = nil + z.DecReadArrayElem() + if yyxt16 := z.Extension(z.I2Rtid(x.Then)); yyxt16 != nil { + z.DecExtension(x.Then, yyxt16) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.When)); yyxt14 != nil { - z.DecExtension(x.When, yyxt14) - } else { - z.DecFallback(&x.When, true) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Then = nil - } else { - if false { - } else if yyxt16 := z.Extension(z.I2Rtid(x.Then)); yyxt16 != nil { - z.DecExtension(x.Then, yyxt16) - } else { - z.DecFallback(&x.Then, true) - } + z.DecFallback(&x.Then, true) } for { yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj10-1, "") } - r.ReadArrayEnd() } func (x *RemoveEventStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(2) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`What`) } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *RemoveEventStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveEventStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveEventStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -10239,41 +7483,35 @@ func (x *RemoveEventStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveEventStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -10283,323 +7521,212 @@ func (x *RemoveEventStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *DefineFieldStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(8) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + if yyxt13 := z.Extension(z.I2Rtid(x.Perms)); yyxt13 != nil { + z.EncExtension(x.Perms, yyxt13) + } else { + z.EncFallback(x.Perms) + } + z.EncWriteArrayElem() + r.EncodeString(string(x.Type)) + z.EncWriteArrayElem() + r.EncodeString(string(x.Kind)) + z.EncWriteArrayElem() + if yyxt16 := z.Extension(z.I2Rtid(x.Value)); yyxt16 != nil { + z.EncExtension(x.Value, yyxt16) + } else { + z.EncFallback(x.Value) + } + z.EncWriteArrayElem() + if yyxt17 := z.Extension(z.I2Rtid(x.Assert)); yyxt17 != nil { + z.EncExtension(x.Assert, yyxt17) + } else { + z.EncFallback(x.Assert) + } + z.EncWriteArrayElem() + r.EncodeFloat64(float64(x.Priority)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(8) + z.EncWriteMapStart(8) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(8) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Perms == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Perms)); yyxt10 != nil { - z.EncExtension(x.Perms, yyxt10) - } else { - z.EncFallback(x.Perms) - } - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Perms\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Perms\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Perms`) - } - r.WriteMapElemValue() - if x.Perms == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Perms)); yyxt11 != nil { - z.EncExtension(x.Perms, yyxt11) - } else { - z.EncFallback(x.Perms) - } - } + r.EncodeString(`Perms`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Type)) - } + z.EncWriteMapElemValue() + if yyxt21 := z.Extension(z.I2Rtid(x.Perms)); yyxt21 != nil { + z.EncExtension(x.Perms, yyxt21) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Type\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Type`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Type)) - } + z.EncFallback(x.Perms) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Kind)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Type\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Kind\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Kind`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Kind)) - } + r.EncodeString(`Type`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Value == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Value)); yyxt19 != nil { - z.EncExtension(x.Value, yyxt19) - } else { - z.EncFallback(x.Value) - } - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Type)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Kind\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Value\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Value`) - } - r.WriteMapElemValue() - if x.Value == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt20 := z.Extension(z.I2Rtid(x.Value)); yyxt20 != nil { - z.EncExtension(x.Value, yyxt20) - } else { - z.EncFallback(x.Value) - } - } + r.EncodeString(`Kind`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Assert == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt22 := z.Extension(z.I2Rtid(x.Assert)); yyxt22 != nil { - z.EncExtension(x.Assert, yyxt22) - } else { - z.EncFallback(x.Assert) - } - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Kind)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Value\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Assert\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Assert`) - } - r.WriteMapElemValue() - if x.Assert == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt23 := z.Extension(z.I2Rtid(x.Assert)); yyxt23 != nil { - z.EncExtension(x.Assert, yyxt23) - } else { - z.EncFallback(x.Assert) - } - } + r.EncodeString(`Value`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeFloat64(float64(x.Priority)) - } + z.EncWriteMapElemValue() + if yyxt24 := z.Extension(z.I2Rtid(x.Value)); yyxt24 != nil { + z.EncExtension(x.Value, yyxt24) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Priority\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Priority`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeFloat64(float64(x.Priority)) - } + z.EncFallback(x.Value) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Assert\"") } else { - r.WriteMapEnd() + r.EncodeString(`Assert`) } + z.EncWriteMapElemValue() + if yyxt25 := z.Extension(z.I2Rtid(x.Assert)); yyxt25 != nil { + z.EncExtension(x.Assert, yyxt25) + } else { + z.EncFallback(x.Assert) + } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Priority\"") + } else { + r.EncodeString(`Priority`) + } + z.EncWriteMapElemValue() + r.EncodeFloat64(float64(x.Priority)) + z.EncWriteMapEnd() } } } func (x *DefineFieldStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineFieldStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineFieldStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -10609,92 +7736,59 @@ func (x *DefineFieldStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Perms": - if r.TryDecodeAsNil() { - x.Perms = nil + if yyxt7 := z.Extension(z.I2Rtid(x.Perms)); yyxt7 != nil { + z.DecExtension(x.Perms, yyxt7) } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Perms)); yyxt7 != nil { - z.DecExtension(x.Perms, yyxt7) - } else { - z.DecFallback(&x.Perms, true) - } + z.DecFallback(&x.Perms, true) } case "Type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = (string)(r.DecodeString()) - } + x.Type = (string)(string(r.DecodeStringAsBytes())) case "Kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = (string)(r.DecodeString()) - } + x.Kind = (string)(string(r.DecodeStringAsBytes())) case "Value": - if r.TryDecodeAsNil() { - x.Value = nil + if yyxt11 := z.Extension(z.I2Rtid(x.Value)); yyxt11 != nil { + z.DecExtension(x.Value, yyxt11) } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Value)); yyxt11 != nil { - z.DecExtension(x.Value, yyxt11) - } else { - z.DecFallback(&x.Value, true) - } + z.DecFallback(&x.Value, true) } case "Assert": - if r.TryDecodeAsNil() { - x.Assert = nil + if yyxt13 := z.Extension(z.I2Rtid(x.Assert)); yyxt13 != nil { + z.DecExtension(x.Assert, yyxt13) } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Assert)); yyxt13 != nil { - z.DecExtension(x.Assert, yyxt13) - } else { - z.DecFallback(&x.Assert, true) - } + z.DecFallback(&x.Assert, true) } case "Priority": - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - x.Priority = (float64)(r.DecodeFloat64()) - } + x.Priority = (float64)(r.DecodeFloat64()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineFieldStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj15 int @@ -10704,284 +7798,212 @@ func (x *DefineFieldStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl15 { yyb15 = yyj15 > l } else { - yyb15 = r.CheckBreak() + yyb15 = z.DecCheckBreak() } if yyb15 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj15++ if yyhl15 { yyb15 = yyj15 > l } else { - yyb15 = r.CheckBreak() + yyb15 = z.DecCheckBreak() } if yyb15 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l } else { - x.What.CodecDecodeSelf(d) + yyb15 = z.DecCheckBreak() + } + if yyb15 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt19 := z.Extension(z.I2Rtid(x.Perms)); yyxt19 != nil { + z.DecExtension(x.Perms, yyxt19) + } else { + z.DecFallback(&x.Perms, true) } yyj15++ if yyhl15 { yyb15 = yyj15 > l } else { - yyb15 = r.CheckBreak() + yyb15 = z.DecCheckBreak() } if yyb15 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Perms = nil + z.DecReadArrayElem() + x.Type = (string)(string(r.DecodeStringAsBytes())) + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l } else { - if false { - } else if yyxt19 := z.Extension(z.I2Rtid(x.Perms)); yyxt19 != nil { - z.DecExtension(x.Perms, yyxt19) - } else { - z.DecFallback(&x.Perms, true) - } + yyb15 = z.DecCheckBreak() + } + if yyb15 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + x.Kind = (string)(string(r.DecodeStringAsBytes())) + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = z.DecCheckBreak() + } + if yyb15 { + z.DecReadArrayEnd() + return + } + z.DecReadArrayElem() + if yyxt23 := z.Extension(z.I2Rtid(x.Value)); yyxt23 != nil { + z.DecExtension(x.Value, yyxt23) + } else { + z.DecFallback(&x.Value, true) } yyj15++ if yyhl15 { yyb15 = yyj15 > l } else { - yyb15 = r.CheckBreak() + yyb15 = z.DecCheckBreak() } if yyb15 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Type = "" + z.DecReadArrayElem() + if yyxt25 := z.Extension(z.I2Rtid(x.Assert)); yyxt25 != nil { + z.DecExtension(x.Assert, yyxt25) } else { - x.Type = (string)(r.DecodeString()) + z.DecFallback(&x.Assert, true) } yyj15++ if yyhl15 { yyb15 = yyj15 > l } else { - yyb15 = r.CheckBreak() + yyb15 = z.DecCheckBreak() } if yyb15 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = (string)(r.DecodeString()) - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Value = nil - } else { - if false { - } else if yyxt23 := z.Extension(z.I2Rtid(x.Value)); yyxt23 != nil { - z.DecExtension(x.Value, yyxt23) - } else { - z.DecFallback(&x.Value, true) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Assert = nil - } else { - if false { - } else if yyxt25 := z.Extension(z.I2Rtid(x.Assert)); yyxt25 != nil { - z.DecExtension(x.Assert, yyxt25) - } else { - z.DecFallback(&x.Assert, true) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - x.Priority = (float64)(r.DecodeFloat64()) - } + z.DecReadArrayElem() + x.Priority = (float64)(r.DecodeFloat64()) for { yyj15++ if yyhl15 { yyb15 = yyj15 > l } else { - yyb15 = r.CheckBreak() + yyb15 = z.DecCheckBreak() } if yyb15 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj15-1, "") } - r.ReadArrayEnd() } func (x *RemoveFieldStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(2) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`What`) } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *RemoveFieldStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveFieldStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveFieldStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -10991,41 +8013,35 @@ func (x *RemoveFieldStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveFieldStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -11035,213 +8051,148 @@ func (x *RemoveFieldStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *DefineIndexStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(4) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayElem() + x.Cols.CodecEncodeSelf(e) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Uniq)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) + z.EncWriteMapStart(4) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(4) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Cols == nil { - r.EncodeNil() - } else { - x.Cols.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Cols\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Cols\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Cols`) - } - r.WriteMapElemValue() - if x.Cols == nil { - r.EncodeNil() - } else { - x.Cols.CodecEncodeSelf(e) - } + r.EncodeString(`Cols`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Uniq)) - } + z.EncWriteMapElemValue() + x.Cols.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Uniq\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Uniq\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Uniq`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Uniq)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`Uniq`) } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Uniq)) + z.EncWriteMapEnd() } } } func (x *DefineIndexStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DefineIndexStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DefineIndexStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -11251,53 +8202,39 @@ func (x *DefineIndexStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Cols": - if r.TryDecodeAsNil() { - x.Cols = nil - } else { - x.Cols.CodecDecodeSelf(d) - } + x.Cols.CodecDecodeSelf(d) case "Uniq": - if r.TryDecodeAsNil() { - x.Uniq = false - } else { - x.Uniq = (bool)(r.DecodeBool()) - } + x.Uniq = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DefineIndexStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj8 int @@ -11307,205 +8244,152 @@ func (x *DefineIndexStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cols = nil - } else { - x.Cols.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.Cols.CodecDecodeSelf(d) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Uniq = false - } else { - x.Uniq = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Uniq = (bool)(r.DecodeBool()) for { yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - r.ReadArrayEnd() } func (x *RemoveIndexStatement) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + if yyn3 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(2) + r.EncodeString(`Name`) } - var yyn3 bool - if x.Name == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { - if yyn3 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn3 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn3 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`What`) } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *RemoveIndexStatement) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = RemoveIndexStatement{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *RemoveIndexStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -11515,41 +8399,35 @@ func (x *RemoveIndexStatement) codecDecodeSelfFromMap(l int, d *codec1978.Decode break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *RemoveIndexStatement) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -11559,144 +8437,116 @@ func (x *RemoveIndexStatement) codecDecodeSelfFromArray(l int, d *codec1978.Deco if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x Exprs) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encExprs((Exprs)(x), e) - } - } + h.encExprs((Exprs)(x), e) + } // end block: if x slice == nil } func (x *Exprs) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decExprs((*Exprs)(x), d) - } + h.decExprs((*Exprs)(x), d) } func (x *All) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(0) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapStart(0) + z.EncWriteMapEnd() } } } func (x *All) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = All{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *All) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -11706,23 +8556,22 @@ func (x *All) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *All) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj4 int @@ -11733,77 +8582,64 @@ func (x *All) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl4 { yyb4 = yyj4 > l } else { - yyb4 = r.CheckBreak() + yyb4 = z.DecCheckBreak() } if yyb4 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj4-1, "") } - r.ReadArrayEnd() } func (x *Any) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(0) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapStart(0) + z.EncWriteMapEnd() } } } func (x *Any) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Any{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Any) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -11813,23 +8649,22 @@ func (x *Any) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Any) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj4 int @@ -11840,77 +8675,64 @@ func (x *Any) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl4 { yyb4 = yyj4 > l } else { - yyb4 = r.CheckBreak() + yyb4 = z.DecCheckBreak() } if yyb4 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj4-1, "") } - r.ReadArrayEnd() } func (x *Null) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(0) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapStart(0) + z.EncWriteMapEnd() } } } func (x *Null) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Null{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Null) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -11920,23 +8742,22 @@ func (x *Null) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Null) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj4 int @@ -11947,77 +8768,64 @@ func (x *Null) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl4 { yyb4 = yyj4 > l } else { - yyb4 = r.CheckBreak() + yyb4 = z.DecCheckBreak() } if yyb4 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj4-1, "") } - r.ReadArrayEnd() } func (x *Void) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(0) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapStart(0) + z.EncWriteMapEnd() } } } func (x *Void) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Void{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Void) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -12027,23 +8835,22 @@ func (x *Void) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Void) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj4 int @@ -12054,77 +8861,64 @@ func (x *Void) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl4 { yyb4 = yyj4 > l } else { - yyb4 = r.CheckBreak() + yyb4 = z.DecCheckBreak() } if yyb4 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj4-1, "") } - r.ReadArrayEnd() } func (x *Empty) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(0) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + z.EncWriteMapStart(0) + z.EncWriteMapEnd() } } } func (x *Empty) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Empty{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Empty) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -12134,23 +8928,22 @@ func (x *Empty) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Empty) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj4 int @@ -12161,146 +8954,102 @@ func (x *Empty) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl4 { yyb4 = yyj4 > l } else { - yyb4 = r.CheckBreak() + yyb4 = z.DecCheckBreak() } if yyb4 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj4-1, "") } - r.ReadArrayEnd() } func (x *Field) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + if yyxt6 := z.Extension(z.I2Rtid(x.Expr)); yyxt6 != nil { + z.EncExtension(x.Expr, yyxt6) + } else { + z.EncFallback(x.Expr) + } + z.EncWriteArrayElem() + r.EncodeString(string(x.Field)) + z.EncWriteArrayElem() + r.EncodeString(string(x.Alias)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) + z.EncWriteMapStart(3) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapStart(3) + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Expr)); yyxt4 != nil { - z.EncExtension(x.Expr, yyxt4) - } else { - z.EncFallback(x.Expr) - } - } + z.EncWriteMapElemValue() + if yyxt9 := z.Extension(z.I2Rtid(x.Expr)); yyxt9 != nil { + z.EncExtension(x.Expr, yyxt9) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.EncExtension(x.Expr, yyxt5) - } else { - z.EncFallback(x.Expr) - } - } + z.EncFallback(x.Expr) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Field)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Field\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Field\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Field`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Field)) - } + r.EncodeString(`Field`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Alias)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Field)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Alias\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Alias\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Alias`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Alias)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`Alias`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Alias)) + z.EncWriteMapEnd() } } } func (x *Field) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Field{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Field) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -12310,46 +9059,32 @@ func (x *Field) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { + z.DecExtension(x.Expr, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.DecExtension(x.Expr, yyxt5) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } case "Field": - if r.TryDecodeAsNil() { - x.Field = "" - } else { - x.Field = (string)(r.DecodeString()) - } + x.Field = (string)(string(r.DecodeStringAsBytes())) case "Alias": - if r.TryDecodeAsNil() { - x.Alias = "" - } else { - x.Alias = (string)(r.DecodeString()) - } + x.Alias = (string)(string(r.DecodeStringAsBytes())) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Field) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj8 int @@ -12359,190 +9094,141 @@ func (x *Field) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil + z.DecReadArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Expr)); yyxt10 != nil { + z.DecExtension(x.Expr, yyxt10) } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Expr)); yyxt10 != nil { - z.DecExtension(x.Expr, yyxt10) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Field = "" - } else { - x.Field = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Field = (string)(string(r.DecodeStringAsBytes())) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Alias = "" - } else { - x.Alias = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Alias = (string)(string(r.DecodeStringAsBytes())) for { yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - r.ReadArrayEnd() } func (x Fields) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encFields((Fields)(x), e) - } - } + h.encFields((Fields)(x), e) + } // end block: if x slice == nil } func (x *Fields) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decFields((*Fields)(x), d) - } + h.decFields((*Fields)(x), d) } func (x *Group) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if yyxt4 := z.Extension(z.I2Rtid(x.Expr)); yyxt4 != nil { + z.EncExtension(x.Expr, yyxt4) + } else { + z.EncFallback(x.Expr) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Expr)); yyxt4 != nil { - z.EncExtension(x.Expr, yyxt4) - } else { - z.EncFallback(x.Expr) - } - } + z.EncWriteMapElemValue() + if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { + z.EncExtension(x.Expr, yyxt5) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.EncExtension(x.Expr, yyxt5) - } else { - z.EncFallback(x.Expr) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Expr) } + z.EncWriteMapEnd() } } } func (x *Group) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Group{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Group) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -12552,34 +9238,28 @@ func (x *Group) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { + z.DecExtension(x.Expr, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.DecExtension(x.Expr, yyxt5) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Group) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -12589,206 +9269,151 @@ func (x *Group) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil + z.DecReadArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Expr)); yyxt8 != nil { + z.DecExtension(x.Expr, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Expr)); yyxt8 != nil { - z.DecExtension(x.Expr, yyxt8) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x Groups) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encGroups((Groups)(x), e) - } - } + h.encGroups((Groups)(x), e) + } // end block: if x slice == nil } func (x *Groups) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decGroups((*Groups)(x), d) - } + h.decGroups((*Groups)(x), d) } func (x *Order) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + if yyxt6 := z.Extension(z.I2Rtid(x.Expr)); yyxt6 != nil { + z.EncExtension(x.Expr, yyxt6) + } else { + z.EncFallback(x.Expr) + } + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Dir)) + z.EncWriteArrayElem() + yy8 := &x.Tag + if yyxt9 := z.Extension(z.I2Rtid(yy8)); yyxt9 != nil { + z.EncExtension(yy8, yyxt9) + } else if !z.EncBinary() { + z.EncTextMarshal(yy8) + } else { + z.EncFallback(yy8) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) + z.EncWriteMapStart(3) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapStart(3) + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Expr)); yyxt4 != nil { - z.EncExtension(x.Expr, yyxt4) - } else { - z.EncFallback(x.Expr) - } - } + z.EncWriteMapElemValue() + if yyxt10 := z.Extension(z.I2Rtid(x.Expr)); yyxt10 != nil { + z.EncExtension(x.Expr, yyxt10) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.EncExtension(x.Expr, yyxt5) - } else { - z.EncFallback(x.Expr) - } - } + z.EncFallback(x.Expr) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Dir\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Dir\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Dir`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } + r.EncodeString(`Dir`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yy10 := &x.Tag - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(yy10)); yyxt11 != nil { - z.EncExtension(yy10, yyxt11) - } else if !z.EncBinary() { - z.EncTextMarshal(yy10) - } else { - z.EncFallback(yy10) - } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Dir)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Tag\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Tag\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Tag`) - } - r.WriteMapElemValue() - yy12 := &x.Tag - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(yy12)); yyxt13 != nil { - z.EncExtension(yy12, yyxt13) - } else if !z.EncBinary() { - z.EncTextMarshal(yy12) - } else { - z.EncFallback(yy12) - } + r.EncodeString(`Tag`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + yy12 := &x.Tag + if yyxt13 := z.Extension(z.I2Rtid(yy12)); yyxt13 != nil { + z.EncExtension(yy12, yyxt13) + } else if !z.EncBinary() { + z.EncTextMarshal(yy12) } else { - r.WriteMapEnd() + z.EncFallback(yy12) } + z.EncWriteMapEnd() } } } func (x *Order) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Order{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Order) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -12798,53 +9423,38 @@ func (x *Order) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { + z.DecExtension(x.Expr, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.DecExtension(x.Expr, yyxt5) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } case "Dir": - if r.TryDecodeAsNil() { - x.Dir = false - } else { - x.Dir = (bool)(r.DecodeBool()) - } + x.Dir = (bool)(r.DecodeBool()) case "Tag": - if r.TryDecodeAsNil() { - x.Tag = pkg1_language.Tag{} + if yyxt8 := z.Extension(z.I2Rtid(x.Tag)); yyxt8 != nil { + z.DecExtension(x.Tag, yyxt8) + } else if !z.DecBinary() { + z.DecTextUnmarshal(&x.Tag) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Tag)); yyxt8 != nil { - z.DecExtension(x.Tag, yyxt8) - } else if !z.DecBinary() { - z.DecTextUnmarshal(&x.Tag) - } else { - z.DecFallback(&x.Tag, false) - } + z.DecFallback(&x.Tag, false) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Order) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj9 int @@ -12854,197 +9464,147 @@ func (x *Order) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil + z.DecReadArrayElem() + if yyxt11 := z.Extension(z.I2Rtid(x.Expr)); yyxt11 != nil { + z.DecExtension(x.Expr, yyxt11) } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Expr)); yyxt11 != nil { - z.DecExtension(x.Expr, yyxt11) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Dir = false - } else { - x.Dir = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Dir = (bool)(r.DecodeBool()) yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Tag = pkg1_language.Tag{} + z.DecReadArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Tag)); yyxt14 != nil { + z.DecExtension(x.Tag, yyxt14) + } else if !z.DecBinary() { + z.DecTextUnmarshal(&x.Tag) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Tag)); yyxt14 != nil { - z.DecExtension(x.Tag, yyxt14) - } else if !z.DecBinary() { - z.DecTextUnmarshal(&x.Tag) - } else { - z.DecFallback(&x.Tag, false) - } + z.DecFallback(&x.Tag, false) } for { yyj9++ if yyhl9 { yyb9 = yyj9 > l } else { - yyb9 = r.CheckBreak() + yyb9 = z.DecCheckBreak() } if yyb9 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } - r.ReadArrayEnd() } func (x Orders) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encOrders((Orders)(x), e) - } - } + h.encOrders((Orders)(x), e) + } // end block: if x slice == nil } func (x *Orders) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decOrders((*Orders)(x), d) - } + h.decOrders((*Orders)(x), d) } func (x *Fetch) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if yyxt4 := z.Extension(z.I2Rtid(x.Expr)); yyxt4 != nil { + z.EncExtension(x.Expr, yyxt4) + } else { + z.EncFallback(x.Expr) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Expr)); yyxt4 != nil { - z.EncExtension(x.Expr, yyxt4) - } else { - z.EncFallback(x.Expr) - } - } + z.EncWriteMapElemValue() + if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { + z.EncExtension(x.Expr, yyxt5) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.EncExtension(x.Expr, yyxt5) - } else { - z.EncFallback(x.Expr) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Expr) } + z.EncWriteMapEnd() } } } func (x *Fetch) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Fetch{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Fetch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -13054,34 +9614,28 @@ func (x *Fetch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { + z.DecExtension(x.Expr, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.DecExtension(x.Expr, yyxt5) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Fetch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -13091,158 +9645,117 @@ func (x *Fetch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil + z.DecReadArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Expr)); yyxt8 != nil { + z.DecExtension(x.Expr, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Expr)); yyxt8 != nil { - z.DecExtension(x.Expr, yyxt8) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x Fetchs) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encFetchs((Fetchs)(x), e) - } - } + h.encFetchs((Fetchs)(x), e) + } // end block: if x slice == nil } func (x *Fetchs) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decFetchs((*Fetchs)(x), d) - } + h.decFetchs((*Fetchs)(x), d) } func (x *SubExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if yyxt4 := z.Extension(z.I2Rtid(x.Expr)); yyxt4 != nil { + z.EncExtension(x.Expr, yyxt4) + } else { + z.EncFallback(x.Expr) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Expr)); yyxt4 != nil { - z.EncExtension(x.Expr, yyxt4) - } else { - z.EncFallback(x.Expr) - } - } + z.EncWriteMapElemValue() + if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { + z.EncExtension(x.Expr, yyxt5) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.EncExtension(x.Expr, yyxt5) - } else { - z.EncFallback(x.Expr) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Expr) } + z.EncWriteMapEnd() } } } func (x *SubExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = SubExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *SubExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -13252,34 +9765,28 @@ func (x *SubExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { + z.DecExtension(x.Expr, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Expr)); yyxt5 != nil { - z.DecExtension(x.Expr, yyxt5) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *SubExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -13289,126 +9796,99 @@ func (x *SubExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil + z.DecReadArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Expr)); yyxt8 != nil { + z.DecExtension(x.Expr, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Expr)); yyxt8 != nil { - z.DecExtension(x.Expr, yyxt8) - } else { - z.DecFallback(&x.Expr, true) - } + z.DecFallback(&x.Expr, true) } for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *MultExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if x.Expr == nil { + r.EncodeNil() + } else { + h.encSliceExpr(([]Expr)(x.Expr), e) + } // end block: if x.Expr slice == nil + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Expr`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else { - h.encSliceExpr(([]Expr)(x.Expr), e) - } - } + z.EncWriteMapElemValue() + if x.Expr == nil { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - if false { - } else { - h.encSliceExpr(([]Expr)(x.Expr), e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + h.encSliceExpr(([]Expr)(x.Expr), e) + } // end block: if x.Expr slice == nil + z.EncWriteMapEnd() } } } func (x *MultExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = MultExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *MultExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -13418,32 +9898,24 @@ func (x *MultExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - if false { - } else { - h.decSliceExpr((*[]Expr)(&x.Expr), d) - } - } + h.decSliceExpr((*[]Expr)(&x.Expr), d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *MultExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -13453,156 +9925,107 @@ func (x *MultExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - if false { - } else { - h.decSliceExpr((*[]Expr)(&x.Expr), d) - } - } + z.DecReadArrayElem() + h.decSliceExpr((*[]Expr)(&x.Expr), d) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *FuncExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + r.EncodeString(string(x.Name)) + z.EncWriteArrayElem() + x.Args.CodecEncodeSelf(e) + z.EncWriteArrayElem() + r.EncodeBool(bool(x.Aggr)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) + z.EncWriteMapStart(3) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapStart(3) + r.EncodeString(`Name`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Name)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.Name)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Args\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.Name)) - } + r.EncodeString(`Args`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Args == nil { - r.EncodeNil() - } else { - x.Args.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.Args.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Aggr\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Args\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Args`) - } - r.WriteMapElemValue() - if x.Args == nil { - r.EncodeNil() - } else { - x.Args.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeBool(bool(x.Aggr)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Aggr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Aggr`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeBool(bool(x.Aggr)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`Aggr`) } + z.EncWriteMapElemValue() + r.EncodeBool(bool(x.Aggr)) + z.EncWriteMapEnd() } } } func (x *FuncExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = FuncExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *FuncExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -13612,41 +10035,28 @@ func (x *FuncExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = (string)(r.DecodeString()) - } + x.Name = (string)(string(r.DecodeStringAsBytes())) case "Args": - if r.TryDecodeAsNil() { - x.Args = nil - } else { - x.Args.CodecDecodeSelf(d) - } + x.Args.CodecDecodeSelf(d) case "Aggr": - if r.TryDecodeAsNil() { - x.Aggr = false - } else { - x.Aggr = (bool)(r.DecodeBool()) - } + x.Aggr = (bool)(r.DecodeBool()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *FuncExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj7 int @@ -13656,219 +10066,163 @@ func (x *FuncExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.Name = (string)(string(r.DecodeStringAsBytes())) yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Args = nil - } else { - x.Args.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.Args.CodecDecodeSelf(d) yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Aggr = false - } else { - x.Aggr = (bool)(r.DecodeBool()) - } + z.DecReadArrayElem() + x.Aggr = (bool)(r.DecodeBool()) for { yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj7-1, "") } - r.ReadArrayEnd() } func (x *ItemExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + if yyxt6 := z.Extension(z.I2Rtid(x.LHS)); yyxt6 != nil { + z.EncExtension(x.LHS, yyxt6) + } else { + z.EncFallback(x.LHS) + } + z.EncWriteArrayElem() + if yyxt7 := z.Extension(z.I2Rtid(x.Op)); yyxt7 != nil { + z.EncExtension(x.Op, yyxt7) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Op) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Op) + } else { + r.EncodeInt(int64(x.Op)) + } + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.RHS)); yyxt8 != nil { + z.EncExtension(x.RHS, yyxt8) + } else { + z.EncFallback(x.RHS) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) + z.EncWriteMapStart(3) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"LHS\"") } else { - r.WriteMapStart(3) + r.EncodeString(`LHS`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.LHS == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.LHS)); yyxt4 != nil { - z.EncExtension(x.LHS, yyxt4) - } else { - z.EncFallback(x.LHS) - } - } + z.EncWriteMapElemValue() + if yyxt9 := z.Extension(z.I2Rtid(x.LHS)); yyxt9 != nil { + z.EncExtension(x.LHS, yyxt9) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"LHS\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `LHS`) - } - r.WriteMapElemValue() - if x.LHS == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.LHS)); yyxt5 != nil { - z.EncExtension(x.LHS, yyxt5) - } else { - z.EncFallback(x.LHS) - } - } + z.EncFallback(x.LHS) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Op)); yyxt7 != nil { - z.EncExtension(x.Op, yyxt7) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Op) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Op) - } else { - r.EncodeInt(int64(x.Op)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Op\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Op\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Op`) - } - r.WriteMapElemValue() - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Op)); yyxt8 != nil { - z.EncExtension(x.Op, yyxt8) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Op) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Op) - } else { - r.EncodeInt(int64(x.Op)) - } + r.EncodeString(`Op`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.RHS == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.RHS)); yyxt10 != nil { - z.EncExtension(x.RHS, yyxt10) - } else { - z.EncFallback(x.RHS) - } - } + z.EncWriteMapElemValue() + if yyxt10 := z.Extension(z.I2Rtid(x.Op)); yyxt10 != nil { + z.EncExtension(x.Op, yyxt10) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Op) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Op) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"RHS\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `RHS`) - } - r.WriteMapElemValue() - if x.RHS == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.RHS)); yyxt11 != nil { - z.EncExtension(x.RHS, yyxt11) - } else { - z.EncFallback(x.RHS) - } - } + r.EncodeInt(int64(x.Op)) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"RHS\"") } else { - r.WriteMapEnd() + r.EncodeString(`RHS`) } + z.EncWriteMapElemValue() + if yyxt11 := z.Extension(z.I2Rtid(x.RHS)); yyxt11 != nil { + z.EncExtension(x.RHS, yyxt11) + } else { + z.EncFallback(x.RHS) + } + z.EncWriteMapEnd() } } } func (x *ItemExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = ItemExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *ItemExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -13878,58 +10232,42 @@ func (x *ItemExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "LHS": - if r.TryDecodeAsNil() { - x.LHS = nil + if yyxt5 := z.Extension(z.I2Rtid(x.LHS)); yyxt5 != nil { + z.DecExtension(x.LHS, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.LHS)); yyxt5 != nil { - z.DecExtension(x.LHS, yyxt5) - } else { - z.DecFallback(&x.LHS, true) - } + z.DecFallback(&x.LHS, true) } case "Op": - if r.TryDecodeAsNil() { - x.Op = 0 + if yyxt7 := z.Extension(z.I2Rtid(x.Op)); yyxt7 != nil { + z.DecExtension(x.Op, yyxt7) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Op) } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Op)); yyxt7 != nil { - z.DecExtension(x.Op, yyxt7) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Op) - } else { - x.Op = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Op = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "RHS": - if r.TryDecodeAsNil() { - x.RHS = nil + if yyxt9 := z.Extension(z.I2Rtid(x.RHS)); yyxt9 != nil { + z.DecExtension(x.RHS, yyxt9) } else { - if false { - } else if yyxt9 := z.Extension(z.I2Rtid(x.RHS)); yyxt9 != nil { - z.DecExtension(x.RHS, yyxt9) - } else { - z.DecFallback(&x.RHS, true) - } + z.DecFallback(&x.RHS, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *ItemExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj10 int @@ -13939,236 +10277,177 @@ func (x *ItemExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.LHS = nil + z.DecReadArrayElem() + if yyxt12 := z.Extension(z.I2Rtid(x.LHS)); yyxt12 != nil { + z.DecExtension(x.LHS, yyxt12) } else { - if false { - } else if yyxt12 := z.Extension(z.I2Rtid(x.LHS)); yyxt12 != nil { - z.DecExtension(x.LHS, yyxt12) - } else { - z.DecFallback(&x.LHS, true) - } + z.DecFallback(&x.LHS, true) } yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Op = 0 + z.DecReadArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Op)); yyxt14 != nil { + z.DecExtension(x.Op, yyxt14) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Op) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Op)); yyxt14 != nil { - z.DecExtension(x.Op, yyxt14) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Op) - } else { - x.Op = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Op = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.RHS = nil + z.DecReadArrayElem() + if yyxt16 := z.Extension(z.I2Rtid(x.RHS)); yyxt16 != nil { + z.DecExtension(x.RHS, yyxt16) } else { - if false { - } else if yyxt16 := z.Extension(z.I2Rtid(x.RHS)); yyxt16 != nil { - z.DecExtension(x.RHS, yyxt16) - } else { - z.DecFallback(&x.RHS, true) - } + z.DecFallback(&x.RHS, true) } for { yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj10-1, "") } - r.ReadArrayEnd() } func (x *BinaryExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + if yyxt6 := z.Extension(z.I2Rtid(x.LHS)); yyxt6 != nil { + z.EncExtension(x.LHS, yyxt6) + } else { + z.EncFallback(x.LHS) + } + z.EncWriteArrayElem() + if yyxt7 := z.Extension(z.I2Rtid(x.Op)); yyxt7 != nil { + z.EncExtension(x.Op, yyxt7) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Op) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Op) + } else { + r.EncodeInt(int64(x.Op)) + } + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.RHS)); yyxt8 != nil { + z.EncExtension(x.RHS, yyxt8) + } else { + z.EncFallback(x.RHS) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) + z.EncWriteMapStart(3) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"LHS\"") } else { - r.WriteMapStart(3) + r.EncodeString(`LHS`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.LHS == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.LHS)); yyxt4 != nil { - z.EncExtension(x.LHS, yyxt4) - } else { - z.EncFallback(x.LHS) - } - } + z.EncWriteMapElemValue() + if yyxt9 := z.Extension(z.I2Rtid(x.LHS)); yyxt9 != nil { + z.EncExtension(x.LHS, yyxt9) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"LHS\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `LHS`) - } - r.WriteMapElemValue() - if x.LHS == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.LHS)); yyxt5 != nil { - z.EncExtension(x.LHS, yyxt5) - } else { - z.EncFallback(x.LHS) - } - } + z.EncFallback(x.LHS) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Op)); yyxt7 != nil { - z.EncExtension(x.Op, yyxt7) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Op) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Op) - } else { - r.EncodeInt(int64(x.Op)) - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Op\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Op\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Op`) - } - r.WriteMapElemValue() - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Op)); yyxt8 != nil { - z.EncExtension(x.Op, yyxt8) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Op) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Op) - } else { - r.EncodeInt(int64(x.Op)) - } + r.EncodeString(`Op`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.RHS == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.RHS)); yyxt10 != nil { - z.EncExtension(x.RHS, yyxt10) - } else { - z.EncFallback(x.RHS) - } - } + z.EncWriteMapElemValue() + if yyxt10 := z.Extension(z.I2Rtid(x.Op)); yyxt10 != nil { + z.EncExtension(x.Op, yyxt10) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Op) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Op) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"RHS\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `RHS`) - } - r.WriteMapElemValue() - if x.RHS == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.RHS)); yyxt11 != nil { - z.EncExtension(x.RHS, yyxt11) - } else { - z.EncFallback(x.RHS) - } - } + r.EncodeInt(int64(x.Op)) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"RHS\"") } else { - r.WriteMapEnd() + r.EncodeString(`RHS`) } + z.EncWriteMapElemValue() + if yyxt11 := z.Extension(z.I2Rtid(x.RHS)); yyxt11 != nil { + z.EncExtension(x.RHS, yyxt11) + } else { + z.EncFallback(x.RHS) + } + z.EncWriteMapEnd() } } } func (x *BinaryExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = BinaryExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *BinaryExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -14178,58 +10457,42 @@ func (x *BinaryExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "LHS": - if r.TryDecodeAsNil() { - x.LHS = nil + if yyxt5 := z.Extension(z.I2Rtid(x.LHS)); yyxt5 != nil { + z.DecExtension(x.LHS, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.LHS)); yyxt5 != nil { - z.DecExtension(x.LHS, yyxt5) - } else { - z.DecFallback(&x.LHS, true) - } + z.DecFallback(&x.LHS, true) } case "Op": - if r.TryDecodeAsNil() { - x.Op = 0 + if yyxt7 := z.Extension(z.I2Rtid(x.Op)); yyxt7 != nil { + z.DecExtension(x.Op, yyxt7) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Op) } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Op)); yyxt7 != nil { - z.DecExtension(x.Op, yyxt7) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Op) - } else { - x.Op = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Op = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } case "RHS": - if r.TryDecodeAsNil() { - x.RHS = nil + if yyxt9 := z.Extension(z.I2Rtid(x.RHS)); yyxt9 != nil { + z.DecExtension(x.RHS, yyxt9) } else { - if false { - } else if yyxt9 := z.Extension(z.I2Rtid(x.RHS)); yyxt9 != nil { - z.DecExtension(x.RHS, yyxt9) - } else { - z.DecFallback(&x.RHS, true) - } + z.DecFallback(&x.RHS, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *BinaryExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj10 int @@ -14239,164 +10502,125 @@ func (x *BinaryExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.LHS = nil + z.DecReadArrayElem() + if yyxt12 := z.Extension(z.I2Rtid(x.LHS)); yyxt12 != nil { + z.DecExtension(x.LHS, yyxt12) } else { - if false { - } else if yyxt12 := z.Extension(z.I2Rtid(x.LHS)); yyxt12 != nil { - z.DecExtension(x.LHS, yyxt12) - } else { - z.DecFallback(&x.LHS, true) - } + z.DecFallback(&x.LHS, true) } yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Op = 0 + z.DecReadArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Op)); yyxt14 != nil { + z.DecExtension(x.Op, yyxt14) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Op) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Op)); yyxt14 != nil { - z.DecExtension(x.Op, yyxt14) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Op) - } else { - x.Op = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Op = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.RHS = nil + z.DecReadArrayElem() + if yyxt16 := z.Extension(z.I2Rtid(x.RHS)); yyxt16 != nil { + z.DecExtension(x.RHS, yyxt16) } else { - if false { - } else if yyxt16 := z.Extension(z.I2Rtid(x.RHS)); yyxt16 != nil { - z.DecExtension(x.RHS, yyxt16) - } else { - z.DecFallback(&x.RHS, true) - } + z.DecFallback(&x.RHS, true) } for { yyj10++ if yyhl10 { yyb10 = yyj10 > l } else { - yyb10 = r.CheckBreak() + yyb10 = z.DecCheckBreak() } if yyb10 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj10-1, "") } - r.ReadArrayEnd() } func (x *PathExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + x.Expr.CodecEncodeSelf(e) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Expr\"") } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Expr == nil { - r.EncodeNil() - } else { - x.Expr.CodecEncodeSelf(e) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Expr\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Expr`) - } - r.WriteMapElemValue() - if x.Expr == nil { - r.EncodeNil() - } else { - x.Expr.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`Expr`) } + z.EncWriteMapElemValue() + x.Expr.CodecEncodeSelf(e) + z.EncWriteMapEnd() } } } func (x *PathExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = PathExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *PathExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -14406,29 +10630,24 @@ func (x *PathExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Expr": - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - x.Expr.CodecDecodeSelf(d) - } + x.Expr.CodecDecodeSelf(d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *PathExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -14438,125 +10657,95 @@ func (x *PathExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Expr = nil - } else { - x.Expr.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.Expr.CodecDecodeSelf(d) for { yyj5++ if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x *PartExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if yyxt4 := z.Extension(z.I2Rtid(x.Part)); yyxt4 != nil { + z.EncExtension(x.Part, yyxt4) + } else { + z.EncFallback(x.Part) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Part\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Part`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Part == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Part)); yyxt4 != nil { - z.EncExtension(x.Part, yyxt4) - } else { - z.EncFallback(x.Part) - } - } + z.EncWriteMapElemValue() + if yyxt5 := z.Extension(z.I2Rtid(x.Part)); yyxt5 != nil { + z.EncExtension(x.Part, yyxt5) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Part\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Part`) - } - r.WriteMapElemValue() - if x.Part == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Part)); yyxt5 != nil { - z.EncExtension(x.Part, yyxt5) - } else { - z.EncFallback(x.Part) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Part) } + z.EncWriteMapEnd() } } } func (x *PartExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = PartExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *PartExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -14566,34 +10755,28 @@ func (x *PartExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Part": - if r.TryDecodeAsNil() { - x.Part = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Part)); yyxt5 != nil { + z.DecExtension(x.Part, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Part)); yyxt5 != nil { - z.DecExtension(x.Part, yyxt5) - } else { - z.DecFallback(&x.Part, true) - } + z.DecFallback(&x.Part, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *PartExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -14603,130 +10786,107 @@ func (x *PartExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Part = nil + z.DecReadArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Part)); yyxt8 != nil { + z.DecExtension(x.Part, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Part)); yyxt8 != nil { - z.DecExtension(x.Part, yyxt8) - } else { - z.DecFallback(&x.Part, true) - } + z.DecFallback(&x.Part, true) } for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *JoinExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if yyxt4 := z.Extension(z.I2Rtid(x.Join)); yyxt4 != nil { + z.EncExtension(x.Join, yyxt4) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Join) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Join) + } else { + r.EncodeInt(int64(x.Join)) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Join\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Join`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Join)); yyxt4 != nil { - z.EncExtension(x.Join, yyxt4) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Join) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Join) - } else { - r.EncodeInt(int64(x.Join)) - } + z.EncWriteMapElemValue() + if yyxt5 := z.Extension(z.I2Rtid(x.Join)); yyxt5 != nil { + z.EncExtension(x.Join, yyxt5) + } else if z.EncBinary() { + z.EncBinaryMarshal(x.Join) + } else if !z.EncBinary() { + z.EncTextMarshal(x.Join) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Join\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Join`) - } - r.WriteMapElemValue() - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Join)); yyxt5 != nil { - z.EncExtension(x.Join, yyxt5) - } else if z.EncBinary() { - z.EncBinaryMarshal(x.Join) - } else if !z.EncBinary() { - z.EncTextMarshal(x.Join) - } else { - r.EncodeInt(int64(x.Join)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeInt(int64(x.Join)) } + z.EncWriteMapEnd() } } } func (x *JoinExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = JoinExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *JoinExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -14736,36 +10896,30 @@ func (x *JoinExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Join": - if r.TryDecodeAsNil() { - x.Join = 0 + if yyxt5 := z.Extension(z.I2Rtid(x.Join)); yyxt5 != nil { + z.DecExtension(x.Join, yyxt5) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Join) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Join)); yyxt5 != nil { - z.DecExtension(x.Join, yyxt5) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Join) - } else { - x.Join = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Join = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *JoinExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -14775,189 +10929,131 @@ func (x *JoinExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Join = 0 + z.DecReadArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Join)); yyxt8 != nil { + z.DecExtension(x.Join, yyxt8) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(&x.Join) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Join)); yyxt8 != nil { - z.DecExtension(x.Join, yyxt8) - } else if z.DecBinary() { - z.DecBinaryUnmarshal(&x.Join) - } else { - x.Join = (Token)(z.C.IntV(r.DecodeInt64(), 16)) - } + x.Join = (Token)(z.C.IntV(r.DecodeInt64(), 16)) } for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *SubpExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + var yyn4 bool = x.Name == nil + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(3) + z.EncWriteArrayElem() + x.What.CodecEncodeSelf(e) + if yyn4 { + z.EncWriteArrayElem() + r.EncodeNil() + } else { + z.EncWriteArrayElem() + x.Name.CodecEncodeSelf(e) + } + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Cond)); yyxt8 != nil { + z.EncExtension(x.Cond, yyxt8) + } else { + z.EncFallback(x.Cond) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) + z.EncWriteMapStart(3) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"What\"") } else { - r.WriteMapStart(3) + r.EncodeString(`What`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + z.EncWriteMapElemValue() + x.What.CodecEncodeSelf(e) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Name\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"What\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `What`) - } - r.WriteMapElemValue() - if x.What == nil { - r.EncodeNil() - } else { - x.What.CodecEncodeSelf(e) - } + r.EncodeString(`Name`) } - var yyn6 bool - if x.Name == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + z.EncWriteMapElemValue() + if yyn4 { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Name\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Name`) - } - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.Name == nil { - r.EncodeNil() - } else { - x.Name.CodecEncodeSelf(e) - } - } + x.Name.CodecEncodeSelf(e) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Cond)); yyxt10 != nil { - z.EncExtension(x.Cond, yyxt10) - } else { - z.EncFallback(x.Cond) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Cond\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Cond\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Cond`) - } - r.WriteMapElemValue() - if x.Cond == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Cond)); yyxt11 != nil { - z.EncExtension(x.Cond, yyxt11) - } else { - z.EncFallback(x.Cond) - } - } + r.EncodeString(`Cond`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyxt11 := z.Extension(z.I2Rtid(x.Cond)); yyxt11 != nil { + z.EncExtension(x.Cond, yyxt11) } else { - r.WriteMapEnd() + z.EncFallback(x.Cond) } + z.EncWriteMapEnd() } } } func (x *SubpExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = SubpExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *SubpExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -14967,52 +11063,41 @@ func (x *SubpExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "What": - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + x.What.CodecDecodeSelf(d) case "Name": - if r.TryDecodeAsNil() { - if true && x.Name != nil { + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } case "Cond": - if r.TryDecodeAsNil() { - x.Cond = nil + if yyxt7 := z.Extension(z.I2Rtid(x.Cond)); yyxt7 != nil { + z.DecExtension(x.Cond, yyxt7) } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Cond)); yyxt7 != nil { - z.DecExtension(x.Cond, yyxt7) - } else { - z.DecFallback(&x.Cond, true) - } + z.DecFallback(&x.Cond, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *SubpExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj8 int @@ -15022,261 +11107,186 @@ func (x *SubpExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.What = nil - } else { - x.What.CodecDecodeSelf(d) - } + z.DecReadArrayElem() + x.What.CodecDecodeSelf(d) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.Name != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.Name != nil { // remove the if-true x.Name = nil } } else { if x.Name == nil { x.Name = new(Ident) } - x.Name.CodecDecodeSelf(d) } yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cond = nil + z.DecReadArrayElem() + if yyxt12 := z.Extension(z.I2Rtid(x.Cond)); yyxt12 != nil { + z.DecExtension(x.Cond, yyxt12) } else { - if false { - } else if yyxt12 := z.Extension(z.I2Rtid(x.Cond)); yyxt12 != nil { - z.DecExtension(x.Cond, yyxt12) - } else { - z.DecFallback(&x.Cond, true) - } + z.DecFallback(&x.Cond, true) } for { yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - r.ReadArrayEnd() } func (x *PermExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(4) + z.EncWriteArrayElem() + if yyxt7 := z.Extension(z.I2Rtid(x.Select)); yyxt7 != nil { + z.EncExtension(x.Select, yyxt7) + } else { + z.EncFallback(x.Select) + } + z.EncWriteArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Create)); yyxt8 != nil { + z.EncExtension(x.Create, yyxt8) + } else { + z.EncFallback(x.Create) + } + z.EncWriteArrayElem() + if yyxt9 := z.Extension(z.I2Rtid(x.Update)); yyxt9 != nil { + z.EncExtension(x.Update, yyxt9) + } else { + z.EncFallback(x.Update) + } + z.EncWriteArrayElem() + if yyxt10 := z.Extension(z.I2Rtid(x.Delete)); yyxt10 != nil { + z.EncExtension(x.Delete, yyxt10) + } else { + z.EncFallback(x.Delete) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) + z.EncWriteMapStart(4) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Select\"") } else { - r.WriteMapStart(4) + r.EncodeString(`Select`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Select == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Select)); yyxt4 != nil { - z.EncExtension(x.Select, yyxt4) - } else { - z.EncFallback(x.Select) - } - } + z.EncWriteMapElemValue() + if yyxt11 := z.Extension(z.I2Rtid(x.Select)); yyxt11 != nil { + z.EncExtension(x.Select, yyxt11) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Select\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Select`) - } - r.WriteMapElemValue() - if x.Select == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Select)); yyxt5 != nil { - z.EncExtension(x.Select, yyxt5) - } else { - z.EncFallback(x.Select) - } - } + z.EncFallback(x.Select) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Create == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Create)); yyxt7 != nil { - z.EncExtension(x.Create, yyxt7) - } else { - z.EncFallback(x.Create) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Create\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Create\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Create`) - } - r.WriteMapElemValue() - if x.Create == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Create)); yyxt8 != nil { - z.EncExtension(x.Create, yyxt8) - } else { - z.EncFallback(x.Create) - } - } + r.EncodeString(`Create`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Update == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt10 := z.Extension(z.I2Rtid(x.Update)); yyxt10 != nil { - z.EncExtension(x.Update, yyxt10) - } else { - z.EncFallback(x.Update) - } - } + z.EncWriteMapElemValue() + if yyxt12 := z.Extension(z.I2Rtid(x.Create)); yyxt12 != nil { + z.EncExtension(x.Create, yyxt12) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Update\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Update`) - } - r.WriteMapElemValue() - if x.Update == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Update)); yyxt11 != nil { - z.EncExtension(x.Update, yyxt11) - } else { - z.EncFallback(x.Update) - } - } + z.EncFallback(x.Create) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Delete == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt13 := z.Extension(z.I2Rtid(x.Delete)); yyxt13 != nil { - z.EncExtension(x.Delete, yyxt13) - } else { - z.EncFallback(x.Delete) - } - } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Update\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Delete\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Delete`) - } - r.WriteMapElemValue() - if x.Delete == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Delete)); yyxt14 != nil { - z.EncExtension(x.Delete, yyxt14) - } else { - z.EncFallback(x.Delete) - } - } + r.EncodeString(`Update`) } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() + z.EncWriteMapElemValue() + if yyxt13 := z.Extension(z.I2Rtid(x.Update)); yyxt13 != nil { + z.EncExtension(x.Update, yyxt13) } else { - r.WriteMapEnd() + z.EncFallback(x.Update) } + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Delete\"") + } else { + r.EncodeString(`Delete`) + } + z.EncWriteMapElemValue() + if yyxt14 := z.Extension(z.I2Rtid(x.Delete)); yyxt14 != nil { + z.EncExtension(x.Delete, yyxt14) + } else { + z.EncFallback(x.Delete) + } + z.EncWriteMapEnd() } } } func (x *PermExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = PermExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *PermExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -15286,67 +11296,46 @@ func (x *PermExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Select": - if r.TryDecodeAsNil() { - x.Select = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Select)); yyxt5 != nil { + z.DecExtension(x.Select, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Select)); yyxt5 != nil { - z.DecExtension(x.Select, yyxt5) - } else { - z.DecFallback(&x.Select, true) - } + z.DecFallback(&x.Select, true) } case "Create": - if r.TryDecodeAsNil() { - x.Create = nil + if yyxt7 := z.Extension(z.I2Rtid(x.Create)); yyxt7 != nil { + z.DecExtension(x.Create, yyxt7) } else { - if false { - } else if yyxt7 := z.Extension(z.I2Rtid(x.Create)); yyxt7 != nil { - z.DecExtension(x.Create, yyxt7) - } else { - z.DecFallback(&x.Create, true) - } + z.DecFallback(&x.Create, true) } case "Update": - if r.TryDecodeAsNil() { - x.Update = nil + if yyxt9 := z.Extension(z.I2Rtid(x.Update)); yyxt9 != nil { + z.DecExtension(x.Update, yyxt9) } else { - if false { - } else if yyxt9 := z.Extension(z.I2Rtid(x.Update)); yyxt9 != nil { - z.DecExtension(x.Update, yyxt9) - } else { - z.DecFallback(&x.Update, true) - } + z.DecFallback(&x.Update, true) } case "Delete": - if r.TryDecodeAsNil() { - x.Delete = nil + if yyxt11 := z.Extension(z.I2Rtid(x.Delete)); yyxt11 != nil { + z.DecExtension(x.Delete, yyxt11) } else { - if false { - } else if yyxt11 := z.Extension(z.I2Rtid(x.Delete)); yyxt11 != nil { - z.DecExtension(x.Delete, yyxt11) - } else { - z.DecFallback(&x.Delete, true) - } + z.DecFallback(&x.Delete, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *PermExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj12 int @@ -15356,189 +11345,147 @@ func (x *PermExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Select = nil + z.DecReadArrayElem() + if yyxt14 := z.Extension(z.I2Rtid(x.Select)); yyxt14 != nil { + z.DecExtension(x.Select, yyxt14) } else { - if false { - } else if yyxt14 := z.Extension(z.I2Rtid(x.Select)); yyxt14 != nil { - z.DecExtension(x.Select, yyxt14) - } else { - z.DecFallback(&x.Select, true) - } + z.DecFallback(&x.Select, true) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Create = nil + z.DecReadArrayElem() + if yyxt16 := z.Extension(z.I2Rtid(x.Create)); yyxt16 != nil { + z.DecExtension(x.Create, yyxt16) } else { - if false { - } else if yyxt16 := z.Extension(z.I2Rtid(x.Create)); yyxt16 != nil { - z.DecExtension(x.Create, yyxt16) - } else { - z.DecFallback(&x.Create, true) - } + z.DecFallback(&x.Create, true) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Update = nil + z.DecReadArrayElem() + if yyxt18 := z.Extension(z.I2Rtid(x.Update)); yyxt18 != nil { + z.DecExtension(x.Update, yyxt18) } else { - if false { - } else if yyxt18 := z.Extension(z.I2Rtid(x.Update)); yyxt18 != nil { - z.DecExtension(x.Update, yyxt18) - } else { - z.DecFallback(&x.Update, true) - } + z.DecFallback(&x.Update, true) } yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Delete = nil + z.DecReadArrayElem() + if yyxt20 := z.Extension(z.I2Rtid(x.Delete)); yyxt20 != nil { + z.DecExtension(x.Delete, yyxt20) } else { - if false { - } else if yyxt20 := z.Extension(z.I2Rtid(x.Delete)); yyxt20 != nil { - z.DecExtension(x.Delete, yyxt20) - } else { - z.DecFallback(&x.Delete, true) - } + z.DecFallback(&x.Delete, true) } for { yyj12++ if yyhl12 { yyb12 = yyj12 > l } else { - yyb12 = r.CheckBreak() + yyb12 = z.DecCheckBreak() } if yyb12 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj12-1, "") } - r.ReadArrayEnd() } func (x *DataExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if x.Data == nil { + r.EncodeNil() + } else { + h.encSlicePtrtoItemExpression(([]*ItemExpression)(x.Data), e) + } // end block: if x.Data slice == nil + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else { - h.encSlicePtrtoItemExpression(([]*ItemExpression)(x.Data), e) - } - } + z.EncWriteMapElemValue() + if x.Data == nil { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else { - h.encSlicePtrtoItemExpression(([]*ItemExpression)(x.Data), e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + h.encSlicePtrtoItemExpression(([]*ItemExpression)(x.Data), e) + } // end block: if x.Data slice == nil + z.EncWriteMapEnd() } } } func (x *DataExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DataExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DataExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -15548,32 +11495,24 @@ func (x *DataExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - if false { - } else { - h.decSlicePtrtoItemExpression((*[]*ItemExpression)(&x.Data), d) - } - } + h.decSlicePtrtoItemExpression((*[]*ItemExpression)(&x.Data), d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DataExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -15583,128 +11522,95 @@ func (x *DataExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil - } else { - if false { - } else { - h.decSlicePtrtoItemExpression((*[]*ItemExpression)(&x.Data), d) - } - } + z.DecReadArrayElem() + h.decSlicePtrtoItemExpression((*[]*ItemExpression)(&x.Data), d) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *DiffExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if yyxt4 := z.Extension(z.I2Rtid(x.Data)); yyxt4 != nil { + z.EncExtension(x.Data, yyxt4) + } else { + z.EncFallback(x.Data) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Data)); yyxt4 != nil { - z.EncExtension(x.Data, yyxt4) - } else { - z.EncFallback(x.Data) - } - } + z.EncWriteMapElemValue() + if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { + z.EncExtension(x.Data, yyxt5) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.EncExtension(x.Data, yyxt5) - } else { - z.EncFallback(x.Data) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Data) } + z.EncWriteMapEnd() } } } func (x *DiffExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = DiffExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *DiffExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -15714,34 +11620,28 @@ func (x *DiffExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Data": - if r.TryDecodeAsNil() { - x.Data = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { + z.DecExtension(x.Data, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.DecExtension(x.Data, yyxt5) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *DiffExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -15751,130 +11651,99 @@ func (x *DiffExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil + z.DecReadArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { + z.DecExtension(x.Data, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { - z.DecExtension(x.Data, yyxt8) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *MergeExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if yyxt4 := z.Extension(z.I2Rtid(x.Data)); yyxt4 != nil { + z.EncExtension(x.Data, yyxt4) + } else { + z.EncFallback(x.Data) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Data)); yyxt4 != nil { - z.EncExtension(x.Data, yyxt4) - } else { - z.EncFallback(x.Data) - } - } + z.EncWriteMapElemValue() + if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { + z.EncExtension(x.Data, yyxt5) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.EncExtension(x.Data, yyxt5) - } else { - z.EncFallback(x.Data) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Data) } + z.EncWriteMapEnd() } } } func (x *MergeExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = MergeExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *MergeExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -15884,34 +11753,28 @@ func (x *MergeExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Data": - if r.TryDecodeAsNil() { - x.Data = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { + z.DecExtension(x.Data, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.DecExtension(x.Data, yyxt5) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *MergeExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -15921,130 +11784,99 @@ func (x *MergeExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil + z.DecReadArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { + z.DecExtension(x.Data, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { - z.DecExtension(x.Data, yyxt8) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x *ContentExpression) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + if yyxt4 := z.Extension(z.I2Rtid(x.Data)); yyxt4 != nil { + z.EncExtension(x.Data, yyxt4) + } else { + z.EncFallback(x.Data) + } + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"Data\"") } else { - r.WriteMapStart(1) + r.EncodeString(`Data`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt4 := z.Extension(z.I2Rtid(x.Data)); yyxt4 != nil { - z.EncExtension(x.Data, yyxt4) - } else { - z.EncFallback(x.Data) - } - } + z.EncWriteMapElemValue() + if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { + z.EncExtension(x.Data, yyxt5) } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"Data\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `Data`) - } - r.WriteMapElemValue() - if x.Data == nil { - r.EncodeNil() - } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.EncExtension(x.Data, yyxt5) - } else { - z.EncFallback(x.Data) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncFallback(x.Data) } + z.EncWriteMapEnd() } } } func (x *ContentExpression) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = ContentExpression{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *ContentExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -16054,34 +11886,28 @@ func (x *ContentExpression) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "Data": - if r.TryDecodeAsNil() { - x.Data = nil + if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { + z.DecExtension(x.Data, yyxt5) } else { - if false { - } else if yyxt5 := z.Extension(z.I2Rtid(x.Data)); yyxt5 != nil { - z.DecExtension(x.Data, yyxt5) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *ContentExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -16091,146 +11917,109 @@ func (x *ContentExpression) codecDecodeSelfFromArray(l int, d *codec1978.Decoder if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Data = nil + z.DecReadArrayElem() + if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { + z.DecExtension(x.Data, yyxt8) } else { - if false { - } else if yyxt8 := z.Extension(z.I2Rtid(x.Data)); yyxt8 != nil { - z.DecExtension(x.Data, yyxt8) - } else { - z.DecFallback(&x.Data, true) - } + z.DecFallback(&x.Data, true) } for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x Params) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encParams((Params)(x), e) - } - } + h.encParams((Params)(x), e) + } // end block: if x slice == nil } func (x *Params) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decParams((*Params)(x), d) - } + h.decParams((*Params)(x), d) } func (x *Param) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + r.EncodeString(string(x.VA)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"VA\"") } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.VA)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"VA\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `VA`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.VA)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`VA`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.VA)) + z.EncWriteMapEnd() } } } func (x *Param) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Param{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Param) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -16240,29 +12029,24 @@ func (x *Param) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "VA": - if r.TryDecodeAsNil() { - x.VA = "" - } else { - x.VA = (string)(r.DecodeString()) - } + x.VA = (string)(string(r.DecodeStringAsBytes())) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Param) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -16272,141 +12056,105 @@ func (x *Param) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.VA = "" - } else { - x.VA = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.VA = (string)(string(r.DecodeStringAsBytes())) for { yyj5++ if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x Idents) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encIdents((Idents)(x), e) - } - } + h.encIdents((Idents)(x), e) + } // end block: if x slice == nil } func (x *Idents) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decIdents((*Idents)(x), d) - } + h.decIdents((*Idents)(x), d) } func (x *Ident) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + r.EncodeString(string(x.VA)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"VA\"") } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.VA)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"VA\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `VA`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.VA)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`VA`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.VA)) + z.EncWriteMapEnd() } } } func (x *Ident) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Ident{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Ident) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -16416,29 +12164,24 @@ func (x *Ident) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "VA": - if r.TryDecodeAsNil() { - x.VA = "" - } else { - x.VA = (string)(r.DecodeString()) - } + x.VA = (string)(string(r.DecodeStringAsBytes())) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Ident) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -16448,141 +12191,105 @@ func (x *Ident) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.VA = "" - } else { - x.VA = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.VA = (string)(string(r.DecodeStringAsBytes())) for { yyj5++ if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x Values) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encValues((Values)(x), e) - } - } + h.encValues((Values)(x), e) + } // end block: if x slice == nil } func (x *Values) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decValues((*Values)(x), d) - } + h.decValues((*Values)(x), d) } func (x *Value) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + r.EncodeString(string(x.VA)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"VA\"") } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.VA)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"VA\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `VA`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.VA)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`VA`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.VA)) + z.EncWriteMapEnd() } } } func (x *Value) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Value{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Value) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -16592,29 +12299,24 @@ func (x *Value) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "VA": - if r.TryDecodeAsNil() { - x.VA = "" - } else { - x.VA = (string)(r.DecodeString()) - } + x.VA = (string)(string(r.DecodeStringAsBytes())) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Value) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -16624,141 +12326,105 @@ func (x *Value) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.VA = "" - } else { - x.VA = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.VA = (string)(string(r.DecodeStringAsBytes())) for { yyj5++ if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x Regexs) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encRegexs((Regexs)(x), e) - } - } + h.encRegexs((Regexs)(x), e) + } // end block: if x slice == nil } func (x *Regexs) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decRegexs((*Regexs)(x), d) - } + h.decRegexs((*Regexs)(x), d) } func (x *Regex) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + r.EncodeString(string(x.VA)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"VA\"") } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.VA)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"VA\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `VA`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.VA)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`VA`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.VA)) + z.EncWriteMapEnd() } } } func (x *Regex) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Regex{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Regex) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -16768,29 +12434,24 @@ func (x *Regex) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "VA": - if r.TryDecodeAsNil() { - x.VA = "" - } else { - x.VA = (string)(r.DecodeString()) - } + x.VA = (string)(string(r.DecodeStringAsBytes())) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Regex) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -16800,141 +12461,105 @@ func (x *Regex) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.VA = "" - } else { - x.VA = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.VA = (string)(string(r.DecodeStringAsBytes())) for { yyj5++ if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x Tables) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encTables((Tables)(x), e) - } - } + h.encTables((Tables)(x), e) + } // end block: if x slice == nil } func (x *Tables) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decTables((*Tables)(x), d) - } + h.decTables((*Tables)(x), d) } func (x *Table) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() + r.EncodeString(string(x.TB)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"TB\"") } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.TB)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"TB\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `TB`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.TB)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`TB`) } + z.EncWriteMapElemValue() + r.EncodeString(string(x.TB)) + z.EncWriteMapEnd() } } } func (x *Table) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Table{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Table) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -16944,29 +12569,24 @@ func (x *Table) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "TB": - if r.TryDecodeAsNil() { - x.TB = "" - } else { - x.TB = (string)(r.DecodeString()) - } + x.TB = (string)(string(r.DecodeStringAsBytes())) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Table) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj5 int @@ -16976,168 +12596,123 @@ func (x *Table) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TB = "" - } else { - x.TB = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.TB = (string)(string(r.DecodeStringAsBytes())) for { yyj5++ if yyhl5 { yyb5 = yyj5 > l } else { - yyb5 = r.CheckBreak() + yyb5 = z.DecCheckBreak() } if yyb5 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj5-1, "") } - r.ReadArrayEnd() } func (x Batchs) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encBatchs((Batchs)(x), e) - } - } + h.encBatchs((Batchs)(x), e) + } // end block: if x slice == nil } func (x *Batchs) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decBatchs((*Batchs)(x), d) - } + h.decBatchs((*Batchs)(x), d) } func (x *Batch) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + r.EncodeString(string(x.TB)) + z.EncWriteArrayElem() + if x.BA == nil { + r.EncodeNil() + } else { + h.encSlicePtrtoThing(([]*Thing)(x.BA), e) + } // end block: if x.BA slice == nil + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"TB\"") } else { - r.WriteMapStart(2) + r.EncodeString(`TB`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.TB)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.TB)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"BA\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"TB\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `TB`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.TB)) - } + r.EncodeString(`BA`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.BA == nil { - r.EncodeNil() - } else { - if false { - } else { - h.encSlicePtrtoThing(([]*Thing)(x.BA), e) - } - } + z.EncWriteMapElemValue() + if x.BA == nil { + r.EncodeNil() } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"BA\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `BA`) - } - r.WriteMapElemValue() - if x.BA == nil { - r.EncodeNil() - } else { - if false { - } else { - h.encSlicePtrtoThing(([]*Thing)(x.BA), e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } + h.encSlicePtrtoThing(([]*Thing)(x.BA), e) + } // end block: if x.BA slice == nil + z.EncWriteMapEnd() } } } func (x *Batch) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Batch{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Batch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -17147,38 +12722,26 @@ func (x *Batch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "TB": - if r.TryDecodeAsNil() { - x.TB = "" - } else { - x.TB = (string)(r.DecodeString()) - } + x.TB = (string)(string(r.DecodeStringAsBytes())) case "BA": - if r.TryDecodeAsNil() { - x.BA = nil - } else { - if false { - } else { - h.decSlicePtrtoThing((*[]*Thing)(&x.BA), d) - } - } + h.decSlicePtrtoThing((*[]*Thing)(&x.BA), d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Batch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj7 int @@ -17188,217 +12751,147 @@ func (x *Batch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TB = "" - } else { - x.TB = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.TB = (string)(string(r.DecodeStringAsBytes())) yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.BA = nil - } else { - if false { - } else { - h.decSlicePtrtoThing((*[]*Thing)(&x.BA), d) - } - } + z.DecReadArrayElem() + h.decSlicePtrtoThing((*[]*Thing)(&x.BA), d) for { yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj7-1, "") } - r.ReadArrayEnd() } func (x Models) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encModels((Models)(x), e) - } - } + h.encModels((Models)(x), e) + } // end block: if x slice == nil } func (x *Models) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decModels((*Models)(x), d) - } + h.decModels((*Models)(x), d) } func (x *Model) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(4) + z.EncWriteArrayElem() + r.EncodeString(string(x.TB)) + z.EncWriteArrayElem() + r.EncodeFloat64(float64(x.MIN)) + z.EncWriteArrayElem() + r.EncodeFloat64(float64(x.INC)) + z.EncWriteArrayElem() + r.EncodeFloat64(float64(x.MAX)) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) + z.EncWriteMapStart(4) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"TB\"") } else { - r.WriteMapStart(4) + r.EncodeString(`TB`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.TB)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.TB)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"MIN\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"TB\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `TB`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.TB)) - } + r.EncodeString(`MIN`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeFloat64(float64(x.MIN)) - } + z.EncWriteMapElemValue() + r.EncodeFloat64(float64(x.MIN)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"INC\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"MIN\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `MIN`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeFloat64(float64(x.MIN)) - } + r.EncodeString(`INC`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeFloat64(float64(x.INC)) - } + z.EncWriteMapElemValue() + r.EncodeFloat64(float64(x.INC)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"MAX\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"INC\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `INC`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeFloat64(float64(x.INC)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeFloat64(float64(x.MAX)) - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"MAX\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `MAX`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeFloat64(float64(x.MAX)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`MAX`) } + z.EncWriteMapElemValue() + r.EncodeFloat64(float64(x.MAX)) + z.EncWriteMapEnd() } } } func (x *Model) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Model{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Model) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -17408,47 +12901,30 @@ func (x *Model) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "TB": - if r.TryDecodeAsNil() { - x.TB = "" - } else { - x.TB = (string)(r.DecodeString()) - } + x.TB = (string)(string(r.DecodeStringAsBytes())) case "MIN": - if r.TryDecodeAsNil() { - x.MIN = 0 - } else { - x.MIN = (float64)(r.DecodeFloat64()) - } + x.MIN = (float64)(r.DecodeFloat64()) case "INC": - if r.TryDecodeAsNil() { - x.INC = 0 - } else { - x.INC = (float64)(r.DecodeFloat64()) - } + x.INC = (float64)(r.DecodeFloat64()) case "MAX": - if r.TryDecodeAsNil() { - x.MAX = 0 - } else { - x.MAX = (float64)(r.DecodeFloat64()) - } + x.MAX = (float64)(r.DecodeFloat64()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Model) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj8 int @@ -17458,218 +12934,151 @@ func (x *Model) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TB = "" - } else { - x.TB = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.TB = (string)(string(r.DecodeStringAsBytes())) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.MIN = 0 - } else { - x.MIN = (float64)(r.DecodeFloat64()) - } + z.DecReadArrayElem() + x.MIN = (float64)(r.DecodeFloat64()) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.INC = 0 - } else { - x.INC = (float64)(r.DecodeFloat64()) - } + z.DecReadArrayElem() + x.INC = (float64)(r.DecodeFloat64()) yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.MAX = 0 - } else { - x.MAX = (float64)(r.DecodeFloat64()) - } + z.DecReadArrayElem() + x.MAX = (float64)(r.DecodeFloat64()) for { yyj8++ if yyhl8 { yyb8 = yyj8 > l } else { - yyb8 = r.CheckBreak() + yyb8 = z.DecCheckBreak() } if yyb8 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj8-1, "") } - r.ReadArrayEnd() } func (x Things) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encThings((Things)(x), e) - } - } + h.encThings((Things)(x), e) + } // end block: if x slice == nil } func (x *Things) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decThings((*Things)(x), d) - } + h.decThings((*Things)(x), d) } func (x *Thing) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else if !z.EncBinary() { - z.EncTextMarshal(x) + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + r.EncodeString(string(x.TB)) + z.EncWriteArrayElem() + z.EncFallback(x.ID) + z.EncWriteArrayEnd() } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false // struct tag has 'toArray' - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"TB\"") } else { - r.WriteMapStart(2) + r.EncodeString(`TB`) } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.TB)) - } + z.EncWriteMapElemValue() + r.EncodeString(string(x.TB)) + z.EncWriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"ID\"") } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"TB\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `TB`) - } - r.WriteMapElemValue() - if false { - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, string(x.TB)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.ID == nil { - r.EncodeNil() - } else { - if false { - } else { - z.EncFallback(x.ID) - } - } - } else { - r.WriteMapElemKey() - if z.IsJSONHandle() { - z.WriteStr("\"ID\"") - } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `ID`) - } - r.WriteMapElemValue() - if x.ID == nil { - r.EncodeNil() - } else { - if false { - } else { - z.EncFallback(x.ID) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + r.EncodeString(`ID`) } + z.EncWriteMapElemValue() + z.EncFallback(x.ID) + z.EncWriteMapEnd() } } } func (x *Thing) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Thing{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Thing) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -17679,38 +13088,26 @@ func (x *Thing) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "TB": - if r.TryDecodeAsNil() { - x.TB = "" - } else { - x.TB = (string)(r.DecodeString()) - } + x.TB = (string)(string(r.DecodeStringAsBytes())) case "ID": - if r.TryDecodeAsNil() { - x.ID = nil - } else { - if false { - } else { - z.DecFallback(&x.ID, true) - } - } + z.DecFallback(&x.ID, true) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Thing) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj7 int @@ -17720,92 +13117,67 @@ func (x *Thing) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TB = "" - } else { - x.TB = (string)(r.DecodeString()) - } + z.DecReadArrayElem() + x.TB = (string)(string(r.DecodeStringAsBytes())) yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.ID = nil - } else { - if false { - } else { - z.DecFallback(&x.ID, true) - } - } + z.DecReadArrayElem() + z.DecFallback(&x.ID, true) for { yyj7++ if yyhl7 { yyb7 = yyj7 > l } else { - yyb7 = r.CheckBreak() + yyb7 = z.DecCheckBreak() } if yyb7 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj7-1, "") } - r.ReadArrayEnd() } func (x Points) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encPoints((Points)(x), e) - } - } + h.encPoints((Points)(x), e) + } // end block: if x slice == nil } func (x *Points) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decPoints((*Points)(x), d) - } + h.decPoints((*Points)(x), d) } func (x *Point) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else if !z.EncBinary() && z.IsJSONHandle() { + if !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(x) } else { yysep2 := !z.EncBinary() @@ -17813,88 +13185,63 @@ func (x *Point) CodecEncodeSelf(e *codec1978.Encoder) { _, _ = yysep2, yy2arr2 const yyr2 bool = false // struct tag has 'toArray' if yyr2 || yy2arr2 { - r.WriteArrayStart(2) + z.EncWriteArrayStart(2) + z.EncWriteArrayElem() + r.EncodeFloat64(float64(x.LA)) + z.EncWriteArrayElem() + r.EncodeFloat64(float64(x.LO)) + z.EncWriteArrayEnd() } else { - r.WriteMapStart(2) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeFloat64(float64(x.LA)) - } - } else { - r.WriteMapElemKey() + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() if z.IsJSONHandle() { z.WriteStr("\"LA\"") } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `LA`) + r.EncodeString(`LA`) } - r.WriteMapElemValue() - if false { - } else { - r.EncodeFloat64(float64(x.LA)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeFloat64(float64(x.LO)) - } - } else { - r.WriteMapElemKey() + z.EncWriteMapElemValue() + r.EncodeFloat64(float64(x.LA)) + z.EncWriteMapElemKey() if z.IsJSONHandle() { z.WriteStr("\"LO\"") } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `LO`) + r.EncodeString(`LO`) } - r.WriteMapElemValue() - if false { - } else { - r.EncodeFloat64(float64(x.LO)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncWriteMapElemValue() + r.EncodeFloat64(float64(x.LO)) + z.EncWriteMapEnd() } } } } func (x *Point) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Point{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Point) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -17904,35 +13251,26 @@ func (x *Point) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "LA": - if r.TryDecodeAsNil() { - x.LA = 0 - } else { - x.LA = (float64)(r.DecodeFloat64()) - } + x.LA = (float64)(r.DecodeFloat64()) case "LO": - if r.TryDecodeAsNil() { - x.LO = 0 - } else { - x.LO = (float64)(r.DecodeFloat64()) - } + x.LO = (float64)(r.DecodeFloat64()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Point) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -17942,195 +13280,141 @@ func (x *Point) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.LA = 0 - } else { - x.LA = (float64)(r.DecodeFloat64()) - } + z.DecReadArrayElem() + x.LA = (float64)(r.DecodeFloat64()) yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.LO = 0 - } else { - x.LO = (float64)(r.DecodeFloat64()) - } + z.DecReadArrayElem() + x.LO = (float64)(r.DecodeFloat64()) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x Circles) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encCircles((Circles)(x), e) - } - } + h.encCircles((Circles)(x), e) + } // end block: if x slice == nil } func (x *Circles) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decCircles((*Circles)(x), d) - } + h.decCircles((*Circles)(x), d) } func (x *Circle) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else if !z.EncBinary() && z.IsJSONHandle() { + if !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(x) } else { yysep2 := !z.EncBinary() yy2arr2 := z.EncBasicHandle().StructToArray _, _ = yysep2, yy2arr2 const yyr2 bool = false // struct tag has 'toArray' + var yyn3 bool = x.CE == nil if yyr2 || yy2arr2 { - r.WriteArrayStart(2) - } else { - r.WriteMapStart(2) - } - var yyn3 bool - if x.CE == nil { - yyn3 = true - goto LABEL3 - } - LABEL3: - if yyr2 || yy2arr2 { + z.EncWriteArrayStart(2) if yyn3 { - r.WriteArrayElem() + z.EncWriteArrayElem() r.EncodeNil() } else { - r.WriteArrayElem() - if x.CE == nil { - r.EncodeNil() - } else { - x.CE.CodecEncodeSelf(e) - } + z.EncWriteArrayElem() + x.CE.CodecEncodeSelf(e) } + z.EncWriteArrayElem() + r.EncodeFloat64(float64(x.RA)) + z.EncWriteArrayEnd() } else { - r.WriteMapElemKey() + z.EncWriteMapStart(2) + z.EncWriteMapElemKey() if z.IsJSONHandle() { z.WriteStr("\"CE\"") } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `CE`) + r.EncodeString(`CE`) } - r.WriteMapElemValue() + z.EncWriteMapElemValue() if yyn3 { r.EncodeNil() } else { - if x.CE == nil { - r.EncodeNil() - } else { - x.CE.CodecEncodeSelf(e) - } + x.CE.CodecEncodeSelf(e) } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if false { - } else { - r.EncodeFloat64(float64(x.RA)) - } - } else { - r.WriteMapElemKey() + z.EncWriteMapElemKey() if z.IsJSONHandle() { z.WriteStr("\"RA\"") } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `RA`) + r.EncodeString(`RA`) } - r.WriteMapElemValue() - if false { - } else { - r.EncodeFloat64(float64(x.RA)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + z.EncWriteMapElemValue() + r.EncodeFloat64(float64(x.RA)) + z.EncWriteMapEnd() } } } } func (x *Circle) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Circle{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Circle) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -18140,41 +13424,35 @@ func (x *Circle) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "CE": - if r.TryDecodeAsNil() { - if true && x.CE != nil { + if r.TryNil() { + if x.CE != nil { // remove the if-true x.CE = nil } } else { if x.CE == nil { x.CE = new(Point) } - x.CE.CodecDecodeSelf(d) } case "RA": - if r.TryDecodeAsNil() { - x.RA = 0 - } else { - x.RA = (float64)(r.DecodeFloat64()) - } + x.RA = (float64)(r.DecodeFloat64()) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Circle) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -18184,95 +13462,76 @@ func (x *Circle) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if true && x.CE != nil { + z.DecReadArrayElem() + if r.TryNil() { + if x.CE != nil { // remove the if-true x.CE = nil } } else { if x.CE == nil { x.CE = new(Point) } - x.CE.CodecDecodeSelf(d) } yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.RA = 0 - } else { - x.RA = (float64)(r.DecodeFloat64()) - } + z.DecReadArrayElem() + x.RA = (float64)(r.DecodeFloat64()) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } func (x Polygons) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else { - h.encPolygons((Polygons)(x), e) - } - } + h.encPolygons((Polygons)(x), e) + } // end block: if x slice == nil } func (x *Polygons) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - h.decPolygons((*Polygons)(x), d) - } + h.decPolygons((*Polygons)(x), d) } func (x *Polygon) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.EncExtension(x, yyxt1) - } else if !z.EncBinary() && z.IsJSONHandle() { + if !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(x) } else { yysep2 := !z.EncBinary() @@ -18280,77 +13539,61 @@ func (x *Polygon) CodecEncodeSelf(e *codec1978.Encoder) { _, _ = yysep2, yy2arr2 const yyr2 bool = false // struct tag has 'toArray' if yyr2 || yy2arr2 { - r.WriteArrayStart(1) - } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() + z.EncWriteArrayStart(1) + z.EncWriteArrayElem() if x.PS == nil { r.EncodeNil() } else { - if false { - } else { - h.encSlicePtrtoPoint(([]*Point)(x.PS), e) - } - } + h.encSlicePtrtoPoint(([]*Point)(x.PS), e) + } // end block: if x.PS slice == nil + z.EncWriteArrayEnd() } else { - r.WriteMapElemKey() + z.EncWriteMapStart(1) + z.EncWriteMapElemKey() if z.IsJSONHandle() { z.WriteStr("\"PS\"") } else { - r.EncodeStringEnc(codecSelferCcUTF85048, `PS`) + r.EncodeString(`PS`) } - r.WriteMapElemValue() + z.EncWriteMapElemValue() if x.PS == nil { r.EncodeNil() } else { - if false { - } else { - h.encSlicePtrtoPoint(([]*Point)(x.PS), e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() + h.encSlicePtrtoPoint(([]*Point)(x.PS), e) + } // end block: if x.PS slice == nil + z.EncWriteMapEnd() } } } } func (x *Polygon) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if false { - } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { - z.DecExtension(x, yyxt1) - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5048 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5048 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeNil7834 { + *(x) = Polygon{} + } else if yyct2 == codecSelferValueTypeMap7834 { + yyl2 := z.DecReadMapStart() + if yyl2 == 0 { } else { - panic(errCodecSelferOnlyMapOrArrayEncodeToStruct5048) + x.codecDecodeSelfFromMap(yyl2, d) } + z.DecReadMapEnd() + } else if yyct2 == codecSelferValueTypeArray7834 { + yyl2 := z.DecReadArrayStart() + if yyl2 != 0 { + x.codecDecodeSelfFromArray(yyl2, d) + } + z.DecReadArrayEnd() + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct7834) } } func (x *Polygon) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 @@ -18360,32 +13603,24 @@ func (x *Polygon) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { break } } else { - if r.CheckBreak() { + if z.DecCheckBreak() { break } } - r.ReadMapElemKey() + z.DecReadMapElemKey() yys3 := z.StringView(r.DecodeStringAsBytes()) - r.ReadMapElemValue() + z.DecReadMapElemValue() switch yys3 { case "PS": - if r.TryDecodeAsNil() { - x.PS = nil - } else { - if false { - } else { - h.decSlicePtrtoPoint((*[]*Point)(&x.PS), d) - } - } + h.decSlicePtrtoPoint((*[]*Point)(&x.PS), d) default: z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 - r.ReadMapEnd() } func (x *Polygon) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5048 + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj6 int @@ -18395,60 +13630,55 @@ func (x *Polygon) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { - r.ReadArrayEnd() + z.DecReadArrayEnd() return } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PS = nil - } else { - if false { - } else { - h.decSlicePtrtoPoint((*[]*Point)(&x.PS), d) - } - } + z.DecReadArrayElem() + h.decSlicePtrtoPoint((*[]*Point)(&x.PS), d) for { yyj6++ if yyhl6 { yyb6 = yyj6 > l } else { - yyb6 = r.CheckBreak() + yyb6 = z.DecCheckBreak() } if yyb6 { break } - r.ReadArrayElem() + z.DecReadArrayElem() z.DecStructFieldNotFound(yyj6-1, "") } - r.ReadArrayEnd() } -func (x codecSelfer5048) encStatements(v Statements, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encStatements(v Statements, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { - if false { - } else if yyxt2 := z.Extension(z.I2Rtid(yyv1)); yyxt2 != nil { + if yyxt2 := z.Extension(z.I2Rtid(yyv1)); yyxt2 != nil { z.EncExtension(yyv1, yyxt2) } else { z.EncFallback(yyv1) } } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decStatements(v *Statements, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decStatements(v *Statements, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -18456,7 +13686,12 @@ func (x codecSelfer5048) decStatements(v *Statements, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []Statement{} yyc1 = true @@ -18483,8 +13718,7 @@ func (x codecSelfer5048) decStatements(v *Statements, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 16) @@ -18495,29 +13729,20 @@ func (x codecSelfer5048) decStatements(v *Statements, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { - yyv1[yyj1] = nil + if yyxt3 := z.Extension(z.I2Rtid(yyv1[yyj1])); yyxt3 != nil { + z.DecExtension(yyv1[yyj1], yyxt3) } else { - if false { - } else if yyxt3 := z.Extension(z.I2Rtid(yyv1[yyj1])); yyxt3 != nil { - z.DecExtension(yyv1[yyj1], yyxt3) - } else { - z.DecFallback(&yyv1[yyj1], true) - } + z.DecFallback(&yyv1[yyj1], true) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -18533,29 +13758,32 @@ func (x codecSelfer5048) decStatements(v *Statements, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encExprs(v Exprs, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encExprs(v Exprs, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { - if false { - } else if yyxt2 := z.Extension(z.I2Rtid(yyv1)); yyxt2 != nil { + if yyxt2 := z.Extension(z.I2Rtid(yyv1)); yyxt2 != nil { z.EncExtension(yyv1, yyxt2) } else { z.EncFallback(yyv1) } } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decExprs(v *Exprs, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decExprs(v *Exprs, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -18563,7 +13791,12 @@ func (x codecSelfer5048) decExprs(v *Exprs, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []Expr{} yyc1 = true @@ -18590,8 +13823,7 @@ func (x codecSelfer5048) decExprs(v *Exprs, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 16) @@ -18602,29 +13834,20 @@ func (x codecSelfer5048) decExprs(v *Exprs, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { - yyv1[yyj1] = nil + if yyxt3 := z.Extension(z.I2Rtid(yyv1[yyj1])); yyxt3 != nil { + z.DecExtension(yyv1[yyj1], yyxt3) } else { - if false { - } else if yyxt3 := z.Extension(z.I2Rtid(yyv1[yyj1])); yyxt3 != nil { - z.DecExtension(yyv1[yyj1], yyxt3) - } else { - z.DecFallback(&yyv1[yyj1], true) - } + z.DecFallback(&yyv1[yyj1], true) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -18640,24 +13863,28 @@ func (x codecSelfer5048) decExprs(v *Exprs, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encFields(v Fields, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encFields(v Fields, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decFields(v *Fields, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decFields(v *Fields, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -18665,7 +13892,12 @@ func (x codecSelfer5048) decFields(v *Fields, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Field{} yyc1 = true @@ -18692,8 +13924,7 @@ func (x codecSelfer5048) decFields(v *Fields, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -18704,17 +13935,15 @@ func (x codecSelfer5048) decFields(v *Fields, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -18722,9 +13951,7 @@ func (x codecSelfer5048) decFields(v *Fields, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -18740,24 +13967,28 @@ func (x codecSelfer5048) decFields(v *Fields, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encGroups(v Groups, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encGroups(v Groups, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decGroups(v *Groups, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decGroups(v *Groups, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -18765,7 +13996,12 @@ func (x codecSelfer5048) decGroups(v *Groups, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Group{} yyc1 = true @@ -18792,8 +14028,7 @@ func (x codecSelfer5048) decGroups(v *Groups, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -18804,17 +14039,15 @@ func (x codecSelfer5048) decGroups(v *Groups, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -18822,9 +14055,7 @@ func (x codecSelfer5048) decGroups(v *Groups, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -18840,24 +14071,28 @@ func (x codecSelfer5048) decGroups(v *Groups, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encOrders(v Orders, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encOrders(v Orders, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decOrders(v *Orders, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decOrders(v *Orders, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -18865,7 +14100,12 @@ func (x codecSelfer5048) decOrders(v *Orders, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Order{} yyc1 = true @@ -18892,8 +14132,7 @@ func (x codecSelfer5048) decOrders(v *Orders, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -18904,17 +14143,15 @@ func (x codecSelfer5048) decOrders(v *Orders, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -18922,9 +14159,7 @@ func (x codecSelfer5048) decOrders(v *Orders, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -18940,24 +14175,28 @@ func (x codecSelfer5048) decOrders(v *Orders, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encFetchs(v Fetchs, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encFetchs(v Fetchs, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decFetchs(v *Fetchs, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decFetchs(v *Fetchs, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -18965,7 +14204,12 @@ func (x codecSelfer5048) decFetchs(v *Fetchs, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Fetch{} yyc1 = true @@ -18992,8 +14236,7 @@ func (x codecSelfer5048) decFetchs(v *Fetchs, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19004,17 +14247,15 @@ func (x codecSelfer5048) decFetchs(v *Fetchs, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19022,9 +14263,7 @@ func (x codecSelfer5048) decFetchs(v *Fetchs, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19040,29 +14279,32 @@ func (x codecSelfer5048) decFetchs(v *Fetchs, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encSliceExpr(v []Expr, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encSliceExpr(v []Expr, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { - if false { - } else if yyxt2 := z.Extension(z.I2Rtid(yyv1)); yyxt2 != nil { + if yyxt2 := z.Extension(z.I2Rtid(yyv1)); yyxt2 != nil { z.EncExtension(yyv1, yyxt2) } else { z.EncFallback(yyv1) } } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decSliceExpr(v *[]Expr, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decSliceExpr(v *[]Expr, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19070,7 +14312,12 @@ func (x codecSelfer5048) decSliceExpr(v *[]Expr, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []Expr{} yyc1 = true @@ -19097,8 +14344,7 @@ func (x codecSelfer5048) decSliceExpr(v *[]Expr, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 16) @@ -19109,29 +14355,20 @@ func (x codecSelfer5048) decSliceExpr(v *[]Expr, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { - yyv1[yyj1] = nil + if yyxt3 := z.Extension(z.I2Rtid(yyv1[yyj1])); yyxt3 != nil { + z.DecExtension(yyv1[yyj1], yyxt3) } else { - if false { - } else if yyxt3 := z.Extension(z.I2Rtid(yyv1[yyj1])); yyxt3 != nil { - z.DecExtension(yyv1[yyj1], yyxt3) - } else { - z.DecFallback(&yyv1[yyj1], true) - } + z.DecFallback(&yyv1[yyj1], true) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19147,24 +14384,28 @@ func (x codecSelfer5048) decSliceExpr(v *[]Expr, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encSlicePtrtoItemExpression(v []*ItemExpression, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encSlicePtrtoItemExpression(v []*ItemExpression, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decSlicePtrtoItemExpression(v *[]*ItemExpression, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decSlicePtrtoItemExpression(v *[]*ItemExpression, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19172,7 +14413,12 @@ func (x codecSelfer5048) decSlicePtrtoItemExpression(v *[]*ItemExpression, d *co yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*ItemExpression{} yyc1 = true @@ -19199,8 +14445,7 @@ func (x codecSelfer5048) decSlicePtrtoItemExpression(v *[]*ItemExpression, d *co } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19211,17 +14456,15 @@ func (x codecSelfer5048) decSlicePtrtoItemExpression(v *[]*ItemExpression, d *co yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19229,9 +14472,7 @@ func (x codecSelfer5048) decSlicePtrtoItemExpression(v *[]*ItemExpression, d *co } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19247,24 +14488,28 @@ func (x codecSelfer5048) decSlicePtrtoItemExpression(v *[]*ItemExpression, d *co } } -func (x codecSelfer5048) encParams(v Params, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encParams(v Params, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decParams(v *Params, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decParams(v *Params, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19272,7 +14517,12 @@ func (x codecSelfer5048) decParams(v *Params, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Param{} yyc1 = true @@ -19299,8 +14549,7 @@ func (x codecSelfer5048) decParams(v *Params, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19311,17 +14560,15 @@ func (x codecSelfer5048) decParams(v *Params, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19329,9 +14576,7 @@ func (x codecSelfer5048) decParams(v *Params, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19347,24 +14592,28 @@ func (x codecSelfer5048) decParams(v *Params, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encIdents(v Idents, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encIdents(v Idents, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decIdents(v *Idents, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decIdents(v *Idents, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19372,7 +14621,12 @@ func (x codecSelfer5048) decIdents(v *Idents, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Ident{} yyc1 = true @@ -19399,8 +14653,7 @@ func (x codecSelfer5048) decIdents(v *Idents, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19411,17 +14664,15 @@ func (x codecSelfer5048) decIdents(v *Idents, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19429,9 +14680,7 @@ func (x codecSelfer5048) decIdents(v *Idents, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19447,24 +14696,28 @@ func (x codecSelfer5048) decIdents(v *Idents, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encValues(v Values, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encValues(v Values, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decValues(v *Values, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decValues(v *Values, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19472,7 +14725,12 @@ func (x codecSelfer5048) decValues(v *Values, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Value{} yyc1 = true @@ -19499,8 +14757,7 @@ func (x codecSelfer5048) decValues(v *Values, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19511,17 +14768,15 @@ func (x codecSelfer5048) decValues(v *Values, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19529,9 +14784,7 @@ func (x codecSelfer5048) decValues(v *Values, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19547,24 +14800,28 @@ func (x codecSelfer5048) decValues(v *Values, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encRegexs(v Regexs, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encRegexs(v Regexs, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decRegexs(v *Regexs, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decRegexs(v *Regexs, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19572,7 +14829,12 @@ func (x codecSelfer5048) decRegexs(v *Regexs, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Regex{} yyc1 = true @@ -19599,8 +14861,7 @@ func (x codecSelfer5048) decRegexs(v *Regexs, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19611,17 +14872,15 @@ func (x codecSelfer5048) decRegexs(v *Regexs, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19629,9 +14888,7 @@ func (x codecSelfer5048) decRegexs(v *Regexs, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19647,24 +14904,28 @@ func (x codecSelfer5048) decRegexs(v *Regexs, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encTables(v Tables, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encTables(v Tables, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decTables(v *Tables, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decTables(v *Tables, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19672,7 +14933,12 @@ func (x codecSelfer5048) decTables(v *Tables, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Table{} yyc1 = true @@ -19699,8 +14965,7 @@ func (x codecSelfer5048) decTables(v *Tables, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19711,17 +14976,15 @@ func (x codecSelfer5048) decTables(v *Tables, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19729,9 +14992,7 @@ func (x codecSelfer5048) decTables(v *Tables, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19747,24 +15008,28 @@ func (x codecSelfer5048) decTables(v *Tables, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encBatchs(v Batchs, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encBatchs(v Batchs, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decBatchs(v *Batchs, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decBatchs(v *Batchs, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19772,7 +15037,12 @@ func (x codecSelfer5048) decBatchs(v *Batchs, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Batch{} yyc1 = true @@ -19799,8 +15069,7 @@ func (x codecSelfer5048) decBatchs(v *Batchs, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19811,17 +15080,15 @@ func (x codecSelfer5048) decBatchs(v *Batchs, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19829,9 +15096,7 @@ func (x codecSelfer5048) decBatchs(v *Batchs, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19847,24 +15112,28 @@ func (x codecSelfer5048) decBatchs(v *Batchs, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encSlicePtrtoThing(v []*Thing, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encSlicePtrtoThing(v []*Thing, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decSlicePtrtoThing(v *[]*Thing, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decSlicePtrtoThing(v *[]*Thing, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19872,7 +15141,12 @@ func (x codecSelfer5048) decSlicePtrtoThing(v *[]*Thing, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Thing{} yyc1 = true @@ -19899,8 +15173,7 @@ func (x codecSelfer5048) decSlicePtrtoThing(v *[]*Thing, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -19911,17 +15184,15 @@ func (x codecSelfer5048) decSlicePtrtoThing(v *[]*Thing, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -19929,9 +15200,7 @@ func (x codecSelfer5048) decSlicePtrtoThing(v *[]*Thing, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -19947,24 +15216,28 @@ func (x codecSelfer5048) decSlicePtrtoThing(v *[]*Thing, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encModels(v Models, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encModels(v Models, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decModels(v *Models, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decModels(v *Models, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -19972,7 +15245,12 @@ func (x codecSelfer5048) decModels(v *Models, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Model{} yyc1 = true @@ -19999,8 +15277,7 @@ func (x codecSelfer5048) decModels(v *Models, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -20011,17 +15288,15 @@ func (x codecSelfer5048) decModels(v *Models, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -20029,9 +15304,7 @@ func (x codecSelfer5048) decModels(v *Models, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -20047,24 +15320,28 @@ func (x codecSelfer5048) decModels(v *Models, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encThings(v Things, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encThings(v Things, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decThings(v *Things, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decThings(v *Things, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -20072,7 +15349,12 @@ func (x codecSelfer5048) decThings(v *Things, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Thing{} yyc1 = true @@ -20099,8 +15381,7 @@ func (x codecSelfer5048) decThings(v *Things, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -20111,17 +15392,15 @@ func (x codecSelfer5048) decThings(v *Things, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -20129,9 +15408,7 @@ func (x codecSelfer5048) decThings(v *Things, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -20147,24 +15424,28 @@ func (x codecSelfer5048) decThings(v *Things, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encPoints(v Points, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encPoints(v Points, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decPoints(v *Points, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decPoints(v *Points, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -20172,7 +15453,12 @@ func (x codecSelfer5048) decPoints(v *Points, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Point{} yyc1 = true @@ -20199,8 +15485,7 @@ func (x codecSelfer5048) decPoints(v *Points, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -20211,17 +15496,15 @@ func (x codecSelfer5048) decPoints(v *Points, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -20229,9 +15512,7 @@ func (x codecSelfer5048) decPoints(v *Points, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -20247,24 +15528,28 @@ func (x codecSelfer5048) decPoints(v *Points, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encCircles(v Circles, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encCircles(v Circles, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decCircles(v *Circles, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decCircles(v *Circles, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -20272,7 +15557,12 @@ func (x codecSelfer5048) decCircles(v *Circles, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Circle{} yyc1 = true @@ -20299,8 +15589,7 @@ func (x codecSelfer5048) decCircles(v *Circles, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -20311,17 +15600,15 @@ func (x codecSelfer5048) decCircles(v *Circles, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -20329,9 +15616,7 @@ func (x codecSelfer5048) decCircles(v *Circles, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -20347,24 +15632,28 @@ func (x codecSelfer5048) decCircles(v *Circles, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encPolygons(v Polygons, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encPolygons(v Polygons, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decPolygons(v *Polygons, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decPolygons(v *Polygons, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -20372,7 +15661,12 @@ func (x codecSelfer5048) decPolygons(v *Polygons, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Polygon{} yyc1 = true @@ -20399,8 +15693,7 @@ func (x codecSelfer5048) decPolygons(v *Polygons, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -20411,17 +15704,15 @@ func (x codecSelfer5048) decPolygons(v *Polygons, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -20429,9 +15720,7 @@ func (x codecSelfer5048) decPolygons(v *Polygons, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] @@ -20447,24 +15736,28 @@ func (x codecSelfer5048) decPolygons(v *Polygons, d *codec1978.Decoder) { } } -func (x codecSelfer5048) encSlicePtrtoPoint(v []*Point, e *codec1978.Encoder) { - var h codecSelfer5048 +func (x codecSelfer7834) encSlicePtrtoPoint(v []*Point, e *codec1978.Encoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.WriteArrayStart(len(v)) + if v == nil { + r.EncodeNil() + return + } + z.EncWriteArrayStart(len(v)) for _, yyv1 := range v { - r.WriteArrayElem() + z.EncWriteArrayElem() if yyv1 == nil { r.EncodeNil() } else { yyv1.CodecEncodeSelf(e) } } - r.WriteArrayEnd() + z.EncWriteArrayEnd() } -func (x codecSelfer5048) decSlicePtrtoPoint(v *[]*Point, d *codec1978.Decoder) { - var h codecSelfer5048 +func (x codecSelfer7834) decSlicePtrtoPoint(v *[]*Point, d *codec1978.Decoder) { + var h codecSelfer7834 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -20472,7 +15765,12 @@ func (x codecSelfer5048) decSlicePtrtoPoint(v *[]*Point, d *codec1978.Decoder) { yyh1, yyl1 := z.DecSliceHelperStart() var yyc1 bool _ = yyc1 - if yyl1 == 0 { + if yyh1.IsNil { + if yyv1 != nil { + yyv1 = nil + yyc1 = true + } + } else if yyl1 == 0 { if yyv1 == nil { yyv1 = []*Point{} yyc1 = true @@ -20499,8 +15797,7 @@ func (x codecSelfer5048) decSlicePtrtoPoint(v *[]*Point, d *codec1978.Decoder) { } } var yyj1 int - // var yydn1 bool - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -20511,17 +15808,15 @@ func (x codecSelfer5048) decSlicePtrtoPoint(v *[]*Point, d *codec1978.Decoder) { yyc1 = true } yyh1.ElemContainerState(yyj1) - var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, nil) yyc1 = true - } if yydb1 { z.DecSwallow() } else { - if r.TryDecodeAsNil() { + if r.TryNil() { yyv1[yyj1] = nil } else { if yyv1[yyj1] == nil { @@ -20529,9 +15824,7 @@ func (x codecSelfer5048) decSlicePtrtoPoint(v *[]*Point, d *codec1978.Decoder) { } yyv1[yyj1].CodecDecodeSelf(d) } - } - } if yyj1 < len(yyv1) { yyv1 = yyv1[:yyj1] diff --git a/sql/gen.go b/sql/gen.go index 87c5594b..420cbeb5 100644 --- a/sql/gen.go +++ b/sql/gen.go @@ -18,5 +18,5 @@ package sql //go:generate tmpl -file=kill.gen.json kill.gen.go.tmpl //go:generate tmpl -file=rdwr.gen.json rdwr.gen.go.tmpl -//go:generate go get -u github.com/ugorji/go/codec/codecgen@v0.0.0-20181204163529-d75b2dcb6bc8 +//go:generate go get -u github.com/ugorji/go/codec/codecgen //go:generate codecgen -o ast.gen.go ast.go diff --git a/txn/db.go b/txn/db.go new file mode 100644 index 00000000..e2bc26ac --- /dev/null +++ b/txn/db.go @@ -0,0 +1,107 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllDB(ctx context.Context, ns string) (out []*sql.DefineDatabaseStatement, err error) { + + var kvs []kvs.KV + + key := &keys.DB{KV: cnf.Settings.DB.Base, NS: ns, DB: keys.Ignore} + + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineDatabaseStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetDB(ctx context.Context, ns, db string) (val *sql.DefineDatabaseStatement, err error) { + + if out, ok := t.get(_db, db); ok { + return out.(*sql.DefineDatabaseStatement), nil + } + + var kv kvs.KV + + key := &keys.DB{KV: cnf.Settings.DB.Base, NS: ns, DB: db} + + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorDBNotFound + } + + val = &sql.DefineDatabaseStatement{} + val.Decode(kv.Val()) + + t.set(_db, db, val) + + return + +} + +func (t *TX) AddDB(ctx context.Context, ns, db string) (val *sql.DefineDatabaseStatement, err error) { + + if out, ok := t.get(_db, db); ok { + return out.(*sql.DefineDatabaseStatement), nil + } + + if _, err = t.AddNS(ctx, ns); err != nil { + return + } + + var kv kvs.KV + + key := &keys.DB{KV: cnf.Settings.DB.Base, NS: ns, DB: db} + + if kv, _ = t.Get(ctx, 0, key.Encode()); kv.Exi() { + val = &sql.DefineDatabaseStatement{} + val.Decode(kv.Val()) + t.set(_db, db, val) + return + } + + val = &sql.DefineDatabaseStatement{Name: sql.NewIdent(db)} + t.PutC(ctx, 0, key.Encode(), val.Encode(), nil) + + t.set(_db, db, val) + + return + +} + +func (t *TX) DelDB(ns, db string) { + + t.del(_db, db) + +} diff --git a/txn/dt.go b/txn/dt.go new file mode 100644 index 00000000..024c7c8f --- /dev/null +++ b/txn/dt.go @@ -0,0 +1,63 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllDT(ctx context.Context, ns, db string) (out []*sql.DefineTokenStatement, err error) { + + var kvs []kvs.KV + + key := &keys.DT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TK: keys.Ignore} + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineTokenStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetDT(ctx context.Context, ns, db, tk string) (val *sql.DefineTokenStatement, err error) { + + var kv kvs.KV + + key := &keys.DT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TK: tk} + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorDTNotFound + } + + val = &sql.DefineTokenStatement{} + val.Decode(kv.Val()) + + return + +} diff --git a/txn/du.go b/txn/du.go new file mode 100644 index 00000000..81dbb944 --- /dev/null +++ b/txn/du.go @@ -0,0 +1,63 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllDU(ctx context.Context, ns, db string) (out []*sql.DefineLoginStatement, err error) { + + var kvs []kvs.KV + + key := &keys.DU{KV: cnf.Settings.DB.Base, NS: ns, DB: db, US: keys.Ignore} + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineLoginStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetDU(ctx context.Context, ns, db, us string) (val *sql.DefineLoginStatement, err error) { + + var kv kvs.KV + + key := &keys.DU{KV: cnf.Settings.DB.Base, NS: ns, DB: db, US: us} + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorDUNotFound + } + + val = &sql.DefineLoginStatement{} + val.Decode(kv.Val()) + + return + +} diff --git a/mem/err.go b/txn/err.go similarity index 99% rename from mem/err.go rename to txn/err.go index 8ee620c3..1515721d 100644 --- a/mem/err.go +++ b/txn/err.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package mem +package txn import "errors" diff --git a/txn/ev.go b/txn/ev.go new file mode 100644 index 00000000..2f1c0d56 --- /dev/null +++ b/txn/ev.go @@ -0,0 +1,56 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllEV(ctx context.Context, ns, db, tb string) (out []*sql.DefineEventStatement, err error) { + + if out, ok := t.get(_ev, tb); ok { + return out.([]*sql.DefineEventStatement), nil + } + + var kvs []kvs.KV + + key := &keys.EV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, EV: keys.Ignore} + + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineEventStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + t.set(_ev, tb, out) + + return + +} + +func (t *TX) DelEV(ns, db, tb, ev string) { + + t.del(_ev, tb) + +} diff --git a/txn/fd.go b/txn/fd.go new file mode 100644 index 00000000..e94dff7f --- /dev/null +++ b/txn/fd.go @@ -0,0 +1,56 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllFD(ctx context.Context, ns, db, tb string) (out []*sql.DefineFieldStatement, err error) { + + if out, ok := t.get(_fd, tb); ok { + return out.([]*sql.DefineFieldStatement), nil + } + + var kvs []kvs.KV + + key := &keys.FD{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FD: keys.Ignore} + + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineFieldStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + t.set(_fd, tb, out) + + return + +} + +func (t *TX) DelFD(ns, db, tb, fd string) { + + t.del(_fd, tb) + +} diff --git a/txn/ft.go b/txn/ft.go new file mode 100644 index 00000000..bbb81c62 --- /dev/null +++ b/txn/ft.go @@ -0,0 +1,56 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllFT(ctx context.Context, ns, db, tb string) (out []*sql.DefineTableStatement, err error) { + + if out, ok := t.get(_ft, tb); ok { + return out.([]*sql.DefineTableStatement), nil + } + + var kvs []kvs.KV + + key := &keys.FT{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, FT: keys.Ignore} + + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineTableStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + t.set(_ft, tb, out) + + return + +} + +func (t *TX) DelFT(ns, db, tb, ft string) { + + t.del(_ft, tb) + +} diff --git a/txn/ix.go b/txn/ix.go new file mode 100644 index 00000000..4345c782 --- /dev/null +++ b/txn/ix.go @@ -0,0 +1,56 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllIX(ctx context.Context, ns, db, tb string) (out []*sql.DefineIndexStatement, err error) { + + if out, ok := t.get(_ix, tb); ok { + return out.([]*sql.DefineIndexStatement), nil + } + + var kvs []kvs.KV + + key := &keys.IX{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, IX: keys.Ignore} + + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineIndexStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + t.set(_ix, tb, out) + + return + +} + +func (t *TX) DelIX(ns, db, tb, ix string) { + + t.del(_ix, tb) + +} diff --git a/txn/lv.go b/txn/lv.go new file mode 100644 index 00000000..e14b92d9 --- /dev/null +++ b/txn/lv.go @@ -0,0 +1,57 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllLV(ctx context.Context, ns, db, tb string) (out []*sql.LiveStatement, err error) { + + return + if out, ok := t.get(_lv, tb); ok { + return out.([]*sql.LiveStatement), nil + } + + var kvs []kvs.KV + + key := &keys.LV{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb, LV: keys.Ignore} + + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.LiveStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + t.set(_lv, tb, out) + + return + +} + +func (t *TX) DelLV(ns, db, tb, lv string) { + + t.del(_lv, tb) + +} diff --git a/txn/ns.go b/txn/ns.go new file mode 100644 index 00000000..b1dd797c --- /dev/null +++ b/txn/ns.go @@ -0,0 +1,103 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllNS(ctx context.Context) (out []*sql.DefineNamespaceStatement, err error) { + + var kvs []kvs.KV + + key := &keys.NS{KV: cnf.Settings.DB.Base, NS: keys.Ignore} + + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineNamespaceStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetNS(ctx context.Context, ns string) (val *sql.DefineNamespaceStatement, err error) { + + if out, ok := t.get(_ns, ns); ok { + return out.(*sql.DefineNamespaceStatement), nil + } + + var kv kvs.KV + + key := &keys.NS{KV: cnf.Settings.DB.Base, NS: ns} + + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorNSNotFound + } + + val = &sql.DefineNamespaceStatement{} + val.Decode(kv.Val()) + + t.set(_ns, ns, val) + + return + +} + +func (t *TX) AddNS(ctx context.Context, ns string) (val *sql.DefineNamespaceStatement, err error) { + + if out, ok := t.get(_ns, ns); ok { + return out.(*sql.DefineNamespaceStatement), nil + } + + var kv kvs.KV + + key := &keys.NS{KV: cnf.Settings.DB.Base, NS: ns} + + if kv, _ = t.Get(ctx, 0, key.Encode()); kv.Exi() { + val = &sql.DefineNamespaceStatement{} + val.Decode(kv.Val()) + t.set(_ns, ns, val) + return + } + + val = &sql.DefineNamespaceStatement{Name: sql.NewIdent(ns)} + t.PutC(ctx, 0, key.Encode(), val.Encode(), nil) + + t.set(_ns, ns, val) + + return + +} + +func (t *TX) DelNS(ns string) { + + t.del(_ns, ns) + +} diff --git a/txn/nt.go b/txn/nt.go new file mode 100644 index 00000000..a145066b --- /dev/null +++ b/txn/nt.go @@ -0,0 +1,63 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllNT(ctx context.Context, ns string) (out []*sql.DefineTokenStatement, err error) { + + var kvs []kvs.KV + + key := &keys.NT{KV: cnf.Settings.DB.Base, NS: ns, TK: keys.Ignore} + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineTokenStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetNT(ctx context.Context, ns, tk string) (val *sql.DefineTokenStatement, err error) { + + var kv kvs.KV + + key := &keys.NT{KV: cnf.Settings.DB.Base, NS: ns, TK: tk} + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorNTNotFound + } + + val = &sql.DefineTokenStatement{} + val.Decode(kv.Val()) + + return + +} diff --git a/txn/nu.go b/txn/nu.go new file mode 100644 index 00000000..fffb1615 --- /dev/null +++ b/txn/nu.go @@ -0,0 +1,63 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllNU(ctx context.Context, ns string) (out []*sql.DefineLoginStatement, err error) { + + var kvs []kvs.KV + + key := &keys.NU{KV: cnf.Settings.DB.Base, NS: ns, US: keys.Ignore} + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineLoginStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetNU(ctx context.Context, ns, us string) (val *sql.DefineLoginStatement, err error) { + + var kv kvs.KV + + key := &keys.NU{KV: cnf.Settings.DB.Base, NS: ns, US: us} + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorNUNotFound + } + + val = &sql.DefineLoginStatement{} + val.Decode(kv.Val()) + + return + +} diff --git a/txn/sc.go b/txn/sc.go new file mode 100644 index 00000000..38591f85 --- /dev/null +++ b/txn/sc.go @@ -0,0 +1,63 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllSC(ctx context.Context, ns, db string) (out []*sql.DefineScopeStatement, err error) { + + var kvs []kvs.KV + + key := &keys.SC{KV: cnf.Settings.DB.Base, NS: ns, DB: db, SC: keys.Ignore} + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineScopeStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetSC(ctx context.Context, ns, db, sc string) (val *sql.DefineScopeStatement, err error) { + + var kv kvs.KV + + key := &keys.SC{KV: cnf.Settings.DB.Base, NS: ns, DB: db, SC: sc} + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorSCNotFound + } + + val = &sql.DefineScopeStatement{} + val.Decode(kv.Val()) + + return + +} diff --git a/txn/st.go b/txn/st.go new file mode 100644 index 00000000..a8078b1a --- /dev/null +++ b/txn/st.go @@ -0,0 +1,63 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllST(ctx context.Context, ns, db, sc string) (out []*sql.DefineTokenStatement, err error) { + + var kvs []kvs.KV + + key := &keys.ST{KV: cnf.Settings.DB.Base, NS: ns, DB: db, SC: sc, TK: keys.Ignore} + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineTokenStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetST(ctx context.Context, ns, db, sc, tk string) (val *sql.DefineTokenStatement, err error) { + + var kv kvs.KV + + key := &keys.ST{KV: cnf.Settings.DB.Base, NS: ns, DB: db, SC: sc, TK: tk} + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorSTNotFound + } + + val = &sql.DefineTokenStatement{} + val.Decode(kv.Val()) + + return + +} diff --git a/txn/tb.go b/txn/tb.go new file mode 100644 index 00000000..ad687ad1 --- /dev/null +++ b/txn/tb.go @@ -0,0 +1,107 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "context" + + "github.com/abcum/surreal/cnf" + "github.com/abcum/surreal/kvs" + "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/util/keys" +) + +func (t *TX) AllTB(ctx context.Context, ns, db string) (out []*sql.DefineTableStatement, err error) { + + var kvs []kvs.KV + + key := &keys.TB{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: keys.Ignore} + + if kvs, err = t.GetP(ctx, 0, key.Encode(), 0); err != nil { + return + } + + for _, kv := range kvs { + val := &sql.DefineTableStatement{} + val.Decode(kv.Val()) + out = append(out, val) + } + + return + +} + +func (t *TX) GetTB(ctx context.Context, ns, db, tb string) (val *sql.DefineTableStatement, err error) { + + if out, ok := t.get(_tb, tb); ok { + return out.(*sql.DefineTableStatement), nil + } + + var kv kvs.KV + + key := &keys.TB{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb} + + if kv, err = t.Get(ctx, 0, key.Encode()); err != nil { + return nil, err + } + + if !kv.Exi() { + return nil, ErrorTBNotFound + } + + val = &sql.DefineTableStatement{} + val.Decode(kv.Val()) + + t.set(_tb, tb, val) + + return + +} + +func (t *TX) AddTB(ctx context.Context, ns, db, tb string) (val *sql.DefineTableStatement, err error) { + + if out, ok := t.get(_tb, tb); ok { + return out.(*sql.DefineTableStatement), nil + } + + if _, err = t.AddDB(ctx, ns, db); err != nil { + return + } + + var kv kvs.KV + + key := &keys.TB{KV: cnf.Settings.DB.Base, NS: ns, DB: db, TB: tb} + + if kv, _ = t.Get(ctx, 0, key.Encode()); kv.Exi() { + val = &sql.DefineTableStatement{} + val.Decode(kv.Val()) + t.set(_tb, tb, val) + return + } + + val = &sql.DefineTableStatement{Name: sql.NewIdent(tb)} + t.PutC(ctx, 0, key.Encode(), val.Encode(), nil) + + t.set(_tb, tb, val) + + return + +} + +func (t *TX) DelTB(ns, db, tb string) { + + t.del(_tb, tb) + +} diff --git a/txn/txn.go b/txn/txn.go new file mode 100644 index 00000000..17f0b791 --- /dev/null +++ b/txn/txn.go @@ -0,0 +1,120 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package txn + +import ( + "sync" + + "context" + + "github.com/abcum/surreal/kvs" +) + +type symbol int8 + +const ( + _ns symbol = iota + _db + _tb + _fd + _ix + _ev + _ft + _lv + _kv +) + +// -------------------------------------------------- + +type TX struct { + kvs.TX + lock sync.RWMutex + data map[symbol]map[string]interface{} +} + +func New(ctx context.Context, rw bool) (*TX, error) { + txn, err := kvs.Begin(ctx, rw) + if err != nil { + return nil, err + } + return &TX{TX: txn}, nil +} + +// -------------------------------------------------- + +func (t *TX) mem(s symbol) { + t.lock.Lock() + if t.data == nil { + t.data = make(map[symbol]map[string]interface{}, 8) + } + if t.data[s] == nil { + t.data[s] = make(map[string]interface{}, 5) + } + t.lock.Unlock() +} + +func (t *TX) del(s symbol, key string) { + t.mem(s) + t.lock.Lock() + delete(t.data[s], key) + t.lock.Unlock() +} + +func (t *TX) set(s symbol, key string, val interface{}) { + t.mem(s) + t.lock.Lock() + t.data[s][key] = val + t.lock.Unlock() +} + +func (t *TX) get(s symbol, key string) (val interface{}, ok bool) { + t.mem(s) + t.lock.RLock() + val, ok = t.data[s][key] + t.lock.RUnlock() + return +} + +// -------------------------------------------------- + +/*func (t *TX) _put(key []byte, val interface{}) { + t.mem(_kv) + t.lock.Lock() + t.data[_kv][string(key)] = val + t.lock.Unlock() +} + +func (t *TX) _get(key []byte) (val interface{}, ok bool) { + t.mem(_kv) + t.lock.RLock() + val, ok = t.data[_kv][string(key)] + t.lock.RUnlock() + return +} + +func (t *TX) Get(ctx context.Context, ver int64, key []byte) (kvs.KV, error) { + + if kv, ok := t._get(key); ok { + fmt.Println(key) + return kv.(kvs.KV), nil + } + + kv, err := t.TX.Get(ctx, ver, key) + + t._put(key, kv) + + return kv, err + +}*/ diff --git a/util/fncs/batch.go b/util/fncs/batch.go index 1858e130..4919fa0e 100644 --- a/util/fncs/batch.go +++ b/util/fncs/batch.go @@ -17,8 +17,8 @@ package fncs import ( "context" - "github.com/abcum/surreal/mem" "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/txn" ) func batch(ctx context.Context, args ...interface{}) (interface{}, error) { @@ -27,7 +27,7 @@ func batch(ctx context.Context, args ...interface{}) (interface{}, error) { id, _ := ensureSlice(args[1]) if len(tb) == 0 { - return nil, mem.ErrorTBNotFound + return nil, txn.ErrorTBNotFound } return sql.NewBatch(tb, id), nil diff --git a/util/fncs/model.go b/util/fncs/model.go index 241d9896..3f6f5159 100644 --- a/util/fncs/model.go +++ b/util/fncs/model.go @@ -17,8 +17,8 @@ package fncs import ( "context" - "github.com/abcum/surreal/mem" "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/txn" ) func model(ctx context.Context, args ...interface{}) (interface{}, error) { @@ -26,7 +26,7 @@ func model(ctx context.Context, args ...interface{}) (interface{}, error) { tb, _ := ensureString(args[0]) if len(tb) == 0 { - return nil, mem.ErrorTBNotFound + return nil, txn.ErrorTBNotFound } switch len(args) { diff --git a/util/fncs/table.go b/util/fncs/table.go index d7a39fda..823b923f 100644 --- a/util/fncs/table.go +++ b/util/fncs/table.go @@ -17,8 +17,8 @@ package fncs import ( "context" - "github.com/abcum/surreal/mem" "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/txn" ) func table(ctx context.Context, args ...interface{}) (interface{}, error) { @@ -26,7 +26,7 @@ func table(ctx context.Context, args ...interface{}) (interface{}, error) { tb, _ := ensureString(args[0]) if len(tb) == 0 { - return nil, mem.ErrorTBNotFound + return nil, txn.ErrorTBNotFound } return sql.NewTable(tb), nil diff --git a/util/fncs/thing.go b/util/fncs/thing.go index abbd5023..b44d6f6d 100644 --- a/util/fncs/thing.go +++ b/util/fncs/thing.go @@ -17,8 +17,8 @@ package fncs import ( "context" - "github.com/abcum/surreal/mem" "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/txn" ) func thing(ctx context.Context, args ...interface{}) (interface{}, error) { @@ -26,7 +26,7 @@ func thing(ctx context.Context, args ...interface{}) (interface{}, error) { tb, _ := ensureString(args[0]) if len(tb) == 0 { - return nil, mem.ErrorTBNotFound + return nil, txn.ErrorTBNotFound } return sql.NewThing(tb, args[1]), nil diff --git a/web/auth.go b/web/auth.go index c936abdc..0274c765 100644 --- a/web/auth.go +++ b/web/auth.go @@ -26,9 +26,8 @@ import ( "github.com/abcum/fibre" "github.com/abcum/surreal/cnf" "github.com/abcum/surreal/db" - "github.com/abcum/surreal/kvs" - "github.com/abcum/surreal/mem" "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/txn" "github.com/dgrijalva/jwt-go" "github.com/gorilla/websocket" ) @@ -260,7 +259,7 @@ func checkBasics(c *fibre.Context, info string, callback func() error) (err erro func checkBearer(c *fibre.Context, info string, callback func() error) (err error) { - var txn kvs.TX + var tx *txn.TX var res []*db.Response var vars jwt.MapClaims var nsk, dbk, sck, tkk, usk, tbk, idk bool @@ -268,22 +267,18 @@ func checkBearer(c *fibre.Context, info string, callback func() error) (err erro // Start a new read transaction. - if txn, err = db.Begin(false); err != nil { + if tx, err = txn.New(c.Context(), false); err != nil { return fibre.NewHTTPError(500) } // Ensure the transaction closes. - defer txn.Cancel() + defer tx.Cancel() // Get the current context. ctx := c.Context() - // Setup the kvs layer cache. - - cache := mem.NewWithTX(txn) - // Reset the auth data first. auth := c.Get(varKeyAuth).(*cnf.Auth).Reset() @@ -314,7 +309,7 @@ func checkBearer(c *fibre.Context, info string, callback func() error) (err erro if nsk && dbk && sck && tkk { - scp, err := cache.GetSC(ctx, nsv, dbv, scv) + scp, err := tx.GetSC(ctx, nsv, dbv, scv) if err != nil { return nil, fmt.Errorf("Credentials failed") } @@ -362,7 +357,7 @@ func checkBearer(c *fibre.Context, info string, callback func() error) (err erro } if tkv != "default" { - key, err := cache.GetST(ctx, nsv, dbv, scv, tkv) + key, err := tx.GetST(ctx, nsv, dbv, scv, tkv) if err != nil { return nil, fmt.Errorf("Credentials failed") } @@ -379,7 +374,7 @@ func checkBearer(c *fibre.Context, info string, callback func() error) (err erro } else if nsk && dbk && tkk { if tkv != "default" { - key, err := cache.GetDT(ctx, nsv, dbv, tkv) + key, err := tx.GetDT(ctx, nsv, dbv, tkv) if err != nil { return nil, fmt.Errorf("Credentials failed") } @@ -389,7 +384,7 @@ func checkBearer(c *fibre.Context, info string, callback func() error) (err erro auth.Kind = cnf.AuthDB return key.Code, nil } else if usk { - usr, err := cache.GetDU(ctx, nsv, dbv, usv) + usr, err := tx.GetDU(ctx, nsv, dbv, usv) if err != nil { return nil, fmt.Errorf("Credentials failed") } @@ -400,7 +395,7 @@ func checkBearer(c *fibre.Context, info string, callback func() error) (err erro } else if nsk && tkk { if tkv != "default" { - key, err := cache.GetNT(ctx, nsv, tkv) + key, err := tx.GetNT(ctx, nsv, tkv) if err != nil { return nil, fmt.Errorf("Credentials failed") } @@ -410,7 +405,7 @@ func checkBearer(c *fibre.Context, info string, callback func() error) (err erro auth.Kind = cnf.AuthNS return key.Code, nil } else if usk { - usr, err := cache.GetNU(ctx, nsv, usv) + usr, err := tx.GetNU(ctx, nsv, usv) if err != nil { return nil, fmt.Errorf("Credentials failed") } diff --git a/web/live.go b/web/live.go index 43584053..574cf4ce 100644 --- a/web/live.go +++ b/web/live.go @@ -24,13 +24,11 @@ func live() fibre.MiddlewareFunc { return func(c *fibre.Context) (err error) { if c.IsSocket() { - if id, ok := c.Get("id").(string); ok { - beg, end := db.Socket(c, id) - beg() - err = h(c) - end() - return err - } + beg, end := db.Socket(c, c.Uniq()) + beg() + err = h(c) + end() + return err } return h(c) diff --git a/web/logger.go b/web/logger.go deleted file mode 100644 index 8b10209a..00000000 --- a/web/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package web - -import ( - "github.com/abcum/fibre" - "github.com/abcum/surreal/cnf" -) - -func logger(c *fibre.Context) (err error) { - - if err := c.Upgrade(); err != nil { - return err - } - - if c.Get("auth").(*cnf.Auth).Kind != cnf.AuthKV { - return fibre.NewHTTPError(401) - } - - ws := &socket{ - quit: make(chan struct{}), - msgs: make(chan interface{}), - } - - streamer.wss.Store(c.Get("id"), ws) - - for v := range ws.msgs { - err := c.Socket().SendJSON(v) - if err != nil { - ws.quit <- struct{}{} - } - } - - streamer.wss.Delete(c.Get("id")) - - return nil - -} diff --git a/web/routes.go b/web/routes.go index 2cfcdcf3..9d425ca3 100644 --- a/web/routes.go +++ b/web/routes.go @@ -77,14 +77,6 @@ func routes(s *fibre.Fibre) { s.Rpc("/rpc", &rpc{}) - // -------------------------------------------------- - // Endpoints for authentication signup - // -------------------------------------------------- - - s.Get("/logs", func(c *fibre.Context) error { - return logger(c) - }) - // -------------------------------------------------- // Endpoints for syncing data // -------------------------------------------------- diff --git a/web/signin.go b/web/signin.go index 4205d238..d8563d24 100644 --- a/web/signin.go +++ b/web/signin.go @@ -20,9 +20,8 @@ import ( "github.com/abcum/fibre" "github.com/abcum/surreal/cnf" "github.com/abcum/surreal/db" - "github.com/abcum/surreal/kvs" - "github.com/abcum/surreal/mem" "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/txn" "github.com/abcum/surreal/util/data" "github.com/dgrijalva/jwt-go" "golang.org/x/crypto/bcrypt" @@ -76,7 +75,7 @@ func signinInternal(c *fibre.Context, vars map[string]interface{}) (str string, if nok && len(n) > 0 && dok && len(d) > 0 && sok && len(s) > 0 { var ok bool - var txn kvs.TX + var tx *txn.TX var doc *sql.Thing var res []*db.Response var exp *sql.SubExpression @@ -85,13 +84,13 @@ func signinInternal(c *fibre.Context, vars map[string]interface{}) (str string, // Start a new read transaction. - if txn, err = db.Begin(false); err != nil { + if tx, err = txn.New(c.Context(), false); err != nil { return str, fibre.NewHTTPError(500) } // Ensure the transaction closes. - defer txn.Cancel() + defer tx.Cancel() // Get the current context. @@ -119,7 +118,7 @@ func signinInternal(c *fibre.Context, vars map[string]interface{}) (str string, // Get the specified signin scope. - if scp, err = mem.NewWithTX(txn).GetSC(ctx, n, d, s); err != nil { + if scp, err = tx.GetSC(ctx, n, d, s); err != nil { m := "Authentication scope does not exist" return str, fibre.NewHTTPError(403).WithFields(f).WithMessage(m) } @@ -337,17 +336,17 @@ func signinInternal(c *fibre.Context, vars map[string]interface{}) (str string, func signinDB(c *fibre.Context, n, d, u, p string) (usr *sql.DefineLoginStatement, err error) { - var txn kvs.TX + var tx *txn.TX // Start a new read transaction. - if txn, err = db.Begin(false); err != nil { + if tx, err = txn.New(c.Context(), false); err != nil { return nil, fibre.NewHTTPError(500) } // Ensure the transaction closes. - defer txn.Cancel() + defer tx.Cancel() // Get the current context. @@ -366,7 +365,7 @@ func signinDB(c *fibre.Context, n, d, u, p string) (usr *sql.DefineLoginStatemen // Get the specified namespace login. - if usr, err = mem.NewWithTX(txn).GetDU(ctx, n, d, u); err != nil { + if usr, err = tx.GetDU(ctx, n, d, u); err != nil { m := "Database login does not exist" return nil, fibre.NewHTTPError(403).WithFields(f).WithMessage(m) } @@ -384,17 +383,17 @@ func signinDB(c *fibre.Context, n, d, u, p string) (usr *sql.DefineLoginStatemen func signinNS(c *fibre.Context, n, u, p string) (usr *sql.DefineLoginStatement, err error) { - var txn kvs.TX + var tx *txn.TX // Start a new read transaction. - if txn, err = db.Begin(false); err != nil { + if tx, err = txn.New(c.Context(), false); err != nil { return nil, fibre.NewHTTPError(500) } // Ensure the transaction closes. - defer txn.Cancel() + defer tx.Cancel() // Get the current context. @@ -413,7 +412,7 @@ func signinNS(c *fibre.Context, n, u, p string) (usr *sql.DefineLoginStatement, // Get the specified namespace login. - if usr, err = mem.NewWithTX(txn).GetNU(ctx, n, u); err != nil { + if usr, err = tx.GetNU(ctx, n, u); err != nil { m := "Namespace login does not exist" return nil, fibre.NewHTTPError(403).WithFields(f).WithMessage(m) } diff --git a/web/signup.go b/web/signup.go index d9627486..b96e03a5 100644 --- a/web/signup.go +++ b/web/signup.go @@ -20,9 +20,8 @@ import ( "github.com/abcum/fibre" "github.com/abcum/surreal/cnf" "github.com/abcum/surreal/db" - "github.com/abcum/surreal/kvs" - "github.com/abcum/surreal/mem" "github.com/abcum/surreal/sql" + "github.com/abcum/surreal/txn" "github.com/abcum/surreal/util/data" "github.com/dgrijalva/jwt-go" ) @@ -75,7 +74,7 @@ func signupInternal(c *fibre.Context, vars map[string]interface{}) (str string, if nok && len(n) > 0 && dok && len(d) > 0 && sok && len(s) > 0 { var ok bool - var txn kvs.TX + var tx *txn.TX var doc *sql.Thing var res []*db.Response var exp *sql.SubExpression @@ -84,13 +83,13 @@ func signupInternal(c *fibre.Context, vars map[string]interface{}) (str string, // Start a new read transaction. - if txn, err = db.Begin(false); err != nil { + if tx, err = txn.New(c.Context(), false); err != nil { return str, fibre.NewHTTPError(500) } // Ensure the transaction closes. - defer txn.Cancel() + defer tx.Cancel() // Get the current context. @@ -118,7 +117,7 @@ func signupInternal(c *fibre.Context, vars map[string]interface{}) (str string, // Get the specified signin scope. - if scp, err = mem.NewWithTX(txn).GetSC(ctx, n, d, s); err != nil { + if scp, err = tx.GetSC(ctx, n, d, s); err != nil { m := "Authentication scope does not exist" return str, fibre.NewHTTPError(403).WithFields(f).WithMessage(m) } diff --git a/web/stream.go b/web/stream.go deleted file mode 100644 index 6f559d49..00000000 --- a/web/stream.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package web - -import ( - "sync" - - "github.com/abcum/surreal/log" - "github.com/sirupsen/logrus" -) - -var streamer *stream - -type stream struct { - wss sync.Map -} - -type socket struct { - quit chan struct{} - msgs chan interface{} -} - -func init() { - streamer = &stream{} - log.Instance().AddHook(streamer) -} - -func (h *stream) Levels() []logrus.Level { - return logrus.AllLevels -} - -func (h *stream) Fire(entry *logrus.Entry) error { - - streamer.wss.Range(func(key, val interface{}) bool { - - ws := val.(*socket) - - select { - case <-ws.quit: - break - case ws.msgs <- h.Format(entry): - break - } - - return true - - }) - - return nil - -} - -func (h *stream) Format(entry *logrus.Entry) interface{} { - - var keys = make(map[string]interface{}) - var json = make(map[string]interface{}) - - for k, v := range entry.Data { - if k != "prefix" && k != "ctx" { - keys[k] = v - } - } - - json["keys"] = keys - - json["time"] = entry.Time - - json["level"] = entry.Level.String() - - json["message"] = entry.Message - - json["prefix"], _ = entry.Data["prefix"] - - return json - -} diff --git a/web/web.go b/web/web.go index 699298a2..4ea67b73 100644 --- a/web/web.go +++ b/web/web.go @@ -30,9 +30,10 @@ func Setup(opts *cnf.Options) (err error) { s := fibre.Server() routes(s) - s.SetWait("15s") s.SetName("web") s.SetIdleTimeout("60s") + s.SetReadTimeout("60s") + s.SetWriteTimeout("60s") s.SetHTTPErrorHandler(errors) s.Logger().SetLogger(log.Instance()) @@ -41,7 +42,6 @@ func Setup(opts *cnf.Options) (err error) { s.Use(mw.Uniq()) // Add uniq id s.Use(mw.Fail()) // Catch panics s.Use(mw.Logs()) // Log requests - s.Use(mw.Sock()) // Setup sockets // Add cors headers @@ -82,10 +82,6 @@ func Setup(opts *cnf.Options) (err error) { s.Use(live()) - // Compress responses - - s.Use(mw.Gzip()) - // Redirect non-https s.Use(mw.Secure(&mw.SecureOpts{ @@ -111,10 +107,7 @@ func Setup(opts *cnf.Options) (err error) { } // Exit tears down the server gracefully -func Exit() (err error) { - - log.WithPrefix("web").Infof("Gracefully shutting down %s protocol", "web") - +func Exit(opts *cnf.Options) (err error) { + log.WithPrefix("web").Infof("Shutting down web server on %s", opts.Conn) return - }