diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-22 11:24:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-22 11:24:27 +0000 |
commit | e4b4f5746a7292068ce8720f5602b8f175d006ba (patch) | |
tree | 15d9000371cff958481771c325917d6077343a7c /misc | |
parent | 66bace5efee692c50bf5eb00a97dad93e67f6d68 (diff) | |
download | ruby-e4b4f5746a7292068ce8720f5602b8f175d006ba.tar.gz |
* misc/ruby-mode.el (ruby-modifier-re): add rescue modifier.
* misc/ruby-mode.el (ruby-font-lock-keywords): fontify
instance/class/global variables start with '_'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r-- | misc/ruby-mode.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 6f36a6bb9a..4e1db4a956 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -25,10 +25,14 @@ "\\(\\s *\\(class\\|module\\|def\\)\\)\\|if\\|unless\\|case\\|while\\|until\\|for\\|begin" ) -(defconst ruby-modifier-re +(defconst ruby-modifier-beg-re "if\\|unless\\|while\\|until" ) +(defconst ruby-modifier-re + (concat ruby-modifier-beg-re "\\|rescue") + ) + (defconst ruby-block-mid-re "then\\|else\\|elsif\\|when\\|rescue\\|ensure" ) @@ -38,7 +42,7 @@ ) (defconst ruby-block-hanging-re - (concat ruby-modifier-re "\\|" ruby-block-op-re) + (concat ruby-modifier-beg-re "\\|" ruby-block-op-re) ) (defconst ruby-block-end-re "end") @@ -814,7 +818,7 @@ An end of a defun is found by moving forward from the beginning of one." ;; variables '("\\(\\$\\([^a-zA-Z0-9 \n]\\|[0-9]\\)\\)\\W" 1 font-lock-variable-name-face) - '("\\(\\$\\|@\\|@@\\)\\(\\w\\(\\w\\|_\\)*\\|#{\\)" + '("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" 0 font-lock-variable-name-face) ;; embedded document '(ruby-font-lock-docs @@ -831,7 +835,7 @@ An end of a defun is found by moving forward from the beginning of one." '("\\(^\\|[^:]\\)\\(:\\([-+/%&|^~`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|\\[\\]\\|\\(\\w\\|_\\)+\\([!?=]\\|\\b\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" 2 font-lock-reference-face) ;; expression expansion - '("#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}" + '("#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)" 0 font-lock-variable-name-face t)) "*Additional expressions to highlight in ruby mode.")) |