* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
special globals with font-lock-builtin-face. Fixes: debbugs:17057
This commit is contained in:
parent
42ebc34ea8
commit
8de64bb862
2 changed files with 22 additions and 4 deletions
|
@ -1,5 +1,8 @@
|
|||
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.
|
||||
|
|
Loading…
Add table
Reference in a new issue