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: Tim Landscheidt <tim <at> tim-landscheidt.de>
To: 78884 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#78884: 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>




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.