diff options
| author | Stefan Monnier | 2019-11-21 18:24:37 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2019-11-21 18:25:00 -0500 |
| commit | c5de861af1da697b4481133e4f5f966e6a3fc859 (patch) | |
| tree | 3129e7b7850b40dedc468af58b9d6ea49dabf540 | |
| parent | 04208780262faaee772c96567069ceb9184c864f (diff) | |
| download | emacs-c5de861af1da697b4481133e4f5f966e6a3fc859.tar.gz emacs-c5de861af1da697b4481133e4f5f966e6a3fc859.zip | |
* 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.
| -rw-r--r-- | lisp/emacs-lisp/smie.el | 6 |
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: | |||
| 702 | (catch 'return | 702 | (catch 'return |
| 703 | (let ((levels | 703 | (let ((levels |
| 704 | (if (stringp halfsexp) | 704 | (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))) | ||
| 706 | (setq halfsexp nil))))) | 710 | (setq halfsexp nil))))) |
| 707 | (while | 711 | (while |
| 708 | (let* ((pos (point)) | 712 | (let* ((pos (point)) |