diff --git a/gigaparsec.go b/gigaparsec.go index 0f286e9..0538ce3 100644 --- a/gigaparsec.go +++ b/gigaparsec.go @@ -253,7 +253,7 @@ func Map[In, Out1, Out2 any](p Parser[In, Out1], f func(Out1) Out2) Parser[In, O }) } -func End[In any](s State[In]) (Result[In, struct{}], error) { +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 @@ -267,3 +267,7 @@ func End[In any](s State[In]) (Result[In, struct{}], error) { Expected: []string{"end of input"}, }), nil } + +func End[In any]() Parser[In, struct{}] { + return end +}