diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-02-18 20:31:17 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-02-18 20:31:17 -0500 |
commit | 99db66a01fd998942c4e75733863903247345d90 (patch) | |
tree | 2a206b3c2fa874529eba9ed769c7daa00f48a17a /lisp/emacs-lisp | |
parent | 746d2923d685ff9067ca0a999ac8321dd45d1c43 (diff) | |
download | emacs-99db66a01fd998942c4e75733863903247345d90.tar.gz emacs-99db66a01fd998942c4e75733863903247345d90.tar.bz2 emacs-99db66a01fd998942c4e75733863903247345d90.zip |
* lisp/emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/smie.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 5b9dc6422a2..48bded4e3a6 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -612,8 +612,11 @@ PREC2 is a table as returned by `smie-precs->prec2' or (cons (pcase (cdr x) (`closer (cddr (assoc token table))) (`opener (cdr (assoc token table)))))) - (cl-assert (numberp (car cons))) - (setf (car cons) (list (car cons))))) + ;; `cons' can be nil for openers/closers which only contain + ;; "atomic" elements. + (when cons + (cl-assert (numberp (car cons))) + (setf (car cons) (list (car cons)))))) (let ((ca (gethash :smie-closer-alist prec2))) (when ca (push (cons :smie-closer-alist ca) table))) ;; (smie-check-grammar table prec2 'step3) |