Hide Message fields

This commit is contained in:
2024-09-11 15:27:10 -06:00
parent 3222d1cfe7
commit b040fd21c3
3 changed files with 32 additions and 28 deletions

View File

@ -72,11 +72,7 @@ func Regexp(str string) gigaparsec.Parser[byte, string] {
if err != nil {
return gigaparsec.Result[byte, string]{}, fmt.Errorf("Regexp: unexpected error: %w", err)
}
return gigaparsec.Fail[byte, string](false, gigaparsec.Message{
Pos: input.Pos(),
Got: string(got),
Expected: []string{expected},
}), nil
return gigaparsec.Fail[byte, string](false, gigaparsec.MakeMessage(input.Pos(), string(got), expected)), nil
}
// Alas, this is a little wasteful because a Regexp can only return indices
// when searching a RuneReader.