diff --git a/ChangeLog b/ChangeLog index 865ea8e301..c96c968864 100644 --- a/ChangeLog +++ b/ChangeLog @@ -70,6 +70,13 @@ Tue Feb 19 13:16:08 2002 Nobuyoshi Nakada * io.c (rb_io_ungetc): don't fail pushed EOF back. +Mon Feb 18 14:23:10 2002 Nobuyoshi Nakada + + * 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 '_'. + Mon Feb 18 13:56:44 2002 Yukihiro Matsumoto * eval.c (block_pass): "&nil" should clear block given. 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."))