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

Previous Next

Package: emacs;

Reported by: Sean Devlin <spd <at> toadstyle.org>

Date: Thu, 17 Nov 2022 23:50:02 UTC

Severity: normal

Found in version 28.2

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Sean Devlin <spd <at> toadstyle.org>, Helmut Eller <eller.helmut <at> gmail.com>, 59345 <at> debbugs.gnu.org
Subject: bug#59345: 28.2; peg.el: syntax-class PEX does not advance point
Date: Mon, 28 Nov 2022 17:50:03 -0500
> diff --git a/peg.el b/peg.el
> index 0e4221eeb7..3f86a0bf19 100644
> --- a/peg.el
> +++ b/peg.el
> @@ -588,7 +588,9 @@ of PEG expressions, implicitly combined with `and'."
>  
>  (cl-defmethod peg--translate ((_ (eql syntax-class)) class)
>    (let ((probe (assoc class peg-syntax-classes)))
> -    (cond (probe `(looking-at ,(format "\\s%c" (cadr probe))))
> +    (cond (probe `(when (looking-at ,(format "\\s%c" (cadr probe)))
> +                    (forward-char)
> +                    t)
>  	  (t (error "Invalid syntax class: %S\nMust be one of: %s" class
>  		    (mapcar #'car peg-syntax-classes))))))
>  

LGTM,


        Stefan





This bug report was last modified 2 years and 173 days ago.

Previous Next


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