Stefan Kangas writes:

> 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

The example in peg.texi is incorrect, and we should not modify it this
way. Refer to peg.el for the correct usage:

@@ -141,9 +141,9 @@ Parsing Expression Grammars
 @example
 @group
 (define-peg-ruleset number-grammar
-        '((number sign digit (* digit))
-          digit  ;; A reference to the definition above.
-          (sign (or "+" "-" ""))))
+  (number () sign digit (* digit))
+  (digit () [0-9])
+  (sign () (or "+" "-" "")))
 @end group
 @end example

BTW, as I mentioned last month, the indentation of `define-peg-rule' has
an issue. I'm not very familiar with the history of peg.el, but could it
be that the indentation rule was forgotten to be updated after
introducing the parameter? Please consider fixing it.

I believe the documentation of `peg-parse' may contain some potentially
misleading parts. If needed, I can provide a simple patch.