mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* misc/ruby-mode.el (ruby-here-doc-beg-re): underscore also is
valid delimiter. * misc/ruby-mode.el (ruby-here-doc-end-match): must quote arbitrary string to use as regexp. * misc/ruby-mode.el (ruby-font-lock-maybe-here-docs): must not call `ruby-here-doc-end-match' unless `ruby-here-doc-beg-re' matched. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
af5a9fd8c2
commit
0b9b7d630a
2 changed files with 26 additions and 18 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
Thu Sep 4 17:41:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-here-doc-beg-re): underscore also is
|
||||||
|
valid delimiter.
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-here-doc-end-match): must quote
|
||||||
|
arbitrary string to use as regexp.
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-font-lock-maybe-here-docs): must not
|
||||||
|
call `ruby-here-doc-end-match' unless `ruby-here-doc-beg-re'
|
||||||
|
matched.
|
||||||
|
|
||||||
Wed Sep 4 15:40:07 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
Wed Sep 4 15:40:07 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||||
|
|
||||||
* test/csv/test_csv.rb: run on test/unit original layer.
|
* test/csv/test_csv.rb: run on test/unit original layer.
|
||||||
|
|
|
@ -48,19 +48,15 @@
|
||||||
(defconst ruby-block-end-re "end")
|
(defconst ruby-block-end-re "end")
|
||||||
|
|
||||||
(defconst ruby-here-doc-beg-re
|
(defconst ruby-here-doc-beg-re
|
||||||
(concat "<<\\([-]\\)?\\([a-zA-Z0-9]+\\)\\|"
|
"<<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)")
|
||||||
"<<\\([-]\\)?[\"]\\([^\"]+\\)[\"]\\|"
|
|
||||||
"<<\\([-]\\)?[']\\([^']+\\)[']"))
|
|
||||||
|
|
||||||
(defun ruby-here-doc-end-match ()
|
(defun ruby-here-doc-end-match ()
|
||||||
(concat "^"
|
(concat "^"
|
||||||
(if (or (match-string 1)
|
(if (match-string 1) "[ \t]*" nil)
|
||||||
(match-string 3)
|
(regexp-quote
|
||||||
(match-string 5))
|
(or (match-string 3)
|
||||||
"[ \t]*" nil)
|
|
||||||
(or (match-string 2)
|
|
||||||
(match-string 4)
|
(match-string 4)
|
||||||
(match-string 6))))
|
(match-string 5)))))
|
||||||
|
|
||||||
(defconst ruby-delimiter
|
(defconst ruby-delimiter
|
||||||
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("
|
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("
|
||||||
|
@ -1087,14 +1083,14 @@ balanced expression is found."
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(forward-line)
|
(forward-line)
|
||||||
(setq beg (point)))))
|
(setq beg (point)))))
|
||||||
(let ((end-match (ruby-here-doc-end-match)))
|
|
||||||
(if (and beg
|
(if (and beg
|
||||||
|
(let ((end-match (ruby-here-doc-end-match)))
|
||||||
(not (re-search-backward end-match beg t))
|
(not (re-search-backward end-match beg t))
|
||||||
(re-search-forward end-match nil t))
|
(re-search-forward end-match nil t)))
|
||||||
(progn
|
(progn
|
||||||
(set-match-data (list beg (point)))
|
(set-match-data (list beg (point)))
|
||||||
t)
|
t)
|
||||||
nil))))
|
nil)))
|
||||||
|
|
||||||
|
|
||||||
(defvar ruby-font-lock-keywords
|
(defvar ruby-font-lock-keywords
|
||||||
|
|
Loading…
Add table
Reference in a new issue