1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

(with-peg-rules): Build proper peg-functions

* lisp/progmodes/peg.el (with-peg-rules): Use the new (FUNC EXP)
feature in `cl-labels`.
This commit is contained in:
Stefan Monnier 2024-11-12 23:12:07 -05:00
parent 79400f4f18
commit 986621ae1f

View File

@ -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)))