From: Stefan Monnier Date: Wed, 13 Nov 2024 04:12:07 +0000 (-0500) Subject: (with-peg-rules): Build proper `peg-function`s X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8fa8dd63c05e8b6d22fca8e2482013c40e2d7dc4;p=emacs.git (with-peg-rules): Build proper `peg-function`s * lisp/progmodes/peg.el (with-peg-rules): Use the new (FUNC EXP) feature in `cl-labels`. (cherry picked from commit 986621ae1ff4d3cfad31adb20216f1f71ce0747c) --- diff --git a/lisp/progmodes/peg.el b/lisp/progmodes/peg.el index 0b069e95563..115f692a030 100644 --- a/lisp/progmodes/peg.el +++ b/lisp/progmodes/peg.el @@ -438,10 +438,9 @@ rulesets defined previously with `define-peg-ruleset'." (macroexpand-all `(cl-labels ,(mapcar (lambda (rule) - ;; FIXME: Use `peg--lambda' as well. `(,(peg--rule-id (car rule)) - () - ,(peg--translate-rule-body (car rule) (cdr rule)))) + (peg--lambda ',(cdr rule) () + ,(peg--translate-rule-body (car rule) (cdr rule))))) rules) ,@body) `((:peg-rules ,@(append rules (cdr ctx)))