diff options
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index d1e42ca3443..f2fb95ce59a 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -1817,7 +1817,7 @@ It will be properly highlighted even when the call omits parens.") | |||
| 1817 | (defvar ruby-syntax-before-regexp-re | 1817 | (defvar ruby-syntax-before-regexp-re |
| 1818 | (concat | 1818 | (concat |
| 1819 | ;; Special tokens that can't be followed by a division operator. | 1819 | ;; Special tokens that can't be followed by a division operator. |
| 1820 | "\\(^\\|[[=(,~;<>]" | 1820 | "\\(^\\|[[{|=(,~;<>!]" |
| 1821 | ;; Distinguish ternary operator tokens. | 1821 | ;; Distinguish ternary operator tokens. |
| 1822 | ;; FIXME: They don't really have to be separated with spaces. | 1822 | ;; FIXME: They don't really have to be separated with spaces. |
| 1823 | "\\|[?:] " | 1823 | "\\|[?:] " |
| @@ -2053,8 +2053,9 @@ See `font-lock-syntax-table'.") | |||
| 2053 | "rescue" | 2053 | "rescue" |
| 2054 | "retry" | 2054 | "retry" |
| 2055 | "return" | 2055 | "return" |
| 2056 | "then" | 2056 | "self" |
| 2057 | "super" | 2057 | "super" |
| 2058 | "then" | ||
| 2058 | "unless" | 2059 | "unless" |
| 2059 | "undef" | 2060 | "undef" |
| 2060 | "until" | 2061 | "until" |
| @@ -2071,10 +2072,10 @@ See `font-lock-syntax-table'.") | |||
| 2071 | "at_exit" | 2072 | "at_exit" |
| 2072 | "autoload" | 2073 | "autoload" |
| 2073 | "autoload?" | 2074 | "autoload?" |
| 2075 | "callcc" | ||
| 2074 | "catch" | 2076 | "catch" |
| 2075 | "eval" | 2077 | "eval" |
| 2076 | "exec" | 2078 | "exec" |
| 2077 | "fork" | ||
| 2078 | "format" | 2079 | "format" |
| 2079 | "lambda" | 2080 | "lambda" |
| 2080 | "load" | 2081 | "load" |
| @@ -2092,7 +2093,10 @@ See `font-lock-syntax-table'.") | |||
| 2092 | "sprintf" | 2093 | "sprintf" |
| 2093 | "syscall" | 2094 | "syscall" |
| 2094 | "system" | 2095 | "system" |
| 2096 | "throw" | ||
| 2097 | "trace_var" | ||
| 2095 | "trap" | 2098 | "trap" |
| 2099 | "untrace_var" | ||
| 2096 | "warn" | 2100 | "warn" |
| 2097 | ;; keyword-like private methods on Module | 2101 | ;; keyword-like private methods on Module |
| 2098 | "alias_method" | 2102 | "alias_method" |
| @@ -2122,13 +2126,15 @@ See `font-lock-syntax-table'.") | |||
| 2122 | "__dir__" | 2126 | "__dir__" |
| 2123 | "__method__" | 2127 | "__method__" |
| 2124 | "abort" | 2128 | "abort" |
| 2125 | "at_exit" | ||
| 2126 | "binding" | 2129 | "binding" |
| 2127 | "block_given?" | 2130 | "block_given?" |
| 2128 | "caller" | 2131 | "caller" |
| 2129 | "exit" | 2132 | "exit" |
| 2130 | "exit!" | 2133 | "exit!" |
| 2131 | "fail" | 2134 | "fail" |
| 2135 | "fork" | ||
| 2136 | "global_variables" | ||
| 2137 | "local_variables" | ||
| 2132 | "private" | 2138 | "private" |
| 2133 | "protected" | 2139 | "protected" |
| 2134 | "public" | 2140 | "public" |
| @@ -2137,8 +2143,7 @@ See `font-lock-syntax-table'.") | |||
| 2137 | "readline" | 2143 | "readline" |
| 2138 | "readlines" | 2144 | "readlines" |
| 2139 | "sleep" | 2145 | "sleep" |
| 2140 | "srand" | 2146 | "srand") |
| 2141 | "throw") | ||
| 2142 | 'symbols)) | 2147 | 'symbols)) |
| 2143 | (1 font-lock-builtin-face)) | 2148 | (1 font-lock-builtin-face)) |
| 2144 | ;; Here-doc beginnings. | 2149 | ;; Here-doc beginnings. |
| @@ -2149,13 +2154,21 @@ See `font-lock-syntax-table'.") | |||
| 2149 | "\\_<\\(?:BEGIN\\|END\\)\\_>\\|^__END__$" | 2154 | "\\_<\\(?:BEGIN\\|END\\)\\_>\\|^__END__$" |
| 2150 | ;; Variables. | 2155 | ;; Variables. |
| 2151 | (,(concat ruby-font-lock-keyword-beg-re | 2156 | (,(concat ruby-font-lock-keyword-beg-re |
| 2152 | "\\_<\\(nil\\|self\\|true\\|false\\)\\_>") | 2157 | "\\_<\\(nil\\|true\\|false\\)\\_>") |
| 2153 | 1 font-lock-variable-name-face) | 2158 | 1 font-lock-constant-face) |
| 2154 | ;; Keywords that evaluate to certain values. | 2159 | ;; Keywords that evaluate to certain values. |
| 2155 | ("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>" | 2160 | ("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>" |
| 2156 | (0 font-lock-builtin-face)) | 2161 | (0 font-lock-builtin-face)) |
| 2157 | ;; Symbols. | 2162 | ;; Symbols with symbol characters. |
| 2158 | ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" | 2163 | ("\\(^\\|[^:]\\)\\(:@?\\(?:\\w\\|_\\)+\\)\\([!?=]\\)?" |
| 2164 | (2 font-lock-constant-face) | ||
| 2165 | (3 (unless (and (eq (char-before (match-end 3)) ?=) | ||
| 2166 | (eq (char-after (match-end 3)) ?>)) | ||
| 2167 | ;; bug#18466 | ||
| 2168 | font-lock-constant-face) | ||
| 2169 | nil t)) | ||
| 2170 | ;; Symbols with special characters. | ||
| 2171 | ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" | ||
| 2159 | 2 font-lock-constant-face) | 2172 | 2 font-lock-constant-face) |
| 2160 | ;; Special globals. | 2173 | ;; Special globals. |
| 2161 | (,(concat "\\$\\(?:[:\"!@;,/\\._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|" | 2174 | (,(concat "\\$\\(?:[:\"!@;,/\\._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|" |