Use byte type for enums
This commit is contained in:
parent
4917b570b0
commit
9e8610ba3b
|
@ -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
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ type (
|
|||
}
|
||||
|
||||
// Type of expectation: object or array
|
||||
expectationType int
|
||||
expectationType byte
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
Loading…
Reference in New Issue