aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index e3fe315f3bd..fb942b34ddc 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -32,7 +32,7 @@
32;; file after putting it on your load path: 32;; file after putting it on your load path:
33;; 33;;
34;; (autoload 'ruby-mode "ruby-mode" "Major mode for ruby files" t) 34;; (autoload 'ruby-mode "ruby-mode" "Major mode for ruby files" t)
35;; (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode)) 35;; (add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
36;; (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) 36;; (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
37;; 37;;
38;; Still needs more docstrings; search below for TODO. 38;; Still needs more docstrings; search below for TODO.
@@ -188,9 +188,10 @@ This should only be called after matching against `ruby-here-doc-beg-re'."
188 (modify-syntax-entry ?# "<" table) 188 (modify-syntax-entry ?# "<" table)
189 (modify-syntax-entry ?\n ">" table) 189 (modify-syntax-entry ?\n ">" table)
190 (modify-syntax-entry ?\\ "\\" table) 190 (modify-syntax-entry ?\\ "\\" table)
191 (modify-syntax-entry ?$ "." table) 191 (modify-syntax-entry ?$ "'" table)
192 (modify-syntax-entry ?_ "_" table) 192 (modify-syntax-entry ?_ "_" table)
193 (modify-syntax-entry ?: "_" table) 193 (modify-syntax-entry ?: "'" table)
194 (modify-syntax-entry ?@ "'" table)
194 (modify-syntax-entry ?< "." table) 195 (modify-syntax-entry ?< "." table)
195 (modify-syntax-entry ?> "." table) 196 (modify-syntax-entry ?> "." table)
196 (modify-syntax-entry ?& "." table) 197 (modify-syntax-entry ?& "." table)
@@ -1858,6 +1859,10 @@ It will be properly highlighted even when the call omits parens.")
1858 (string-to-syntax "_")))) 1859 (string-to-syntax "_"))))
1859 ;; Backtick method redefinition. 1860 ;; Backtick method redefinition.
1860 ("^[ \t]*def +\\(`\\)" (1 "_")) 1861 ("^[ \t]*def +\\(`\\)" (1 "_"))
1862 ;; Ternary operator colon followed by opening paren or bracket
1863 ;; (semi-important for indentation).
1864 ("\\(:\\)\\(?:[\({]\\|\\[[^]]\\)"
1865 (1 (string-to-syntax ".")))
1861 ;; Regular expressions. Start with matching unescaped slash. 1866 ;; Regular expressions. Start with matching unescaped slash.
1862 ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)" 1867 ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)"
1863 (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) 1868 (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1)))))
@@ -2023,7 +2028,7 @@ It will be properly highlighted even when the call omits parens.")
2023 "The syntax table to use for fontifying Ruby mode buffers. 2028 "The syntax table to use for fontifying Ruby mode buffers.
2024See `font-lock-syntax-table'.") 2029See `font-lock-syntax-table'.")
2025 2030
2026(defconst ruby-font-lock-keyword-beg-re "\\(?:^\\|[^.@$]\\|\\.\\.\\)") 2031(defconst ruby-font-lock-keyword-beg-re "\\(?:^\\|[^.@$:]\\|\\.\\.\\)")
2027 2032
2028(defconst ruby-font-lock-keywords 2033(defconst ruby-font-lock-keywords
2029 `(;; Functions. 2034 `(;; Functions.
@@ -2196,7 +2201,7 @@ See `font-lock-syntax-table'.")
2196 ("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" 2201 ("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+"
2197 0 font-lock-variable-name-face) 2202 0 font-lock-variable-name-face)
2198 ;; Constants. 2203 ;; Constants.
2199 ("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)" 2204 ("\\_<\\([A-Z]+\\(\\w\\|_\\)*\\)"
2200 1 (unless (eq ?\( (char-after)) font-lock-type-face)) 2205 1 (unless (eq ?\( (char-after)) font-lock-type-face))
2201 ;; Ruby 1.9-style symbol hash keys. 2206 ;; Ruby 1.9-style symbol hash keys.
2202 ("\\(?:^\\s *\\|[[{(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+:\\)[^:]" 2207 ("\\(?:^\\s *\\|[[{(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+:\\)[^:]"