summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/smie.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index f2163b243ee..2c2898ae718 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -702,7 +702,11 @@ Possible return values:
(catch 'return
(let ((levels
(if (stringp halfsexp)
- (prog1 (list (cdr (assoc halfsexp smie-grammar)))
+ (prog1 (list (or (cdr (assoc halfsexp smie-grammar))
+ (when (string-match "\\`\\s(\\|\\s)\\(\\)\\'"
+ halfsexp)
+ (if (match-end 1) '(0 nil) '(nil 0)))
+ (error "Unknown token: %S" halfsexp)))
(setq halfsexp nil)))))
(while
(let* ((pos (point))