diff options
-rw-r--r-- | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | 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 <monnier@iro.umontreal.ca> + + * emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem. + 2015-02-18 Kelly Dean <kelly@prtime.org> * 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) |