Subject: bug#59345: 28.2; peg.el: syntax-class PEX does not advance point

From: Michael Heerdegen <[email-masked]>
Date: Fri, 18 Nov 2022 07:16:38 +0100

Sean Devlin <[email-masked]> writes:

> In version 1.0 of peg.el, there is a PEX to match the syntax class of
> the character at point. I expected it to advance the point after
> recognizing the correct class, but it seems that it does not.

Yes, I too think this is a bug.

PEGs that match something after the char class matching part even fail,
which is definitely not correct: compare in a buffer containing "  a":

  (peg-run (peg (* [blank]) "a"))

vs.

  (peg-run (peg (* (syntax-class whitespace)) "a"))

The fist one matches up to the "a", the seconds doesn't, but should.

I CC Helmut Eller, the author of peg.el.

Michael.