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


View this message in rfc822 format

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eric Abrahamsen <eric <at> ericabrahamsen.net>, 76555 <at> debbugs.gnu.org, Yue Yi <include_yy <at> qq.com>
Subject: bug#76555: 30.1; PEG's doc needs some correction
Date: Tue, 4 Mar 2025 02:37:04 +0000
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>>> 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?

Ping, Eric, WDYT?  Can we install the below change?

> 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.