generate: Fix bad variable names
This commit is contained in:
parent
77c6b67d65
commit
170f79c914
@ -593,7 +593,7 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
|
|||||||
n += nn; if err != nil { return n, err }
|
n += nn; if err != nil { return n, err }
|
||||||
nn, err = this.generateType(typ)
|
nn, err = this.generateType(typ)
|
||||||
n += nn; if err != nil { return n, err }
|
n += nn; if err != nil { return n, err }
|
||||||
nn, err = this.printf("](this *T, decoder *tape.Decoder, tag tape.Tag) (nn int, err error) {\n")
|
nn, err = this.printf("](this *T, decoder *tape.Decoder, tag tape.Tag) (n int, err error) {\n")
|
||||||
n += nn; if err != nil { return n, err }
|
n += nn; if err != nil { return n, err }
|
||||||
this.push()
|
this.push()
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
|
|||||||
// problems
|
// problems
|
||||||
|
|
||||||
// read fields
|
// read fields
|
||||||
nn, err = this.iprintf("for index = range %s {\n", lengthVar)
|
nn, err = this.iprintf("for %s = range %s {\n", indexVar, lengthVar)
|
||||||
n += nn; if err != nil { return n, err }
|
n += nn; if err != nil { return n, err }
|
||||||
this.push()
|
this.push()
|
||||||
// read field header
|
// read field header
|
||||||
@ -720,11 +720,11 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
// switch on tag
|
// switch on tag
|
||||||
nn, err = this.iprintf("switch %s {\n", fieldTagVar)
|
nn, err = this.iprintf("switch %s {\n", fieldKeyVar)
|
||||||
n += nn; if err != nil { return n, err }
|
n += nn; if err != nil { return n, err }
|
||||||
for _, key := range slices.Sorted(maps.Keys(typ.Fields)) {
|
for _, key := range slices.Sorted(maps.Keys(typ.Fields)) {
|
||||||
field := typ.Fields[key]
|
field := typ.Fields[key]
|
||||||
nn, err = this.iprintf("case %s:\n", fieldTagVar)
|
nn, err = this.iprintf("case 0x%04X:\n", key)
|
||||||
n += nn; if err != nil { return n, err }
|
n += nn; if err != nil { return n, err }
|
||||||
this.push()
|
this.push()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user