diff --git a/parser/pigeon.go b/parser/pigeon.go
index <HASH>..<HASH> 100644
--- a/parser/pigeon.go
+++ b/parser/pigeon.go
@@ -1135,7 +1135,7 @@ func (p *parser) addErrAt(err error, pos position) {
 			buf.WriteString("rule " + rule.name)
 		}
 	}
-	pe := &parserError{Inner: err, prefix: buf.String()}
+	pe := &parserError{Inner: err, pos: pos, prefix: buf.String()}
 	p.errs.add(pe)
 }
 
@@ -1152,7 +1152,7 @@ func (p *parser) read() {
 	}
 
 	if rn == utf8.RuneError {
-		if n > 0 {
+		if n == 1 {
 			p.addErr(errInvalidEncoding)
 		}
 	}
Minor update to generated pigeon.go