Do not run lexer.Consumed if there's an error.

This commit is contained in:
Jura Stakhiv
2017-01-30 18:34:51 +02:00
parent cc9fc679cf
commit c3fd2df7d2
+1 -1
View File
@@ -589,7 +589,7 @@ func (r *Lexer) IsStart() bool {
// Consumed reads all remaining bytes from the input, publishing an error if
// there is anything but whitespace remaining.
func (r *Lexer) Consumed() {
if r.pos > len(r.Data) {
if r.pos > len(r.Data) || !r.Ok() {
return
}