bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Stefan Monnier
Subject: bug#59345: 28.2; peg.el: syntax-class PEX does not advance point
Date: Mon, 28 Nov 2022 17:50:03 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]