Skip to content

Commit c5de861

Browse files
committed
* lisp/emacs-lisp/smie.el (smie-next-sexp): Fix bug#38255
Handle the case where the token is not in `smie-grammar`, either because the caller is making an error, or because it's a paren-like token that's not handled in the grammar but directly via the syntax tables.
1 parent 0420878 commit c5de861

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lisp/emacs-lisp/smie.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,11 @@ Possible return values:
702702
(catch 'return
703703
(let ((levels
704704
(if (stringp halfsexp)
705-
(prog1 (list (cdr (assoc halfsexp smie-grammar)))
705+
(prog1 (list (or (cdr (assoc halfsexp smie-grammar))
706+
(when (string-match "\\`\\s(\\|\\s)\\(\\)\\'"
707+
halfsexp)
708+
(if (match-end 1) '(0 nil) '(nil 0)))
709+
(error "Unknown token: %S" halfsexp)))
706710
(setq halfsexp nil)))))
707711
(while
708712
(let* ((pos (point))

0 commit comments

Comments
 (0)