fix EOF handling after stdlib change for files
This commit is contained in:
parent
4f1c219052
commit
5e069c4ca4
@ -1,6 +1,7 @@
|
||||
package treerack
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"strings"
|
||||
"unicode"
|
||||
@ -39,7 +40,7 @@ func (c *context) read() bool {
|
||||
|
||||
token, n, err := c.reader.ReadRune()
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
if errors.Is(err, io.EOF) {
|
||||
if n == 0 {
|
||||
c.eof = true
|
||||
return false
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -18,6 +18,7 @@ unlicensed.
|
||||
|
||||
package self
|
||||
|
||||
// head
|
||||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
@ -618,7 +619,7 @@ func (c *context) read() bool {
|
||||
}
|
||||
token, n, err := c.reader.ReadRune()
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
if errors.Is(err, io.EOF) {
|
||||
if n == 0 {
|
||||
c.eof = true
|
||||
return false
|
||||
@ -808,6 +809,8 @@ func parseInput(r io.Reader, p parser, b builder, kw []parser) (*Node, error) {
|
||||
return n[0], nil
|
||||
}
|
||||
|
||||
// eo head
|
||||
|
||||
func Parse(r io.Reader) (*Node, error) {
|
||||
|
||||
var p196 = sequenceParser{id: 196, commit: 128, ranges: [][]int{{0, -1}, {1, 1}, {0, -1}}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user