mirror of
https://github.com/Binject/debug
synced 2026-06-08 10:28:33 +00:00
b147aba6f2
By grepping for ]string{$, one can find many manual implementations of
stringer. The debug/dwarf ones needed the new -trimprefix flag, too.
html/template was fairly simple, just implementing the fallback as
stringer would. The changes there are trivial.
The ones in debug/dwarf needed a bit of extra logic since the GoString
wants to use its own format, depending on whether or not the value is
one of the known constants.
Change-Id: I501ea7deaa538fa425c8e9c2bb895f480169273f
Reviewed-on: https://go-review.googlesource.com/77253
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
45 lines
1.8 KiB
Go
45 lines
1.8 KiB
Go
// Code generated by "stringer -type Tag -trimprefix=Tag"; DO NOT EDIT.
|
|
|
|
package dwarf
|
|
|
|
import "strconv"
|
|
|
|
const (
|
|
_Tag_name_0 = "ArrayTypeClassTypeEntryPointEnumerationTypeFormalParameter"
|
|
_Tag_name_1 = "ImportedDeclaration"
|
|
_Tag_name_2 = "LabelLexDwarfBlock"
|
|
_Tag_name_3 = "Member"
|
|
_Tag_name_4 = "PointerTypeReferenceTypeCompileUnitStringTypeStructType"
|
|
_Tag_name_5 = "SubroutineTypeTypedefUnionTypeUnspecifiedParametersVariantCommonDwarfBlockCommonInclusionInheritanceInlinedSubroutineModulePtrToMemberTypeSetTypeSubrangeTypeWithStmtAccessDeclarationBaseTypeCatchDwarfBlockConstTypeConstantEnumeratorFileTypeFriendNamelistNamelistItemPackedTypeSubprogramTemplateTypeParameterTemplateValueParameterThrownTypeTryDwarfBlockVariantPartVariableVolatileTypeDwarfProcedureRestrictTypeInterfaceTypeNamespaceImportedModuleUnspecifiedTypePartialUnitImportedUnitMutableTypeConditionSharedTypeTypeUnitRvalueReferenceTypeTemplateAlias"
|
|
)
|
|
|
|
var (
|
|
_Tag_index_0 = [...]uint8{0, 9, 18, 28, 43, 58}
|
|
_Tag_index_2 = [...]uint8{0, 5, 18}
|
|
_Tag_index_4 = [...]uint8{0, 11, 24, 35, 45, 55}
|
|
_Tag_index_5 = [...]uint16{0, 14, 21, 30, 51, 58, 74, 89, 100, 117, 123, 138, 145, 157, 165, 182, 190, 205, 214, 222, 232, 240, 246, 254, 266, 276, 286, 307, 329, 339, 352, 363, 371, 383, 397, 409, 422, 431, 445, 460, 471, 483, 494, 503, 513, 521, 540, 553}
|
|
)
|
|
|
|
func (i Tag) String() string {
|
|
switch {
|
|
case 1 <= i && i <= 5:
|
|
i -= 1
|
|
return _Tag_name_0[_Tag_index_0[i]:_Tag_index_0[i+1]]
|
|
case i == 8:
|
|
return _Tag_name_1
|
|
case 10 <= i && i <= 11:
|
|
i -= 10
|
|
return _Tag_name_2[_Tag_index_2[i]:_Tag_index_2[i+1]]
|
|
case i == 13:
|
|
return _Tag_name_3
|
|
case 15 <= i && i <= 19:
|
|
i -= 15
|
|
return _Tag_name_4[_Tag_index_4[i]:_Tag_index_4[i+1]]
|
|
case 21 <= i && i <= 67:
|
|
i -= 21
|
|
return _Tag_name_5[_Tag_index_5[i]:_Tag_index_5[i+1]]
|
|
default:
|
|
return "Tag(" + strconv.FormatInt(int64(i), 10) + ")"
|
|
}
|
|
}
|