GNU bug report logs - #78884
30.1; peg-parse does not treat its arguments as sequence

Previous Next

Package: emacs;

Reported by: Tim Landscheidt <tim <at> tim-landscheidt.de>

Date: Tue, 24 Jun 2025 00:13:02 UTC

Severity: normal

Found in version 30.1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#78884: closed (30.1; peg-parse does not treat its arguments
 as sequence)
Date: Sat, 28 Jun 2025 03:16:05 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 27 Jun 2025 23:15:48 -0400
with message-id <jwvbjq8r1zg.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#78884: 30.1; peg-parse does not treat its arguments as sequence
has caused the debbugs.gnu.org bug report #78884,
regarding 30.1; peg-parse does not treat its arguments as sequence
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
78884: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78884
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tim Landscheidt <tim <at> tim-landscheidt.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1; peg-parse does not treat its arguments as sequence
Date: Tue, 24 Jun 2025 00:12:11 +0000
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>


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tim Landscheidt <tim <at> tim-landscheidt.de>
Cc: 78884-done <at> debbugs.gnu.org
Subject: Re: bug#78884: 30.1; peg-parse does not treat its arguments as
 sequence
Date: Fri, 27 Jun 2025 23:15:48 -0400
> 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



This bug report was last modified 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.