diff options
| -rw-r--r-- | lisp/emacs-lisp/pcase.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index fe62820f0cb..898d460c144 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el | |||
| @@ -1172,12 +1172,13 @@ The predicate is the logical-AND of: | |||
| 1172 | (upatd (pcase--expand-\` (cdr qpat)))) | 1172 | (upatd (pcase--expand-\` (cdr qpat)))) |
| 1173 | (if (and (eq (car-safe upata) 'quote) (eq (car-safe upatd) 'quote)) | 1173 | (if (and (eq (car-safe upata) 'quote) (eq (car-safe upatd) 'quote)) |
| 1174 | `'(,(cadr upata) . ,(cadr upatd)) | 1174 | `'(,(cadr upata) . ,(cadr upatd)) |
| 1175 | `(and ,@(when (eq (car qpat) '\`) | 1175 | `(and (pred consp) |
| 1176 | `((guard ,(macroexp-warn-and-return | ||
| 1177 | "Nested ` are not supported" t nil nil qpat)))) | ||
| 1178 | (pred consp) | ||
| 1179 | (app car-safe ,upata) | 1176 | (app car-safe ,upata) |
| 1180 | (app cdr-safe ,upatd))))) | 1177 | (app cdr-safe ,upatd) |
| 1178 | ,@(when (eq (car qpat) '\`) | ||
| 1179 | `((guard ,(macroexp-warn-and-return | ||
| 1180 | "Nested ` are not supported in Pcase patterns" | ||
| 1181 | t nil nil qpat)))))))) | ||
| 1181 | ((or (stringp qpat) (numberp qpat) (symbolp qpat)) `',qpat) | 1182 | ((or (stringp qpat) (numberp qpat) (symbolp qpat)) `',qpat) |
| 1182 | ;; In all other cases just raise an error so we can't break | 1183 | ;; In all other cases just raise an error so we can't break |
| 1183 | ;; backward compatibility when adding \` support for other | 1184 | ;; backward compatibility when adding \` support for other |