diff --git a/gigaparsec.go b/gigaparsec.go index 5eeefb5..0f286e9 100644 --- a/gigaparsec.go +++ b/gigaparsec.go @@ -136,7 +136,7 @@ func Satisfy[T any](pred func(T) bool) Parser[T, T] { func Slice[T comparable](s []T) Parser[T, []T] { expected := fmt.Sprint(s) - return func(state State[T]) (reply Result[T, []T], err error) { + return func(state State[T]) (Result[T, []T], error) { token := make([]T, len(s)) _, next, err := state.Read(token) if errors.Is(err, io.EOF) { @@ -234,7 +234,7 @@ func Try[In, Out any](p Parser[In, Out]) Parser[In, Out] { } func Label[In, Out any](p Parser[In, Out], l string) Parser[In, Out] { - return func(input State[In]) (reply Result[In, Out], err error) { + return func(input State[In]) (Result[In, Out], error) { result, err := p(input) if err != nil || result.Consumed() { return result, err @@ -253,8 +253,8 @@ func Map[In, Out1, Out2 any](p Parser[In, Out1], f func(Out1) Out2) Parser[In, O }) } -func End[In any](s State[In]) (reply Result[In, struct{}], err error) { - _, _, err = s.cursor.Read([]In{}) +func End[In any](s State[In]) (Result[In, struct{}], error) { + _, _, err := s.cursor.Read([]In{}) if errors.Is(err, io.EOF) { return Succeed(true, struct{}{}, s, MessageOK(s.Pos())), nil }