From 1503217e868126f4ad6db43b58fa39cb1d080f4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sat, 9 Apr 2022 10:55:20 +0200
Subject: [PATCH] (chibi parse): Ensure reason is always a string

While testing a `(chibi parser)`-based parser I noticed that
`parse-string` is the only provided parser combinator which uses a list,
instead of a string, as a failure reason. It is not explicitly
documented but since all other standard parser combinator use a string
for the error reason I assume this to be a bug and have adjusted the
`parse-string` combinator accordingly in this commit.
---
 lib/chibi/parse/parse.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/chibi/parse/parse.scm b/lib/chibi/parse/parse.scm
index d80d6907..cc52150f 100644
--- a/lib/chibi/parse/parse.scm
+++ b/lib/chibi/parse/parse.scm
@@ -663,7 +663,7 @@
 (define (parse-string str)
   (parse-map (parse-with-failure-reason
               (parse-seq-list (map parse-char (string->list str)))
-              `(expected ,str))
+              (string-append "expected '" str "'"))
              list->string))
 
 ;;> Parse a sequence of characters matching \var{x} as with