[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 9a751e0a38: ruby-mode: Support endless singleton method definit
From: |
Dmitry Gutov |
Subject: |
emacs-29 9a751e0a38: ruby-mode: Support endless singleton method definitions too |
Date: |
Sun, 18 Dec 2022 19:23:13 -0500 (EST) |
branch: emacs-29
commit 9a751e0a38bb53c269efa034d089aaab821c2662
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
ruby-mode: Support endless singleton method definitions too
* lisp/progmodes/ruby-mode.el (ruby-endless-method-head-re):
Update to match not only 'self.' but 'xyz.' as well (bug#54702).
* test/lisp/progmodes/ruby-mode-resources/ruby.rb (Bar#foo=):
Update example.
---
lisp/progmodes/ruby-mode.el | 3 ++-
test/lisp/progmodes/ruby-mode-resources/ruby.rb | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index ed6044280e..fa51597697 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -135,7 +135,8 @@ This should only be called after matching against
`ruby-here-doc-beg-re'."
"Regexp to match symbols.")
(defconst ruby-endless-method-head-re
- (format " *\\(self\\.\\)?%s+[?!]? *\\(([^()]*)\\)? +=" ruby-symbol-re)
+ (format " *\\(%s+\\.\\)?%s+[?!]? *\\(([^()]*)\\)? +="
+ ruby-symbol-re ruby-symbol-re)
"Regexp to match the beginning of an endless method definition.
It should match the part after \"def\" and until \"=\".")
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb
b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
index 5636a4fc0e..2451edaee2 100644
--- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
@@ -533,6 +533,8 @@ class Bar
baz,
bar
)
- hello
+ def baz.full_name = "#{bar} 3"
+
+ baz
end
end
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 9a751e0a38: ruby-mode: Support endless singleton method definitions too,
Dmitry Gutov <=