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

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