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.
This commit is contained in:
@@ -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 \"=\".")
|
||||
|
||||
@@ -533,6 +533,8 @@ class Bar
|
||||
baz,
|
||||
bar
|
||||
)
|
||||
hello
|
||||
def baz.full_name = "#{bar} 3"
|
||||
|
||||
baz
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user