Merge pull request #54 from imuli/other-unicode

distinguish unknown unicode characters from EOF
This commit is contained in:
Vadym Slizov 2018-07-14 18:35:40 +03:00 committed by GitHub
commit 731a0ed1c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -462,8 +462,10 @@ func Rune2Class(r rune) int {
if unicode.IsGraphic(r) { if unicode.IsGraphic(r) {
return classUnicodeGraphic return classUnicodeGraphic
} }
// return classOther if r == lex.RuneEOF {
return -1 return int(r)
}
return classOther
} }
// NewLexer the Lexer constructor // NewLexer the Lexer constructor