ruby-smie-rules: Avoid one case of infinite recursion

* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Avoid one case of infinite recursion (bug#29107).
This commit is contained in:
Dmitry Gutov 2021-01-02 04:18:59 +02:00
parent 1c5208ba71
commit 0f561ee553

View file

@ -598,7 +598,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
(`(:before . ,(or "(" "[" "{"))
(cond
((and (equal token "{")
(not (smie-rule-prev-p "(" "{" "[" "," "=>" "=" "return" ";"))
(not (smie-rule-prev-p "(" "{" "[" "," "=>" "=" "return" ";" "do"))
(save-excursion
(forward-comment -1)
(not (eq (preceding-char) ?:))))