GNU bug report logs - #76555
30.1; PEG's doc needs some correction

Previous Next

Package: emacs;

Reported by: "Yue Yi" <include_yy <at> qq.com>

Date: Tue, 25 Feb 2025 14:55:02 UTC

Severity: minor

Found in version 30.1

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

Bug is archived. No further changes may be made.

Full log


Message #17 received at 76555 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 76555 <at> debbugs.gnu.org, Yue Yi <include_yy <at> qq.com>
Subject: Re: bug#76555: 30.1; PEG's doc needs some correction
Date: Tue, 25 Feb 2025 13:14:18 -0500
>> As we know, Emacs 30 introduced a PEG implementation, peg.el. I found
>> that the following code doesn't work properly when reading the PEG
>> documentation with folks:
>> -------------- code from lispref/peg.texi -------------------------
>> (define-peg-rule digit ()
>>   [0-9])
>> (define-peg-ruleset number-grammar
>>         '((number sign digit (* digit))
>>           digit  ;; A reference to the definition above.
>>           (sign (or "+" "-" ""))))
>> -------------------------------------------------------------------

Eric, where does this "reference" line come from?
I don't think we've ever supported such a thing, nor needed it.
Did you mean something like what I have in the patch below?


        Stefan


diff --git a/doc/lispref/peg.texi b/doc/lispref/peg.texi
index 80e2581e7bb..e03ec57a457 100644
--- a/doc/lispref/peg.texi
+++ b/doc/lispref/peg.texi
@@ -141,8 +141,8 @@ Parsing Expression Grammars
 @example
 @group
 (define-peg-ruleset number-grammar
+        ;; `digit' here references the definition above.
         '((number sign digit (* digit))
-          digit  ;; A reference to the definition above.
           (sign (or "+" "-" ""))))
 @end group
 @end example





This bug report was last modified 138 days ago.

Previous Next


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