Repository: abice/go-enum
Pull request #90 (2022-03-19 15:23:45)

add 1.17 and 1.18
Also adds support for uint64 values throughout.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/47512655/badge)](https://coveralls.io/builds/47512655)

Coverage decreased (-0.008%) to 91.792% when pulling **092273d61df37995808f67d665ad3e49393d5d8a on abice/goVersions** into **e477e74e05be2411bb0b218a4637de6905e8cd8c on master**.


Patch:
diff --git a/example/enum_32_bit.go b/example/enum_32_bit.go
new file mode 100644
index 0000000..5ceaf41
--- /dev/null
+++ b/example/enum_32_bit.go
@@ -0,0 +1,23 @@
+//go:generate ../bin/go-enum -f=$GOFILE --ptr --marshal
+
+package example
+
+/* ENUM(
+
+Unkno					= 0
+E2P15					= 32768
+E2P16					= 65536
+E2P17					= 131072
+E2P18					= 262144
+E2P19					= 524288
+E2P20					= 1048576
+E2P21					= 2097152
+E2P22					= 33554432
+E2P23					= 67108864
+E2P28					= 536870912
+E2P30					= 1073741824
+
+)
+
+*/
+type Enum32bit uint32
diff --git a/example/enum_32_bit_enum.go b/example/enum_32_bit_enum.go
new file mode 100644
index 0000000..4431109
--- /dev/null
+++ b/example/enum_32_bit_enum.go
@@ -0,0 +1,106 @@
+// Code generated by go-enum DO NOT EDIT.
+// Version: example
+// Revision: example
+// Build Date: example
+// Built By: example
+
+package example
+
+import (
+	"fmt"
+)
+
+const (
+	// Enum32bitUnkno is a Enum32bit of type Unkno.
+	Enum32bitUnkno Enum32bit = iota
+	// Enum32bitE2P15 is a Enum32bit of type E2P15.
+	Enum32bitE2P15 Enum32bit = iota + 32767
+	// Enum32bitE2P16 is a Enum32bit of type E2P16.
+	Enum32bitE2P16 Enum32bit = iota + 65534
+	// Enum32bitE2P17 is a Enum32bit of type E2P17.
+	Enum32bitE2P17 Enum32bit = iota + 131069
+	// Enum32bitE2P18 is a Enum32bit of type E2P18.
+	Enum32bitE2P18 Enum32bit = iota + 262140
+	// Enum32bitE2P19 is a Enum32bit of type E2P19.
+	Enum32bitE2P19 Enum32bit = iota + 524283
+	// Enum32bitE2P20 is a Enum32bit of type E2P20.
+	Enum32bitE2P20 Enum32bit = iota + 1048570
+	// Enum32bitE2P21 is a Enum32bit of type E2P21.
+	Enum32bitE2P21 Enum32bit = iota + 2097145
+	// Enum32bitE2P22 is a Enum32bit of type E2P22.
+	Enum32bitE2P22 Enum32bit = iota + 33554424
+	// Enum32bitE2P23 is a Enum32bit of type E2P23.
+	Enum32bitE2P23 Enum32bit = iota + 67108855
+	// Enum32bitE2P28 is a Enum32bit of type E2P28.
+	Enum32bitE2P28 Enum32bit = iota + 536870902
+	// Enum32bitE2P30 is a Enum32bit of type E2P30.
+	Enum32bitE2P30 Enum32bit = iota + 1073741813
+)
+
+const _Enum32bitName = "UnknoE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30"
+
+var _Enum32bitMap = map[Enum32bit]string{
+	Enum32bitUnkno: _Enum32bitName[0:5],
+	Enum32bitE2P15: _Enum32bitName[5:10],
+	Enum32bitE2P16: _Enum32bitName[10:15],
+	Enum32bitE2P17: _Enum32bitName[15:20],
+	Enum32bitE2P18: _Enum32bitName[20:25],
+	Enum32bitE2P19: _Enum32bitName[25:30],
+	Enum32bitE2P20: _Enum32bitName[30:35],
+	Enum32bitE2P21: _Enum32bitName[35:40],
+	Enum32bitE2P22: _Enum32bitName[40:45],
+	Enum32bitE2P23: _Enum32bitName[45:50],
+	Enum32bitE2P28: _Enum32bitName[50:55],
+	Enum32bitE2P30: _Enum32bitName[55:60],
+}
+
+// String implements the Stringer interface.
+func (x Enum32bit) String() string {
+	if str, ok := _Enum32bitMap[x]; ok {
+		return str
+	}
+	return fmt.Sprintf("Enum32bit(%d)", x)
+}
+
+var _Enum32bitValue = map[string]Enum32bit{
+	_Enum32bitName[0:5]:   Enum32bitUnkno,
+	_Enum32bitName[5:10]:  Enum32bitE2P15,
+	_Enum32bitName[10:15]: Enum32bitE2P16,
+	_Enum32bitName[15:20]: Enum32bitE2P17,
+	_Enum32bitName[20:25]: Enum32bitE2P18,
+	_Enum32bitName[25:30]: Enum32bitE2P19,
+	_Enum32bitName[30:35]: Enum32bitE2P20,
+	_Enum32bitName[35:40]: Enum32bitE2P21,
+	_Enum32bitName[40:45]: Enum32bitE2P22,
+	_Enum32bitName[45:50]: Enum32bitE2P23,
+	_Enum32bitName[50:55]: Enum32bitE2P28,
+	_Enum32bitName[55:60]: Enum32bitE2P30,
+}
+
+// ParseEnum32bit attempts to convert a string to a Enum32bit.
+func ParseEnum32bit(name string) (Enum32bit, error) {
+	if x, ok := _Enum32bitValue[name]; ok {
+		return x, nil
+	}
+	return Enum32bit(0), fmt.Errorf("%s is not a valid Enum32bit", name)
+}
+
+func (x Enum32bit) Ptr() *Enum32bit {
+	return &x
+}
+
+// MarshalText implements the text marshaller method.
+func (x Enum32bit) MarshalText() ([]byte, error) {
+	return []byte(x.String()), nil
+}
+
+// UnmarshalText implements the text unmarshaller method.
+func (x *Enum32bit) UnmarshalText(text []byte) error {
+	name := string(text)
+	tmp, err := ParseEnum32bit(name)
+	if err != nil {
+		return err
+	}
+	*x = tmp
+	return nil
+}
diff --git a/example/enum_64_bit.go b/example/enum_64_bit.go
new file mode 100644
index 0000000..a5af325
--- /dev/null
+++ b/example/enum_64_bit.go
@@ -0,0 +1,26 @@
+//go:generate ../bin/go-enum -f=$GOFILE --ptr --marshal
+
+package example
+
+/* ENUM(
+
+Unkno 				= 0
+E2P15					= 32768
+E2P16					= 65536
+E2P17					= 131072
+E2P18					= 262144
+E2P19					= 524288
+E2P20					= 1048576
+E2P21					= 2097152
+E2P22					= 33554432
+E2P23					= 67108864
+E2P28					= 536870912
+E2P30					= 1073741824
+E2P31					= 2147483648
+E2P32					= 4294967296
+E2P33					= 8454967296
+E2P63					= 18446744073709551615
+)
+
+*/
+type Enum64bit uint64
diff --git a/example/enum_64_bit_enum.go b/example/enum_64_bit_enum.go
new file mode 100644
index 0000000..66413fe
--- /dev/null
+++ b/example/enum_64_bit_enum.go
@@ -0,0 +1,122 @@
+// Code generated by go-enum DO NOT EDIT.
+// Version: example
+// Revision: example
+// Build Date: example
+// Built By: example
+
+package example
+
+import (
+	"fmt"
+)
+
+const (
+	// Enum64bitUnkno is a Enum64bit of type Unkno.
+	Enum64bitUnkno Enum64bit = iota
+	// Enum64bitE2P15 is a Enum64bit of type E2P15.
+	Enum64bitE2P15 Enum64bit = iota + 32767
+	// Enum64bitE2P16 is a Enum64bit of type E2P16.
+	Enum64bitE2P16 Enum64bit = iota + 65534
+	// Enum64bitE2P17 is a Enum64bit of type E2P17.
+	Enum64bitE2P17 Enum64bit = iota + 131069
+	// Enum64bitE2P18 is a Enum64bit of type E2P18.
+	Enum64bitE2P18 Enum64bit = iota + 262140
+	// Enum64bitE2P19 is a Enum64bit of type E2P19.
+	Enum64bitE2P19 Enum64bit = iota + 524283
+	// Enum64bitE2P20 is a Enum64bit of type E2P20.
+	Enum64bitE2P20 Enum64bit = iota + 1048570
+	// Enum64bitE2P21 is a Enum64bit of type E2P21.
+	Enum64bitE2P21 Enum64bit = iota + 2097145
+	// Enum64bitE2P22 is a Enum64bit of type E2P22.
+	Enum64bitE2P22 Enum64bit = iota + 33554424
+	// Enum64bitE2P23 is a Enum64bit of type E2P23.
+	Enum64bitE2P23 Enum64bit = iota + 67108855
+	// Enum64bitE2P28 is a Enum64bit of type E2P28.
+	Enum64bitE2P28 Enum64bit = iota + 536870902
+	// Enum64bitE2P30 is a Enum64bit of type E2P30.
+	Enum64bitE2P30 Enum64bit = iota + 1073741813
+	// Enum64bitE2P31 is a Enum64bit of type E2P31.
+	Enum64bitE2P31 Enum64bit = iota + 2147483636
+	// Enum64bitE2P32 is a Enum64bit of type E2P32.
+	Enum64bitE2P32 Enum64bit = iota + 4294967283
+	// Enum64bitE2P33 is a Enum64bit of type E2P33.
+	Enum64bitE2P33 Enum64bit = iota + 8454967282
+	// Enum64bitE2P63 is a Enum64bit of type E2P63.
+	Enum64bitE2P63 Enum64bit = iota + 9223372036854775792
+)
+
+const _Enum64bitName = "UnknoE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33E2P63"
+
+var _Enum64bitMap = map[Enum64bit]string{
+	Enum64bitUnkno: _Enum64bitName[0:5],
+	Enum64bitE2P15: _Enum64bitName[5:10],
+	Enum64bitE2P16: _Enum64bitName[10:15],
+	Enum64bitE2P17: _Enum64bitName[15:20],
+	Enum64bitE2P18: _Enum64bitName[20:25],
+	Enum64bitE2P19: _Enum64bitName[25:30],
+	Enum64bitE2P20: _Enum64bitName[30:35],
+	Enum64bitE2P21: _Enum64bitName[35:40],
+	Enum64bitE2P22: _Enum64bitName[40:45],
+	Enum64bitE2P23: _Enum64bitName[45:50],
+	Enum64bitE2P28: _Enum64bitName[50:55],
+	Enum64bitE2P30: _Enum64bitName[55:60],
+	Enum64bitE2P31: _Enum64bitName[60:65],
+	Enum64bitE2P32: _Enum64bitName[65:70],
+	Enum64bitE2P33: _Enum64bitName[70:75],
+	Enum64bitE2P63: _Enum64bitName[75:80],
+}
+
+// String implements the Stringer interface.
+func (x Enum64bit) String() string {
+	if str, ok := _Enum64bitMap[x]; ok {
+		return str
+	}
+	return fmt.Sprintf("Enum64bit(%d)", x)
+}
+
+var _Enum64bitValue = map[string]Enum64bit{
+	_Enum64bitName[0:5]:   Enum64bitUnkno,
+	_Enum64bitName[5:10]:  Enum64bitE2P15,
+	_Enum64bitName[10:15]: Enum64bitE2P16,
+	_Enum64bitName[15:20]: Enum64bitE2P17,
+	_Enum64bitName[20:25]: Enum64bitE2P18,
+	_Enum64bitName[25:30]: Enum64bitE2P19,
+	_Enum64bitName[30:35]: Enum64bitE2P20,
+	_Enum64bitName[35:40]: Enum64bitE2P21,
+	_Enum64bitName[40:45]: Enum64bitE2P22,
+	_Enum64bitName[45:50]: Enum64bitE2P23,
+	_Enum64bitName[50:55]: Enum64bitE2P28,
+	_Enum64bitName[55:60]: Enum64bitE2P30,
+	_Enum64bitName[60:65]: Enum64bitE2P31,
+	_Enum64bitName[65:70]: Enum64bitE2P32,
+	_Enum64bitName[70:75]: Enum64bitE2P33,
+	_Enum64bitName[75:80]: Enum64bitE2P63,
+}
+
+// ParseEnum64bit attempts to convert a string to a Enum64bit.
+func ParseEnum64bit(name string) (Enum64bit, error) {
+	if x, ok := _Enum64bitValue[name]; ok {
+		return x, nil
+	}
+	return Enum64bit(0), fmt.Errorf("%s is not a valid Enum64bit", name)
+}
+
+func (x Enum64bit) Ptr() *Enum64bit {
+	return &x
+}
+
+// MarshalText implements the text marshaller method.
+func (x Enum64bit) MarshalText() ([]byte, error) {
+	return []byte(x.String()), nil
+}
+
+// UnmarshalText implements the text unmarshaller method.
+func (x *Enum64bit) UnmarshalText(text []byte) error {
+	name := string(text)
+	tmp, err := ParseEnum64bit(name)
+	if err != nil {
+		return err
+	}
+	*x = tmp
+	return nil
+}
diff --git a/generator/generator.go b/generator/generator.go
index b8329a6..a02deb0 100644
--- a/generator/generator.go
+++ b/generator/generator.go
@@ -66,7 +66,7 @@ type EnumValue struct {
 	RawName      string
 	Name         string
 	PrefixedName string
-	Value        int
+	Value        uint64
 	Comment      string
 }
 
@@ -339,7 +339,7 @@ func (g *Generator) parseEnum(ts *ast.TypeSpec) (*Enum, error) {
 	enumDecl := getEnumDeclFromComments(ts.Doc.List)
 
 	values := strings.Split(strings.TrimSuffix(strings.TrimPrefix(enumDecl, `ENUM(`), `)`), `,`)
-	data := 0
+	var data uint64
 	for _, value := range values {
 		var comment string
 
@@ -359,11 +359,13 @@ func (g *Generator) parseEnum(ts *ast.TypeSpec) (*Enum, error) {
 				equalIndex := strings.Index(value, `=`)
 				dataVal := strings.TrimSpace(value[equalIndex+1:])
 				if dataVal != "" {
-					newData, err := strconv.ParseInt(dataVal, 10, 32)
+					newData, err := strconv.ParseUint(dataVal, 10, 64)
 					if err != nil {
-						return nil, errors.Wrapf(err, "failed parsing the data part of enum value '%s'", value)
+						err = errors.Wrapf(err, "failed parsing the data part of enum value '%s'", value)
+						fmt.Println(err)
+						return nil, err
 					}
-					data = int(newData)
+					data = newData
 					value = value[:equalIndex]
 				} else {
 					value = strings.TrimSuffix(value, `=`)


Test patch:
diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml
index 4b20f34..6baae61 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -10,6 +10,7 @@ jobs:
   build:
     runs-on: ubuntu-latest
     strategy:
+      fail-fast: false
       matrix:
         go:
           # Drop support of go 1.12
@@ -17,6 +18,8 @@ jobs:
           - "1.14"
           - "1.15"
           - "1.16"
+          - "1.17"
+          - "1.18"
     name: run tests with go version ${{ matrix.go }}
     steps:
       - name: install go
diff --git a/generator/.snapshots/generator-TestCustomPrefixExampleFile b/generator/.snapshots/generator-TestCustomPrefixExampleFile
index ffa6185..e92966f 100644
--- a/generator/.snapshots/generator-TestCustomPrefixExampleFile
+++ b/generator/.snapshots/generator-TestCustomPrefixExampleFile
@@ -1,4 +1,4 @@
-([]string) (len=3055) {
+([]string) (len=3377) {
   (string) (len=41) "// Code generated by go-enum DO NOT EDIT.",
   (string) (len=13) "// Version: -",
   (string) (len=14) "// Revision: -",
@@ -1988,6 +1988,328 @@
   (string) (len=1) "}",
   (string) "",
   (string) (len=7) "const (",
+  (string) (len=57) "\t// Custom_prefix_Unknown is a Enum64bit of type Unknown.",
+  (string) (len=39) "\tCustom_prefix_Unknown Enum64bit = iota",
+  (string) (len=53) "\t// Custom_prefix_E2P15 is a Enum64bit of type E2P15.",
+  (string) (len=45) "\tCustom_prefix_E2P15 Enum64bit = iota + 32767",
+  (string) (len=53) "\t// Custom_prefix_E2P16 is a Enum64bit of type E2P16.",
+  (string) (len=45) "\tCustom_prefix_E2P16 Enum64bit = iota + 65534",
+  (string) (len=53) "\t// Custom_prefix_E2P17 is a Enum64bit of type E2P17.",
+  (string) (len=46) "\tCustom_prefix_E2P17 Enum64bit = iota + 131069",
+  (string) (len=53) "\t// Custom_prefix_E2P18 is a Enum64bit of type E2P18.",
+  (string) (len=46) "\tCustom_prefix_E2P18 Enum64bit = iota + 262140",
+  (string) (len=53) "\t// Custom_prefix_E2P19 is a Enum64bit of type E2P19.",
+  (string) (len=46) "\tCustom_prefix_E2P19 Enum64bit = iota + 524283",
+  (string) (len=53) "\t// Custom_prefix_E2P20 is a Enum64bit of type E2P20.",
+  (string) (len=47) "\tCustom_prefix_E2P20 Enum64bit = iota + 1048570",
+  (string) (len=53) "\t// Custom_prefix_E2P21 is a Enum64bit of type E2P21.",
+  (string) (len=47) "\tCustom_prefix_E2P21 Enum64bit = iota + 2097145",
+  (string) (len=53) "\t// Custom_prefix_E2P22 is a Enum64bit of type E2P22.",
+  (string) (len=48) "\tCustom_prefix_E2P22 Enum64bit = iota + 33554424",
+  (string) (len=53) "\t// Custom_prefix_E2P23 is a Enum64bit of type E2P23.",
+  (string) (len=48) "\tCustom_prefix_E2P23 Enum64bit = iota + 67108855",
+  (string) (len=53) "\t// Custom_prefix_E2P28 is a Enum64bit of type E2P28.",
+  (string) (len=49) "\tCustom_prefix_E2P28 Enum64bit = iota + 536870902",
+  (string) (len=53) "\t// Custom_prefix_E2P30 is a Enum64bit of type E2P30.",
+  (string) (len=50) "\tCustom_prefix_E2P30 Enum64bit = iota + 1073741813",
+  (string) (len=53) "\t// Custom_prefix_E2P31 is a Enum64bit of type E2P31.",
+  (string) (len=50) "\tCustom_prefix_E2P31 Enum64bit = iota + 2147483636",
+  (string) (len=53) "\t// Custom_prefix_E2P32 is a Enum64bit of type E2P32.",
+  (string) (len=50) "\tCustom_prefix_E2P32 Enum64bit = iota + 4294967283",
+  (string) (len=53) "\t// Custom_prefix_E2P33 is a Enum64bit of type E2P33.",
+  (string) (len=50) "\tCustom_prefix_E2P33 Enum64bit = iota + 8454967282",
+  (string) (len=1) ")",
+  (string) "",
+  (string) (len=102) "const _Enum64bitName = \"UnknownE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33\"",
+  (string) "",
+  (string) (len=41) "var _Enum64bitMap = map[Enum64bit]string{",
+  (string) (len=44) "\tCustom_prefix_Unknown: _Enum64bitName[0:7],",
+  (string) (len=45) "\tCustom_prefix_E2P15:   _Enum64bitName[7:12],",
+  (string) (len=46) "\tCustom_prefix_E2P16:   _Enum64bitName[12:17],",
+  (string) (len=46) "\tCustom_prefix_E2P17:   _Enum64bitName[17:22],",
+  (string) (len=46) "\tCustom_prefix_E2P18:   _Enum64bitName[22:27],",
+  (string) (len=46) "\tCustom_prefix_E2P19:   _Enum64bitName[27:32],",
+  (string) (len=46) "\tCustom_prefix_E2P20:   _Enum64bitName[32:37],",
+  (string) (len=46) "\tCustom_prefix_E2P21:   _Enum64bitName[37:42],",
+  (string) (len=46) "\tCustom_prefix_E2P22:   _Enum64bitName[42:47],",
+  (string) (len=46) "\tCustom_prefix_E2P23:   _Enum64bitName[47:52],",
+  (string) (len=46) "\tCustom_prefix_E2P28:   _Enum64bitName[52:57],",
+  (string) (len=46) "\tCustom_prefix_E2P30:   _Enum64bitName[57:62],",
+  (string) (len=46) "\tCustom_prefix_E2P31:   _Enum64bitName[62:67],",
+  (string) (len=46) "\tCustom_prefix_E2P32:   _Enum64bitName[67:72],",
+  (string) (len=46) "\tCustom_prefix_E2P33:   _Enum64bitName[72:77],",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=44) "// String implements the Stringer interface.",
+  (string) (len=36) "func (x Enum64bit) String() string {",
+  (string) (len=37) "\tif str, ok := _Enum64bitMap[x]; ok {",
+  (string) (len=12) "\t\treturn str",
+  (string) (len=2) "\t}",
+  (string) (len=39) "\treturn fmt.Sprintf(\"Enum64bit(%d)\", x)",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=43) "var _Enum64bitValue = map[string]Enum64bit{",
+  (string) (len=63) "\t_Enum64bitName[0:7]:                    Custom_prefix_Unknown,",
+  (string) (len=63) "\tstrings.ToLower(_Enum64bitName[0:7]):   Custom_prefix_Unknown,",
+  (string) (len=61) "\t_Enum64bitName[7:12]:                   Custom_prefix_E2P15,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[7:12]):  Custom_prefix_E2P15,",
+  (string) (len=61) "\t_Enum64bitName[12:17]:                  Custom_prefix_E2P16,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[12:17]): Custom_prefix_E2P16,",
+  (string) (len=61) "\t_Enum64bitName[17:22]:                  Custom_prefix_E2P17,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[17:22]): Custom_prefix_E2P17,",
+  (string) (len=61) "\t_Enum64bitName[22:27]:                  Custom_prefix_E2P18,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[22:27]): Custom_prefix_E2P18,",
+  (string) (len=61) "\t_Enum64bitName[27:32]:                  Custom_prefix_E2P19,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[27:32]): Custom_prefix_E2P19,",
+  (string) (len=61) "\t_Enum64bitName[32:37]:                  Custom_prefix_E2P20,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[32:37]): Custom_prefix_E2P20,",
+  (string) (len=61) "\t_Enum64bitName[37:42]:                  Custom_prefix_E2P21,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[37:42]): Custom_prefix_E2P21,",
+  (string) (len=61) "\t_Enum64bitName[42:47]:                  Custom_prefix_E2P22,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[42:47]): Custom_prefix_E2P22,",
+  (string) (len=61) "\t_Enum64bitName[47:52]:                  Custom_prefix_E2P23,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[47:52]): Custom_prefix_E2P23,",
+  (string) (len=61) "\t_Enum64bitName[52:57]:                  Custom_prefix_E2P28,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[52:57]): Custom_prefix_E2P28,",
+  (string) (len=61) "\t_Enum64bitName[57:62]:                  Custom_prefix_E2P30,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[57:62]): Custom_prefix_E2P30,",
+  (string) (len=61) "\t_Enum64bitName[62:67]:                  Custom_prefix_E2P31,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[62:67]): Custom_prefix_E2P31,",
+  (string) (len=61) "\t_Enum64bitName[67:72]:                  Custom_prefix_E2P32,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[67:72]): Custom_prefix_E2P32,",
+  (string) (len=61) "\t_Enum64bitName[72:77]:                  Custom_prefix_E2P33,",
+  (string) (len=61) "\tstrings.ToLower(_Enum64bitName[72:77]): Custom_prefix_E2P33,",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=62) "// ParseEnum64bit attempts to convert a string to a Enum64bit.",
+  (string) (len=53) "func ParseEnum64bit(name string) (Enum64bit, error) {",
+  (string) (len=40) "\tif x, ok := _Enum64bitValue[name]; ok {",
+  (string) (len=15) "\t\treturn x, nil",
+  (string) (len=2) "\t}",
+  (string) (len=69) "\treturn Enum64bit(0), fmt.Errorf(\"%s is not a valid Enum64bit\", name)",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=37) "func (x Enum64bit) Ptr() *Enum64bit {",
+  (string) (len=10) "\treturn &x",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=53) "// MarshalText implements the text marshaller method.",
+  (string) (len=50) "func (x Enum64bit) MarshalText() ([]byte, error) {",
+  (string) (len=31) "\treturn []byte(x.String()), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=57) "// UnmarshalText implements the text unmarshaller method.",
+  (string) (len=54) "func (x *Enum64bit) UnmarshalText(text []byte) error {",
+  (string) (len=21) "\tname := string(text)",
+  (string) (len=33) "\ttmp, err := ParseEnum64bit(name)",
+  (string) (len=16) "\tif err != nil {",
+  (string) (len=12) "\t\treturn err",
+  (string) (len=2) "\t}",
+  (string) (len=9) "\t*x = tmp",
+  (string) (len=11) "\treturn nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=96) "var _Enum64bitErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes",
+  (string) "",
+  (string) (len=41) "// Scan implements the Scanner interface.",
+  (string) (len=57) "func (x *Enum64bit) Scan(value interface{}) (err error) {",
+  (string) (len=18) "\tif value == nil {",
+  (string) (len=19) "\t\t*x = Enum64bit(0)",
+  (string) (len=8) "\t\treturn",
+  (string) (len=2) "\t}",
+  (string) "",
+  (string) (len=37) "\t// A wider range of scannable types.",
+  (string) (len=61) "\t// driver.Value values at the top of the list for expediency",
+  (string) (len=27) "\tswitch v := value.(type) {",
+  (string) (len=12) "\tcase int64:",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=13) "\tcase string:",
+  (string) (len=29) "\t\t*x, err = ParseEnum64bit(v)",
+  (string) (len=17) "\t\tif err != nil {",
+  (string) (len=47) "\t\t\t// try parsing the integer value as a string",
+  (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {",
+  (string) (len=33) "\t\t\t\t*x, err = Enum64bit(val), nil",
+  (string) (len=4) "\t\t\t}",
+  (string) (len=3) "\t\t}",
+  (string) (len=13) "\tcase []byte:",
+  (string) (len=37) "\t\t*x, err = ParseEnum64bit(string(v))",
+  (string) (len=17) "\t\tif err != nil {",
+  (string) (len=47) "\t\t\t// try parsing the integer value as a string",
+  (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {",
+  (string) (len=33) "\t\t\t\t*x, err = Enum64bit(val), nil",
+  (string) (len=4) "\t\t\t}",
+  (string) (len=3) "\t\t}",
+  (string) (len=16) "\tcase Enum64bit:",
+  (string) (len=8) "\t\t*x = v",
+  (string) (len=10) "\tcase int:",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=17) "\tcase *Enum64bit:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=9) "\t\t*x = *v",
+  (string) (len=11) "\tcase uint:",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=13) "\tcase uint64:",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=11) "\tcase *int:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=13) "\tcase *int64:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=12) "\tcase *uint:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=14) "\tcase *uint64:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=14) "\tcase *string:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=30) "\t\t*x, err = ParseEnum64bit(*v)",
+  (string) (len=17) "\t\tif err != nil {",
+  (string) (len=47) "\t\t\t// try parsing the integer value as a string",
+  (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {",
+  (string) (len=33) "\t\t\t\t*x, err = Enum64bit(val), nil",
+  (string) (len=4) "\t\t\t}",
+  (string) (len=3) "\t\t}",
+  (string) (len=2) "\t}",
+  (string) "",
+  (string) (len=7) "\treturn",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=48) "// Value implements the driver Valuer interface.",
+  (string) (len=50) "func (x Enum64bit) Value() (driver.Value, error) {",
+  (string) (len=23) "\treturn x.String(), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=55) "// Set implements the Golang flag.Value interface func.",
+  (string) (len=43) "func (x *Enum64bit) Set(val string) error {",
+  (string) (len=30) "\tv, err := ParseEnum64bit(val)",
+  (string) (len=7) "\t*x = v",
+  (string) (len=11) "\treturn err",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=56) "// Get implements the Golang flag.Getter interface func.",
+  (string) (len=39) "func (x *Enum64bit) Get() interface{} {",
+  (string) (len=10) "\treturn *x",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.",
+  (string) (len=35) "func (x *Enum64bit) Type() string {",
+  (string) (len=19) "\treturn \"Enum64bit\"",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=27) "type NullEnum64bit struct {",
+  (string) (len=20) "\tEnum64bit Enum64bit",
+  (string) (len=15) "\tValid     bool",
+  (string) (len=15) "\tSet       bool",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=58) "func NewNullEnum64bit(val interface{}) (x NullEnum64bit) {",
+  (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.",
+  (string) (len=7) "\treturn",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=41) "// Scan implements the Scanner interface.",
+  (string) (len=61) "func (x *NullEnum64bit) Scan(value interface{}) (err error) {",
+  (string) (len=13) "\tx.Set = true",
+  (string) (len=18) "\tif value == nil {",
+  (string) (len=44) "\t\tx.Enum64bit, x.Valid = Enum64bit(0), false",
+  (string) (len=8) "\t\treturn",
+  (string) (len=2) "\t}",
+  (string) "",
+  (string) (len=30) "\terr = x.Enum64bit.Scan(value)",
+  (string) (len=23) "\tx.Valid = (err == nil)",
+  (string) (len=7) "\treturn",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=48) "// Value implements the driver Valuer interface.",
+  (string) (len=54) "func (x NullEnum64bit) Value() (driver.Value, error) {",
+  (string) (len=14) "\tif !x.Valid {",
+  (string) (len=17) "\t\treturn nil, nil",
+  (string) (len=2) "\t}",
+  (string) (len=46) "\t// driver.Value accepts int64 for int values.",
+  (string) (len=31) "\treturn int64(x.Enum64bit), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=60) "// MarshalJSON correctly serializes a NullEnum64bit to JSON.",
+  (string) (len=54) "func (n NullEnum64bit) MarshalJSON() ([]byte, error) {",
+  (string) (len=23) "\tconst nullStr = \"null\"",
+  (string) (len=13) "\tif n.Valid {",
+  (string) (len=34) "\t\treturn json.Marshal(n.Enum64bit)",
+  (string) (len=2) "\t}",
+  (string) (len=28) "\treturn []byte(nullStr), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=66) "// UnmarshalJSON correctly deserializes a NullEnum64bit from JSON.",
+  (string) (len=55) "func (n *NullEnum64bit) UnmarshalJSON(b []byte) error {",
+  (string) (len=13) "\tn.Set = true",
+  (string) (len=18) "\tvar x interface{}",
+  (string) (len=29) "\terr := json.Unmarshal(b, &x)",
+  (string) (len=16) "\tif err != nil {",
+  (string) (len=12) "\t\treturn err",
+  (string) (len=2) "\t}",
+  (string) (len=16) "\terr = n.Scan(x)",
+  (string) (len=11) "\treturn err",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=30) "type NullEnum64bitStr struct {",
+  (string) (len=14) "\tNullEnum64bit",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=64) "func NewNullEnum64bitStr(val interface{}) (x NullEnum64bitStr) {",
+  (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.",
+  (string) (len=7) "\treturn",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=48) "// Value implements the driver Valuer interface.",
+  (string) (len=57) "func (x NullEnum64bitStr) Value() (driver.Value, error) {",
+  (string) (len=14) "\tif !x.Valid {",
+  (string) (len=17) "\t\treturn nil, nil",
+  (string) (len=2) "\t}",
+  (string) (len=33) "\treturn x.Enum64bit.String(), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=60) "// MarshalJSON correctly serializes a NullEnum64bit to JSON.",
+  (string) (len=57) "func (n NullEnum64bitStr) MarshalJSON() ([]byte, error) {",
+  (string) (len=23) "\tconst nullStr = \"null\"",
+  (string) (len=13) "\tif n.Valid {",
+  (string) (len=34) "\t\treturn json.Marshal(n.Enum64bit)",
+  (string) (len=2) "\t}",
+  (string) (len=28) "\treturn []byte(nullStr), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=66) "// UnmarshalJSON correctly deserializes a NullEnum64bit from JSON.",
+  (string) (len=58) "func (n *NullEnum64bitStr) UnmarshalJSON(b []byte) error {",
+  (string) (len=13) "\tn.Set = true",
+  (string) (len=18) "\tvar x interface{}",
+  (string) (len=29) "\terr := json.Unmarshal(b, &x)",
+  (string) (len=16) "\tif err != nil {",
+  (string) (len=12) "\t\treturn err",
+  (string) (len=2) "\t}",
+  (string) (len=16) "\terr = n.Scan(x)",
+  (string) (len=11) "\treturn err",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=7) "const (",
   (string) (len=51) "\t// Custom_prefix_Toyota is a Model of type Toyota.",
   (string) (len=34) "\tCustom_prefix_Toyota Model = iota",
   (string) (len=18) "\t// Skipped value.",
