Commit 8de64bb8 authored by Dmitry Gutov's avatar Dmitry Gutov

* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight

special globals with font-lock-builtin-face.

Fixes: debbugs:17057
parent 42ebc34e
2014-03-27 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
special globals with font-lock-builtin-face. (Bug#17057)
* progmodes/ruby-mode.el (ruby-syntax-propertize-function):
Don't propertize `?' or `!' as symbol constituent when after
colon. (Bug#17097)
......
......@@ -2109,13 +2109,28 @@ See `font-lock-syntax-table'.")
1 font-lock-variable-name-face)
;; Keywords that evaluate to certain values.
("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>"
(0 font-lock-variable-name-face))
(0 font-lock-builtin-face))
;; Symbols.
("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
2 font-lock-constant-face)
;; Variables.
("\\$[^a-zA-Z \n]"
0 font-lock-variable-name-face)
;; Special globals.
(,(concat "\\$\\(?:[:\"!@;,/\\._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|"
(regexp-opt '("LOAD_PATH" "LOADED_FEATURES" "PROGRAM_NAME"
"ERROR_INFO" "ERROR_POSITION"
"FS" "FIELD_SEPARATOR"
"OFS" "OUTPUT_FIELD_SEPARATOR"
"RS" "INPUT_RECORD_SEPARATOR"
"ORS" "OUTPUT_RECORD_SEPARATOR"
"NR" "INPUT_LINE_NUMBER"
"LAST_READ_LINE" "DEFAULT_OUTPUT" "DEFAULT_INPUT"
"PID" "PROCESS_ID" "CHILD_STATUS"
"LAST_MATCH_INFO" "IGNORECASE"
"ARGV" "MATCH" "PREMATCH" "POSTMATCH"
"LAST_PAREN_MATCH" "stdin" "stdout" "stderr"
"DEBUG" "FILENAME" "VERBOSE" "SAFE" "CLASSPATH"
"JRUBY_VERSION" "JRUBY_REVISION" "ENV_JAVA"))
"\\_>\\)")
0 font-lock-builtin-face)
("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+"
0 font-lock-variable-name-face)
;; Constants.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment