Use byte type for enums

This commit is contained in:
2015-02-18 16:01:18 +07:00
parent 4917b570b0
commit 9e8610ba3b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ type (
}
// Identifies the type of the item
Token int
Token byte
// Represents the state of the scanner as a function that returns the next state
stateFn func(*Lexer) stateFn
@@ -86,7 +86,7 @@ func (l *Lexer) NextItem() (item Item, ok bool) {
// Returns the next rune in the input
func (l *Lexer) next() rune {
if int(l.pos) >= len(l.input) {
if l.pos >= len(l.input) {
l.width = 0
return 0
}