1
0

fix EOF handling after stdlib change for files

This commit is contained in:
Arpad Ryszka 2025-12-10 21:18:22 +01:00
parent 4f1c219052
commit 5e069c4ca4
4 changed files with 8 additions and 4 deletions

View File

@ -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

File diff suppressed because one or more lines are too long

View File

@ -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}}}