Subject: bug#78884: closed (Re: bug#78884: 30.1; peg-parse does not treat its arguments as sequence)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 28 Jun 2025 03:16:05 +0000

Your bug report

#78884: 30.1; peg-parse does not treat its arguments as sequence

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
78884: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78884
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#78884: 30.1; peg-parse does not treat its arguments as sequence
From: Stefan Monnier <[email-masked]>
To: Tim Landscheidt <[email-masked]>
Cc: [email-masked]
Date: Fri, 27 Jun 2025 23:15:48 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> Can you check that the quick-fix below fixes things on your side (and
> not just for your example)?

Well, I pushed it to `master`, and I'm closing the bug.
In case it's not fully fixed, feel free to reopen, of course.

        Stefan

Subject: 30.1; peg-parse does not treat its arguments as sequence
From: Tim Landscheidt <[email-masked]>
To: [email-masked]
Date: Tue, 24 Jun 2025 00:12:11 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

The docstring for Emacs 30.1's peg-parse reads:

| (peg-parse &rest PEXS)

| Match PEXS at point.
| PEXS is a sequence of PEG expressions, implicitly combined with ‘and’.
| Returns STACK if the match succeed and signals an error on failure,
| moving point along the way.

However, it will fail with (for example) "Wrong type
argument: listp" when called as such:

| ELISP> (with-temp-buffer
|          (insert "ABCDEF")
|          (goto-char (point-min))
|          (peg-parse
|           (bob)
|           "ABC"))
| *** Eval error ***  Wrong type argument: listp, "ABC"
| ELISP>

An explicit sequence with "and" works:

| ELISP> (with-temp-buffer
|          (insert "ABCDEF")
|          (goto-char (point-min))
|          (peg-parse
|           (and
|            (bob)
|            "ABC")))
| t

| ELISP>