diff --git a/generator/.snapshots/generator-TestExampleFile b/generator/.snapshots/generator-TestExampleFile
index 4a3028d..6626357 100644
--- a/generator/.snapshots/generator-TestExampleFile
+++ b/generator/.snapshots/generator-TestExampleFile
@@ -1,4 +1,4 @@
-([]string) (len=1827) {
+([]string) (len=2047) {
   (string) (len=41) "// Code generated by go-enum DO NOT EDIT.",
   (string) (len=13) "// Version: -",
   (string) (len=14) "// Revision: -",
@@ -1213,6 +1213,226 @@
   (string) (len=1) "}",
   (string) "",
   (string) (len=7) "const (",
+  (string) (len=52) "\t// Enum64bitUnknown is a Enum64bit of type Unknown.",
+  (string) (len=34) "\tEnum64bitUnknown Enum64bit = iota",
+  (string) (len=48) "\t// Enum64bitE2P15 is a Enum64bit of type E2P15.",
+  (string) (len=40) "\tEnum64bitE2P15 Enum64bit = iota + 32767",
+  (string) (len=48) "\t// Enum64bitE2P16 is a Enum64bit of type E2P16.",
+  (string) (len=40) "\tEnum64bitE2P16 Enum64bit = iota + 65534",
+  (string) (len=48) "\t// Enum64bitE2P17 is a Enum64bit of type E2P17.",
+  (string) (len=41) "\tEnum64bitE2P17 Enum64bit = iota + 131069",
+  (string) (len=48) "\t// Enum64bitE2P18 is a Enum64bit of type E2P18.",
+  (string) (len=41) "\tEnum64bitE2P18 Enum64bit = iota + 262140",
+  (string) (len=48) "\t// Enum64bitE2P19 is a Enum64bit of type E2P19.",
+  (string) (len=41) "\tEnum64bitE2P19 Enum64bit = iota + 524283",
+  (string) (len=48) "\t// Enum64bitE2P20 is a Enum64bit of type E2P20.",
+  (string) (len=42) "\tEnum64bitE2P20 Enum64bit = iota + 1048570",
+  (string) (len=48) "\t// Enum64bitE2P21 is a Enum64bit of type E2P21.",
+  (string) (len=42) "\tEnum64bitE2P21 Enum64bit = iota + 2097145",
+  (string) (len=48) "\t// Enum64bitE2P22 is a Enum64bit of type E2P22.",
+  (string) (len=43) "\tEnum64bitE2P22 Enum64bit = iota + 33554424",
+  (string) (len=48) "\t// Enum64bitE2P23 is a Enum64bit of type E2P23.",
+  (string) (len=43) "\tEnum64bitE2P23 Enum64bit = iota + 67108855",
+  (string) (len=48) "\t// Enum64bitE2P28 is a Enum64bit of type E2P28.",
+  (string) (len=44) "\tEnum64bitE2P28 Enum64bit = iota + 536870902",
+  (string) (len=48) "\t// Enum64bitE2P30 is a Enum64bit of type E2P30.",
+  (string) (len=45) "\tEnum64bitE2P30 Enum64bit = iota + 1073741813",
+  (string) (len=48) "\t// Enum64bitE2P31 is a Enum64bit of type E2P31.",
+  (string) (len=45) "\tEnum64bitE2P31 Enum64bit = iota + 2147483636",
+  (string) (len=48) "\t// Enum64bitE2P32 is a Enum64bit of type E2P32.",
+  (string) (len=45) "\tEnum64bitE2P32 Enum64bit = iota + 4294967283",
+  (string) (len=48) "\t// Enum64bitE2P33 is a Enum64bit of type E2P33.",
+  (string) (len=45) "\tEnum64bitE2P33 Enum64bit = iota + 8454967282",
+  (string) (len=1) ")",
+  (string) "",
+  (string) (len=102) "const _Enum64bitName = \"UnknownE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33\"",
+  (string) "",
+  (string) (len=31) "var _Enum64bitNames = []string{",
+  (string) (len=21) "\t_Enum64bitName[0:7],",
+  (string) (len=22) "\t_Enum64bitName[7:12],",
+  (string) (len=23) "\t_Enum64bitName[12:17],",
+  (string) (len=23) "\t_Enum64bitName[17:22],",
+  (string) (len=23) "\t_Enum64bitName[22:27],",
+  (string) (len=23) "\t_Enum64bitName[27:32],",
+  (string) (len=23) "\t_Enum64bitName[32:37],",
+  (string) (len=23) "\t_Enum64bitName[37:42],",
+  (string) (len=23) "\t_Enum64bitName[42:47],",
+  (string) (len=23) "\t_Enum64bitName[47:52],",
+  (string) (len=23) "\t_Enum64bitName[52:57],",
+  (string) (len=23) "\t_Enum64bitName[57:62],",
+  (string) (len=23) "\t_Enum64bitName[62:67],",
+  (string) (len=23) "\t_Enum64bitName[67:72],",
+  (string) (len=23) "\t_Enum64bitName[72:77],",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=72) "// Enum64bitNames returns a list of possible string values of Enum64bit.",
+  (string) (len=32) "func Enum64bitNames() []string {",
+  (string) (len=44) "\ttmp := make([]string, len(_Enum64bitNames))",
+  (string) (len=27) "\tcopy(tmp, _Enum64bitNames)",
+  (string) (len=11) "\treturn tmp",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=41) "var _Enum64bitMap = map[Enum64bit]string{",
+  (string) (len=39) "\tEnum64bitUnknown: _Enum64bitName[0:7],",
+  (string) (len=40) "\tEnum64bitE2P15:   _Enum64bitName[7:12],",
+  (string) (len=41) "\tEnum64bitE2P16:   _Enum64bitName[12:17],",
+  (string) (len=41) "\tEnum64bitE2P17:   _Enum64bitName[17:22],",
+  (string) (len=41) "\tEnum64bitE2P18:   _Enum64bitName[22:27],",
+  (string) (len=41) "\tEnum64bitE2P19:   _Enum64bitName[27:32],",
+  (string) (len=41) "\tEnum64bitE2P20:   _Enum64bitName[32:37],",
+  (string) (len=41) "\tEnum64bitE2P21:   _Enum64bitName[37:42],",
+  (string) (len=41) "\tEnum64bitE2P22:   _Enum64bitName[42:47],",
+  (string) (len=41) "\tEnum64bitE2P23:   _Enum64bitName[47:52],",
+  (string) (len=41) "\tEnum64bitE2P28:   _Enum64bitName[52:57],",
+  (string) (len=41) "\tEnum64bitE2P30:   _Enum64bitName[57:62],",
+  (string) (len=41) "\tEnum64bitE2P31:   _Enum64bitName[62:67],",
+  (string) (len=41) "\tEnum64bitE2P32:   _Enum64bitName[67:72],",
+  (string) (len=41) "\tEnum64bitE2P33:   _Enum64bitName[72:77],",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=44) "// String implements the Stringer interface.",
+  (string) (len=36) "func (x Enum64bit) String() string {",
+  (string) (len=37) "\tif str, ok := _Enum64bitMap[x]; ok {",
+  (string) (len=12) "\t\treturn str",
+  (string) (len=2) "\t}",
+  (string) (len=39) "\treturn fmt.Sprintf(\"Enum64bit(%d)\", x)",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=43) "var _Enum64bitValue = map[string]Enum64bit{",
+  (string) (len=58) "\t_Enum64bitName[0:7]:                    Enum64bitUnknown,",
+  (string) (len=58) "\tstrings.ToLower(_Enum64bitName[0:7]):   Enum64bitUnknown,",
+  (string) (len=56) "\t_Enum64bitName[7:12]:                   Enum64bitE2P15,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[7:12]):  Enum64bitE2P15,",
+  (string) (len=56) "\t_Enum64bitName[12:17]:                  Enum64bitE2P16,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[12:17]): Enum64bitE2P16,",
+  (string) (len=56) "\t_Enum64bitName[17:22]:                  Enum64bitE2P17,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[17:22]): Enum64bitE2P17,",
+  (string) (len=56) "\t_Enum64bitName[22:27]:                  Enum64bitE2P18,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[22:27]): Enum64bitE2P18,",
+  (string) (len=56) "\t_Enum64bitName[27:32]:                  Enum64bitE2P19,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[27:32]): Enum64bitE2P19,",
+  (string) (len=56) "\t_Enum64bitName[32:37]:                  Enum64bitE2P20,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[32:37]): Enum64bitE2P20,",
+  (string) (len=56) "\t_Enum64bitName[37:42]:                  Enum64bitE2P21,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[37:42]): Enum64bitE2P21,",
+  (string) (len=56) "\t_Enum64bitName[42:47]:                  Enum64bitE2P22,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[42:47]): Enum64bitE2P22,",
+  (string) (len=56) "\t_Enum64bitName[47:52]:                  Enum64bitE2P23,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[47:52]): Enum64bitE2P23,",
+  (string) (len=56) "\t_Enum64bitName[52:57]:                  Enum64bitE2P28,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[52:57]): Enum64bitE2P28,",
+  (string) (len=56) "\t_Enum64bitName[57:62]:                  Enum64bitE2P30,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[57:62]): Enum64bitE2P30,",
+  (string) (len=56) "\t_Enum64bitName[62:67]:                  Enum64bitE2P31,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[62:67]): Enum64bitE2P31,",
+  (string) (len=56) "\t_Enum64bitName[67:72]:                  Enum64bitE2P32,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[67:72]): Enum64bitE2P32,",
+  (string) (len=56) "\t_Enum64bitName[72:77]:                  Enum64bitE2P33,",
+  (string) (len=56) "\tstrings.ToLower(_Enum64bitName[72:77]): Enum64bitE2P33,",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=62) "// ParseEnum64bit attempts to convert a string to a Enum64bit.",
+  (string) (len=53) "func ParseEnum64bit(name string) (Enum64bit, error) {",
+  (string) (len=40) "\tif x, ok := _Enum64bitValue[name]; ok {",
+  (string) (len=15) "\t\treturn x, nil",
+  (string) (len=2) "\t}",
+  (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.",
+  (string) (len=57) "\tif x, ok := _Enum64bitValue[strings.ToLower(name)]; ok {",
+  (string) (len=15) "\t\treturn x, nil",
+  (string) (len=2) "\t}",
+  (string) (len=116) "\treturn Enum64bit(0), fmt.Errorf(\"%s is not a valid Enum64bit, try [%s]\", name, strings.Join(_Enum64bitNames, \", \"))",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=53) "// MarshalText implements the text marshaller method.",
+  (string) (len=50) "func (x Enum64bit) MarshalText() ([]byte, error) {",
+  (string) (len=31) "\treturn []byte(x.String()), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=57) "// UnmarshalText implements the text unmarshaller method.",
+  (string) (len=54) "func (x *Enum64bit) UnmarshalText(text []byte) error {",
+  (string) (len=21) "\tname := string(text)",
+  (string) (len=33) "\ttmp, err := ParseEnum64bit(name)",
+  (string) (len=16) "\tif err != nil {",
+  (string) (len=12) "\t\treturn err",
+  (string) (len=2) "\t}",
+  (string) (len=9) "\t*x = tmp",
+  (string) (len=11) "\treturn nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=96) "var _Enum64bitErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes",
+  (string) "",
+  (string) (len=41) "// Scan implements the Scanner interface.",
+  (string) (len=57) "func (x *Enum64bit) Scan(value interface{}) (err error) {",
+  (string) (len=18) "\tif value == nil {",
+  (string) (len=19) "\t\t*x = Enum64bit(0)",
+  (string) (len=8) "\t\treturn",
+  (string) (len=2) "\t}",
+  (string) "",
+  (string) (len=37) "\t// A wider range of scannable types.",
+  (string) (len=61) "\t// driver.Value values at the top of the list for expediency",
+  (string) (len=27) "\tswitch v := value.(type) {",
+  (string) (len=12) "\tcase int64:",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=13) "\tcase string:",
+  (string) (len=29) "\t\t*x, err = ParseEnum64bit(v)",
+  (string) (len=13) "\tcase []byte:",
+  (string) (len=37) "\t\t*x, err = ParseEnum64bit(string(v))",
+  (string) (len=16) "\tcase Enum64bit:",
+  (string) (len=8) "\t\t*x = v",
+  (string) (len=10) "\tcase int:",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=17) "\tcase *Enum64bit:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=9) "\t\t*x = *v",
+  (string) (len=11) "\tcase uint:",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=13) "\tcase uint64:",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=11) "\tcase *int:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=13) "\tcase *int64:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number",
+  (string) (len=19) "\t\t*x = Enum64bit(v)",
+  (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=12) "\tcase *uint:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=14) "\tcase *uint64:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=20) "\t\t*x = Enum64bit(*v)",
+  (string) (len=14) "\tcase *string:",
+  (string) (len=15) "\t\tif v == nil {",
+  (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr",
+  (string) (len=3) "\t\t}",
+  (string) (len=30) "\t\t*x, err = ParseEnum64bit(*v)",
+  (string) (len=2) "\t}",
+  (string) "",
+  (string) (len=7) "\treturn",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=48) "// Value implements the driver Valuer interface.",
+  (string) (len=50) "func (x Enum64bit) Value() (driver.Value, error) {",
+  (string) (len=23) "\treturn x.String(), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=7) "const (",
   (string) (len=42) "\t// ModelToyota is a Model of type Toyota.",
   (string) (len=25) "\tModelToyota Model = iota",
   (string) (len=18) "\t// Skipped value.",
diff --git a/generator/.snapshots/generator-TestNoPrefixExampleFile b/generator/.snapshots/generator-TestNoPrefixExampleFile
index 0303878..4834ad9 100644
--- a/generator/.snapshots/generator-TestNoPrefixExampleFile
+++ b/generator/.snapshots/generator-TestNoPrefixExampleFile
@@ -1,4 +1,4 @@
-([]string) (len=993) {
+([]string) (len=1128) {
   (string) (len=41) "// Code generated by go-enum DO NOT EDIT.",
   (string) (len=13) "// Version: -",
   (string) (len=14) "// Revision: -",
@@ -674,6 +674,141 @@
   (string) (len=1) "}",
   (string) "",
   (string) (len=7) "const (",
+  (string) (len=43) "\t// Unknown is a Enum64bit of type Unknown.",
+  (string) (len=25) "\tUnknown Enum64bit = iota",
+  (string) (len=39) "\t// E2P15 is a Enum64bit of type E2P15.",
+  (string) (len=31) "\tE2P15 Enum64bit = iota + 32767",
+  (string) (len=39) "\t// E2P16 is a Enum64bit of type E2P16.",
+  (string) (len=31) "\tE2P16 Enum64bit = iota + 65534",
+  (string) (len=39) "\t// E2P17 is a Enum64bit of type E2P17.",
+  (string) (len=32) "\tE2P17 Enum64bit = iota + 131069",
+  (string) (len=39) "\t// E2P18 is a Enum64bit of type E2P18.",
+  (string) (len=32) "\tE2P18 Enum64bit = iota + 262140",
+  (string) (len=39) "\t// E2P19 is a Enum64bit of type E2P19.",
+  (string) (len=32) "\tE2P19 Enum64bit = iota + 524283",
+  (string) (len=39) "\t// E2P20 is a Enum64bit of type E2P20.",
+  (string) (len=33) "\tE2P20 Enum64bit = iota + 1048570",
+  (string) (len=39) "\t// E2P21 is a Enum64bit of type E2P21.",
+  (string) (len=33) "\tE2P21 Enum64bit = iota + 2097145",
+  (string) (len=39) "\t// E2P22 is a Enum64bit of type E2P22.",
+  (string) (len=34) "\tE2P22 Enum64bit = iota + 33554424",
+  (string) (len=39) "\t// E2P23 is a Enum64bit of type E2P23.",
+  (string) (len=34) "\tE2P23 Enum64bit = iota + 67108855",
+  (string) (len=39) "\t// E2P28 is a Enum64bit of type E2P28.",
+  (string) (len=35) "\tE2P28 Enum64bit = iota + 536870902",
+  (string) (len=39) "\t// E2P30 is a Enum64bit of type E2P30.",
+  (string) (len=36) "\tE2P30 Enum64bit = iota + 1073741813",
+  (string) (len=39) "\t// E2P31 is a Enum64bit of type E2P31.",
+  (string) (len=36) "\tE2P31 Enum64bit = iota + 2147483636",
+  (string) (len=39) "\t// E2P32 is a Enum64bit of type E2P32.",
+  (string) (len=36) "\tE2P32 Enum64bit = iota + 4294967283",
+  (string) (len=39) "\t// E2P33 is a Enum64bit of type E2P33.",
+  (string) (len=36) "\tE2P33 Enum64bit = iota + 8454967282",
+  (string) (len=1) ")",
+  (string) "",
+  (string) (len=102) "const _Enum64bitName = \"UnknownE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33\"",
+  (string) "",
+  (string) (len=41) "var _Enum64bitMap = map[Enum64bit]string{",
+  (string) (len=30) "\tUnknown: _Enum64bitName[0:7],",
+  (string) (len=31) "\tE2P15:   _Enum64bitName[7:12],",
+  (string) (len=32) "\tE2P16:   _Enum64bitName[12:17],",
+  (string) (len=32) "\tE2P17:   _Enum64bitName[17:22],",
+  (string) (len=32) "\tE2P18:   _Enum64bitName[22:27],",
+  (string) (len=32) "\tE2P19:   _Enum64bitName[27:32],",
+  (string) (len=32) "\tE2P20:   _Enum64bitName[32:37],",
+  (string) (len=32) "\tE2P21:   _Enum64bitName[37:42],",
+  (string) (len=32) "\tE2P22:   _Enum64bitName[42:47],",
+  (string) (len=32) "\tE2P23:   _Enum64bitName[47:52],",
+  (string) (len=32) "\tE2P28:   _Enum64bitName[52:57],",
+  (string) (len=32) "\tE2P30:   _Enum64bitName[57:62],",
+  (string) (len=32) "\tE2P31:   _Enum64bitName[62:67],",
+  (string) (len=32) "\tE2P32:   _Enum64bitName[67:72],",
+  (string) (len=32) "\tE2P33:   _Enum64bitName[72:77],",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=44) "// String implements the Stringer interface.",
+  (string) (len=36) "func (x Enum64bit) String() string {",
+  (string) (len=37) "\tif str, ok := _Enum64bitMap[x]; ok {",
+  (string) (len=12) "\t\treturn str",
+  (string) (len=2) "\t}",
+  (string) (len=39) "\treturn fmt.Sprintf(\"Enum64bit(%d)\", x)",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=43) "var _Enum64bitValue = map[string]Enum64bit{",
+  (string) (len=49) "\t_Enum64bitName[0:7]:                    Unknown,",
+  (string) (len=49) "\tstrings.ToLower(_Enum64bitName[0:7]):   Unknown,",
+  (string) (len=47) "\t_Enum64bitName[7:12]:                   E2P15,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[7:12]):  E2P15,",
+  (string) (len=47) "\t_Enum64bitName[12:17]:                  E2P16,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[12:17]): E2P16,",
+  (string) (len=47) "\t_Enum64bitName[17:22]:                  E2P17,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[17:22]): E2P17,",
+  (string) (len=47) "\t_Enum64bitName[22:27]:                  E2P18,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[22:27]): E2P18,",
+  (string) (len=47) "\t_Enum64bitName[27:32]:                  E2P19,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[27:32]): E2P19,",
+  (string) (len=47) "\t_Enum64bitName[32:37]:                  E2P20,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[32:37]): E2P20,",
+  (string) (len=47) "\t_Enum64bitName[37:42]:                  E2P21,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[37:42]): E2P21,",
+  (string) (len=47) "\t_Enum64bitName[42:47]:                  E2P22,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[42:47]): E2P22,",
+  (string) (len=47) "\t_Enum64bitName[47:52]:                  E2P23,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[47:52]): E2P23,",
+  (string) (len=47) "\t_Enum64bitName[52:57]:                  E2P28,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[52:57]): E2P28,",
+  (string) (len=47) "\t_Enum64bitName[57:62]:                  E2P30,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[57:62]): E2P30,",
+  (string) (len=47) "\t_Enum64bitName[62:67]:                  E2P31,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[62:67]): E2P31,",
+  (string) (len=47) "\t_Enum64bitName[67:72]:                  E2P32,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[67:72]): E2P32,",
+  (string) (len=47) "\t_Enum64bitName[72:77]:                  E2P33,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[72:77]): E2P33,",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=62) "// ParseEnum64bit attempts to convert a string to a Enum64bit.",
+  (string) (len=53) "func ParseEnum64bit(name string) (Enum64bit, error) {",
+  (string) (len=40) "\tif x, ok := _Enum64bitValue[name]; ok {",
+  (string) (len=15) "\t\treturn x, nil",
+  (string) (len=2) "\t}",
+  (string) (len=69) "\treturn Enum64bit(0), fmt.Errorf(\"%s is not a valid Enum64bit\", name)",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=53) "// MarshalText implements the text marshaller method.",
+  (string) (len=50) "func (x Enum64bit) MarshalText() ([]byte, error) {",
+  (string) (len=31) "\treturn []byte(x.String()), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=57) "// UnmarshalText implements the text unmarshaller method.",
+  (string) (len=54) "func (x *Enum64bit) UnmarshalText(text []byte) error {",
+  (string) (len=21) "\tname := string(text)",
+  (string) (len=33) "\ttmp, err := ParseEnum64bit(name)",
+  (string) (len=16) "\tif err != nil {",
+  (string) (len=12) "\t\treturn err",
+  (string) (len=2) "\t}",
+  (string) (len=9) "\t*x = tmp",
+  (string) (len=11) "\treturn nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=55) "// Set implements the Golang flag.Value interface func.",
+  (string) (len=43) "func (x *Enum64bit) Set(val string) error {",
+  (string) (len=30) "\tv, err := ParseEnum64bit(val)",
+  (string) (len=7) "\t*x = v",
+  (string) (len=11) "\treturn err",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=56) "// Get implements the Golang flag.Getter interface func.",
+  (string) (len=39) "func (x *Enum64bit) Get() interface{} {",
+  (string) (len=10) "\treturn *x",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.",
+  (string) (len=35) "func (x *Enum64bit) Type() string {",
+  (string) (len=19) "\treturn \"Enum64bit\"",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=7) "const (",
   (string) (len=37) "\t// Toyota is a Model of type Toyota.",
   (string) (len=20) "\tToyota Model = iota",
   (string) (len=18) "\t// Skipped value.",
