utf8s.RuneError

master
Charles Iliya Krempeaux 2019-09-10 08:27:52 -07:00
parent 578415cde8
commit e15c86020c
2 changed files with 11 additions and 2 deletions

9
runeerror.go 100644
View File

@ -0,0 +1,9 @@
package utf8s
import (
"unicode/utf8"
)
const (
RuneError = utf8.RuneError
)

View File

@ -23,12 +23,12 @@ func NewRuneScanner(reader io.Reader) *RuneScanner {
func (receiver *RuneScanner) ReadRune() (rune, int, error) {
if nil == receiver {
return 0, 0, errNilReceiver
return RuneError, 0, errNilReceiver
}
reader := receiver.reader
if nil == reader {
return 0, 0, errNilReader
return RuneError, 0, errNilReader
}
if receiver.peeked {