From 4455c347354afe497df35986043241f5d8438670 Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Tue, 17 Sep 2024 21:37:07 -0600 Subject: [PATCH] Allow expected in MessageEnd --- gigaparsec.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gigaparsec.go b/gigaparsec.go index aa8ebc3..67a53b1 100644 --- a/gigaparsec.go +++ b/gigaparsec.go @@ -118,7 +118,9 @@ func (m Message) String() string { func MessageOK(pos uint64) Message { return Message{pos: pos} } -func MessageEnd(pos uint64) Message { return Message{pos: pos, got: "end of input"} } +func MessageEnd(pos uint64, expected ...string) Message { + return Message{pos: pos, got: "end of input", expected: expected} +} func MakeState[In any](c cursor.Cursor[In]) State[In] { return State[In]{cursor: c}