summaryrefslogtreecommitdiff
path: root/misc/ruby-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'misc/ruby-mode.el')
-rw-r--r--misc/ruby-mode.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 77371cf30f..b1abd18a9e 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -107,7 +107,7 @@
(defconst ruby-block-end-re "\\_<end\\_>")
(defconst ruby-here-doc-beg-re
- "\\(<\\)<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)")
+ "\\(<\\)<\\([-~]\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)")
(defconst ruby-here-doc-end-re
"^\\([ \t]+\\)?\\(.*\\)\\(.\\)$")
@@ -127,9 +127,9 @@
(concat "<<"
(let ((match (match-string 1)))
(if (and match (> (length match) 0))
- (concat "\\(?:-\\([\"']?\\)\\|\\([\"']\\)" (match-string 1) "\\)"
+ (concat "\\(?:[-~]\\([\"']?\\)\\|\\([\"']\\)" (match-string 1) "\\)"
contents "\\(\\1\\|\\2\\)")
- (concat "-?\\([\"']\\|\\)" contents "\\1"))))))
+ (concat "[-~]?\\([\"']\\|\\)" contents "\\1"))))))
(defconst ruby-delimiter
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\_<\\("
@@ -679,7 +679,7 @@ Emacs to Ruby."
((looking-at "<<")
(cond
((and (ruby-expr-beg 'heredoc)
- (looking-at "<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\\sw\\|\\s_\\)+\\)"))
+ (looking-at "<<\\([-~]\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\\sw\\|\\s_\\)+\\)"))
(setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re)))
(let* ((id-end (goto-char (match-end 0)))