1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* lisp/emacs-lisp/syntax.el (syntax-propertize-rules): Allow empty rules

This commit is contained in:
Stefan Monnier 2018-11-02 17:47:11 -04:00
parent aee434c3e0
commit 7b82d51437

View file

@ -176,7 +176,7 @@ Note: back-references in REGEXPs do not work."
(re (re
(mapconcat (mapconcat
(lambda (rule) (lambda (rule)
(let* ((orig-re (eval (car rule))) (let* ((orig-re (eval (car rule) t))
(re orig-re)) (re orig-re))
(when (and (assq 0 rule) (cdr rules)) (when (and (assq 0 rule) (cdr rules))
;; If there's more than 1 rule, and the rule want to apply ;; If there's more than 1 rule, and the rule want to apply
@ -190,7 +190,7 @@ Note: back-references in REGEXPs do not work."
(cond (cond
((assq 0 rule) (if (zerop offset) t ((assq 0 rule) (if (zerop offset) t
`(match-beginning ,offset))) `(match-beginning ,offset)))
((null (cddr rule)) ((and (cdr rule) (null (cddr rule)))
`(match-beginning ,(+ offset (car (cadr rule))))) `(match-beginning ,(+ offset (car (cadr rule)))))
(t (t
`(or ,@(mapcar `(or ,@(mapcar