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 #14 received at 76555 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Yue Yi" <include_yy <at> qq.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 76555 <at> debbugs.gnu.org
Subject: Re: bug#76555: 30.1; PEG's doc needs some correction
Date: Tue, 25 Feb 2025 19:08:02 +0200
> Date: Tue, 25 Feb 2025 22:52:22 +0800
> From:  "Yue Yi" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 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 "+" "-" ""))))
> -------------------------------------------------------------------
> 
> We noticed that the correct usage of this macro is provided in peg.el.
> 
> --------------code from peg.el ------------------------------------
> ;;;; Named rulesets:
> ;;
> ;; You can define a set of rules for later use with:
> ;;
> ;;     (define-peg-ruleset myrules
> ;;       (sign  () (or "+" "-" ""))
> ;;       (digit () [0-9])
> ;;       (nat   () digit (* digit))
> ;;       (int   () sign digit (* digit))
> ;;       (float () int "." nat))
> -------------------------------------------------------------------
> 
> Perhaps we can correct the errors in the documentation through a simple
> replacement. 

Stefan, could you please look into this?




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.