@@ -124,15 +124,8 @@ func (b *Block) LongString() string {
124
124
if b .Aux != nil {
125
125
s += fmt .Sprintf (" {%s}" , b .Aux )
126
126
}
127
- if t := b .Kind .AuxIntType (); t != "" {
128
- switch t {
129
- case "Int8" :
130
- s += fmt .Sprintf (" [%v]" , int8 (b .AuxInt ))
131
- case "UInt8" :
132
- s += fmt .Sprintf (" [%v]" , uint8 (b .AuxInt ))
133
- default :
134
- s += fmt .Sprintf (" [%v]" , b .AuxInt )
135
- }
127
+ if t := b .AuxIntString (); t != "" {
128
+ s += fmt .Sprintf (" [%s]" , t )
136
129
}
137
130
for _ , c := range b .ControlValues () {
138
131
s += fmt .Sprintf (" %s" , c )
@@ -341,6 +334,19 @@ func (b *Block) LackingPos() bool {
341
334
return true
342
335
}
343
336
337
+ func (b * Block ) AuxIntString () string {
338
+ switch b .Kind .AuxIntType () {
339
+ case "Int8" :
340
+ return fmt .Sprintf ("%v" , int8 (b .AuxInt ))
341
+ case "UInt8" :
342
+ return fmt .Sprintf ("%v" , uint8 (b .AuxInt ))
343
+ default : // type specified but not implemented - print as int64
344
+ return fmt .Sprintf ("%v" , b .AuxInt )
345
+ case "" : // no aux int type
346
+ return ""
347
+ }
348
+ }
349
+
344
350
func (b * Block ) Logf (msg string , args ... interface {}) { b .Func .Logf (msg , args ... ) }
345
351
func (b * Block ) Log () bool { return b .Func .Log () }
346
352
func (b * Block ) Fatalf (msg string , args ... interface {}) { b .Func .Fatalf (msg , args ... ) }
0 commit comments