emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 6a9399f: Support squiggly heredocs in ruby-mode


From: Dmitry Gutov
Subject: [Emacs-diffs] emacs-25 6a9399f: Support squiggly heredocs in ruby-mode
Date: Wed, 20 Jan 2016 21:29:06 +0000

branch: emacs-25
commit 6a9399f7fd3ea6f4eaa0c6ceee92308553fadd39
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Support squiggly heredocs in ruby-mode
    
    * lisp/progmodes/ruby-mode.el (ruby-here-doc-beg-re):
    Support squiggly heredocs added in Ruby 2.3.
    
    * test/indent/ruby.rb: Add squiggly example.
---
 lisp/progmodes/ruby-mode.el |    2 +-
 test/indent/ruby.rb         |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 53f8a6b..e3fe315 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -102,7 +102,7 @@
 
 (eval-and-compile
   (defconst ruby-here-doc-beg-re
-  
"\\(<\\)<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)"
+  
"\\(<\\)<\\([~-]\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)"
   "Regexp to match the beginning of a heredoc.")
 
   (defconst ruby-expression-expansion-re
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index dec6de9..dfd1c75 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -4,6 +4,10 @@ if something_wrong?             # 
ruby-move-to-block-skips-heredoc
   end
   eowarn
   foo
+
+  foo(<<~squiggly)
+  end
+  squiggly
 end
 
 def foo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]