diff --git a/generator/.snapshots/generator-TestNoPrefixExampleFileWithSnakeToCamel b/generator/.snapshots/generator-TestNoPrefixExampleFileWithSnakeToCamel
index 6497e6b..e920dd2 100644
--- a/generator/.snapshots/generator-TestNoPrefixExampleFileWithSnakeToCamel
+++ b/generator/.snapshots/generator-TestNoPrefixExampleFileWithSnakeToCamel
@@ -1,4 +1,4 @@
-([]string) (len=993) {
+([]string) (len=1128) {
   (string) (len=41) "// Code generated by go-enum DO NOT EDIT.",
   (string) (len=13) "// Version: -",
   (string) (len=14) "// Revision: -",
@@ -674,6 +674,141 @@
   (string) (len=1) "}",
   (string) "",
   (string) (len=7) "const (",
+  (string) (len=43) "\t// Unknown is a Enum64bit of type Unknown.",
+  (string) (len=25) "\tUnknown Enum64bit = iota",
+  (string) (len=39) "\t// E2P15 is a Enum64bit of type E2P15.",
+  (string) (len=31) "\tE2P15 Enum64bit = iota + 32767",
+  (string) (len=39) "\t// E2P16 is a Enum64bit of type E2P16.",
+  (string) (len=31) "\tE2P16 Enum64bit = iota + 65534",
+  (string) (len=39) "\t// E2P17 is a Enum64bit of type E2P17.",
+  (string) (len=32) "\tE2P17 Enum64bit = iota + 131069",
+  (string) (len=39) "\t// E2P18 is a Enum64bit of type E2P18.",
+  (string) (len=32) "\tE2P18 Enum64bit = iota + 262140",
+  (string) (len=39) "\t// E2P19 is a Enum64bit of type E2P19.",
+  (string) (len=32) "\tE2P19 Enum64bit = iota + 524283",
+  (string) (len=39) "\t// E2P20 is a Enum64bit of type E2P20.",
+  (string) (len=33) "\tE2P20 Enum64bit = iota + 1048570",
+  (string) (len=39) "\t// E2P21 is a Enum64bit of type E2P21.",
+  (string) (len=33) "\tE2P21 Enum64bit = iota + 2097145",
+  (string) (len=39) "\t// E2P22 is a Enum64bit of type E2P22.",
+  (string) (len=34) "\tE2P22 Enum64bit = iota + 33554424",
+  (string) (len=39) "\t// E2P23 is a Enum64bit of type E2P23.",
+  (string) (len=34) "\tE2P23 Enum64bit = iota + 67108855",
+  (string) (len=39) "\t// E2P28 is a Enum64bit of type E2P28.",
+  (string) (len=35) "\tE2P28 Enum64bit = iota + 536870902",
+  (string) (len=39) "\t// E2P30 is a Enum64bit of type E2P30.",
+  (string) (len=36) "\tE2P30 Enum64bit = iota + 1073741813",
+  (string) (len=39) "\t// E2P31 is a Enum64bit of type E2P31.",
+  (string) (len=36) "\tE2P31 Enum64bit = iota + 2147483636",
+  (string) (len=39) "\t// E2P32 is a Enum64bit of type E2P32.",
+  (string) (len=36) "\tE2P32 Enum64bit = iota + 4294967283",
+  (string) (len=39) "\t// E2P33 is a Enum64bit of type E2P33.",
+  (string) (len=36) "\tE2P33 Enum64bit = iota + 8454967282",
+  (string) (len=1) ")",
+  (string) "",
+  (string) (len=102) "const _Enum64bitName = \"UnknownE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33\"",
+  (string) "",
+  (string) (len=41) "var _Enum64bitMap = map[Enum64bit]string{",
+  (string) (len=30) "\tUnknown: _Enum64bitName[0:7],",
+  (string) (len=31) "\tE2P15:   _Enum64bitName[7:12],",
+  (string) (len=32) "\tE2P16:   _Enum64bitName[12:17],",
+  (string) (len=32) "\tE2P17:   _Enum64bitName[17:22],",
+  (string) (len=32) "\tE2P18:   _Enum64bitName[22:27],",
+  (string) (len=32) "\tE2P19:   _Enum64bitName[27:32],",
+  (string) (len=32) "\tE2P20:   _Enum64bitName[32:37],",
+  (string) (len=32) "\tE2P21:   _Enum64bitName[37:42],",
+  (string) (len=32) "\tE2P22:   _Enum64bitName[42:47],",
+  (string) (len=32) "\tE2P23:   _Enum64bitName[47:52],",
+  (string) (len=32) "\tE2P28:   _Enum64bitName[52:57],",
+  (string) (len=32) "\tE2P30:   _Enum64bitName[57:62],",
+  (string) (len=32) "\tE2P31:   _Enum64bitName[62:67],",
+  (string) (len=32) "\tE2P32:   _Enum64bitName[67:72],",
+  (string) (len=32) "\tE2P33:   _Enum64bitName[72:77],",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=44) "// String implements the Stringer interface.",
+  (string) (len=36) "func (x Enum64bit) String() string {",
+  (string) (len=37) "\tif str, ok := _Enum64bitMap[x]; ok {",
+  (string) (len=12) "\t\treturn str",
+  (string) (len=2) "\t}",
+  (string) (len=39) "\treturn fmt.Sprintf(\"Enum64bit(%d)\", x)",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=43) "var _Enum64bitValue = map[string]Enum64bit{",
+  (string) (len=49) "\t_Enum64bitName[0:7]:                    Unknown,",
+  (string) (len=49) "\tstrings.ToLower(_Enum64bitName[0:7]):   Unknown,",
+  (string) (len=47) "\t_Enum64bitName[7:12]:                   E2P15,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[7:12]):  E2P15,",
+  (string) (len=47) "\t_Enum64bitName[12:17]:                  E2P16,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[12:17]): E2P16,",
+  (string) (len=47) "\t_Enum64bitName[17:22]:                  E2P17,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[17:22]): E2P17,",
+  (string) (len=47) "\t_Enum64bitName[22:27]:                  E2P18,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[22:27]): E2P18,",
+  (string) (len=47) "\t_Enum64bitName[27:32]:                  E2P19,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[27:32]): E2P19,",
+  (string) (len=47) "\t_Enum64bitName[32:37]:                  E2P20,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[32:37]): E2P20,",
+  (string) (len=47) "\t_Enum64bitName[37:42]:                  E2P21,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[37:42]): E2P21,",
+  (string) (len=47) "\t_Enum64bitName[42:47]:                  E2P22,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[42:47]): E2P22,",
+  (string) (len=47) "\t_Enum64bitName[47:52]:                  E2P23,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[47:52]): E2P23,",
+  (string) (len=47) "\t_Enum64bitName[52:57]:                  E2P28,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[52:57]): E2P28,",
+  (string) (len=47) "\t_Enum64bitName[57:62]:                  E2P30,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[57:62]): E2P30,",
+  (string) (len=47) "\t_Enum64bitName[62:67]:                  E2P31,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[62:67]): E2P31,",
+  (string) (len=47) "\t_Enum64bitName[67:72]:                  E2P32,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[67:72]): E2P32,",
+  (string) (len=47) "\t_Enum64bitName[72:77]:                  E2P33,",
+  (string) (len=47) "\tstrings.ToLower(_Enum64bitName[72:77]): E2P33,",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=62) "// ParseEnum64bit attempts to convert a string to a Enum64bit.",
+  (string) (len=53) "func ParseEnum64bit(name string) (Enum64bit, error) {",
+  (string) (len=40) "\tif x, ok := _Enum64bitValue[name]; ok {",
+  (string) (len=15) "\t\treturn x, nil",
+  (string) (len=2) "\t}",
+  (string) (len=69) "\treturn Enum64bit(0), fmt.Errorf(\"%s is not a valid Enum64bit\", name)",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=53) "// MarshalText implements the text marshaller method.",
+  (string) (len=50) "func (x Enum64bit) MarshalText() ([]byte, error) {",
+  (string) (len=31) "\treturn []byte(x.String()), nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=57) "// UnmarshalText implements the text unmarshaller method.",
+  (string) (len=54) "func (x *Enum64bit) UnmarshalText(text []byte) error {",
+  (string) (len=21) "\tname := string(text)",
+  (string) (len=33) "\ttmp, err := ParseEnum64bit(name)",
+  (string) (len=16) "\tif err != nil {",
+  (string) (len=12) "\t\treturn err",
+  (string) (len=2) "\t}",
+  (string) (len=9) "\t*x = tmp",
+  (string) (len=11) "\treturn nil",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=55) "// Set implements the Golang flag.Value interface func.",
+  (string) (len=43) "func (x *Enum64bit) Set(val string) error {",
+  (string) (len=30) "\tv, err := ParseEnum64bit(val)",
+  (string) (len=7) "\t*x = v",
+  (string) (len=11) "\treturn err",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=56) "// Get implements the Golang flag.Getter interface func.",
+  (string) (len=39) "func (x *Enum64bit) Get() interface{} {",
+  (string) (len=10) "\treturn *x",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.",
+  (string) (len=35) "func (x *Enum64bit) Type() string {",
+  (string) (len=19) "\treturn \"Enum64bit\"",
+  (string) (len=1) "}",
+  (string) "",
+  (string) (len=7) "const (",
   (string) (len=37) "\t// Toyota is a Model of type Toyota.",
   (string) (len=20) "\tToyota Model = iota",
   (string) (len=18) "\t// Skipped value.",
diff --git a/generator/example_test.go b/generator/example_test.go
index 535aa84..4dc49f7 100644
--- a/generator/example_test.go
+++ b/generator/example_test.go
@@ -102,3 +102,23 @@ Green = 33 // Green starts with 33
 // red-orange // has a , in it!?!
 // )
 type ColorWithComment4 int
+
+/* ENUM(
+Unknown= 0
+E2P15					= 32768
+E2P16					= 65536
+E2P17					= 131072
+E2P18					= 262144
+E2P19					= 524288
+E2P20					= 1048576
+E2P21					= 2097152
+E2P22					= 33554432
+E2P23					= 67108864
+E2P28					= 536870912
+E2P30					= 1073741824
+E2P31					= 2147483648
+E2P32					= 4294967296
+E2P33					= 8454967296
+)
+*/
+type Enum64bit uint64