Merge pull request #15 from imuli/panic-quick-fix

the simple fix for #14 (panic on 32-bit)
This commit is contained in:
Vadym Slizov 2018-05-15 18:35:12 +03:00 committed by GitHub
commit e116a1adf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -462,7 +462,7 @@ func Rune2Class(r rune) int {
// NewLexer the Lexer constructor
func NewLexer(src io.Reader, fName string) *Lexer {
file := token.NewFileSet().AddFile(fName, -1, 1<<31-1)
file := token.NewFileSet().AddFile(fName, -1, 1<<31-3)
lx, err := lex.New(file, bufio.NewReader(src), lex.RuneClass(Rune2Class))
if err != nil {
panic(err)