From: Stefan Monnier Date: Thu, 19 Feb 2015 01:31:17 +0000 (-0500) Subject: * lisp/emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem. X-Git-Tag: emacs-25.0.90~2564^2~349 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=99db66a01fd998942c4e75733863903247345d90;p=emacs.git * lisp/emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b71b55d8477..933e5bbb515 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2015-02-19 Stefan Monnier + + * emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem. + 2015-02-18 Kelly Dean * register.el (jump-to-register): 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)