From 99db66a01fd998942c4e75733863903247345d90 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 18 Feb 2015 20:31:17 -0500 Subject: [PATCH] * lisp/emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/smie.el | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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) -- 2.39.2