summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-23 20:12:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-23 20:12:59 +0000
commit69a7d012c406fd47c2416a87da33c7e6b7df81df (patch)
treea43c77c8a263d594ca0b59b4dad340a134c13e6c /misc
parent333eb8380f00d50c3a1d4d86ada9cc4c879a4053 (diff)
* misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): deal
with escaped $ and ? at the end of strings. [ruby-talk:62297] * misc/ruby-mode.el (ruby-font-lock-keywords): added defined?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r--misc/ruby-mode.el22
1 files changed, 6 insertions, 16 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index e2eff3ea1f..4fe33eebbf 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -788,24 +788,14 @@ An end of a defun is found by moving forward from the beginning of one."
'(
;; #{ }, #$hoge, #@foo are not comments
("\\(#\\)[{$@]" 1 (1 . nil))
- ;; the last $' in the string ,'...$' is not variable
- ;; the last ?' in the string ,'...?' is not ascii code
- ("\\(^\\|[[ \t\n<+(,=]\\)\\('\\)[^'\n\\\\]*\\(\\\\.[^'\n\\\\]*\\)*[?$]\\('\\)"
- (2 (7 . nil))
- (4 (7 . nil)))
- ;; the last $` in the string ,`...$` is not variable
- ;; the last ?` in the string ,`...?` is not ascii code
- ("\\(^\\|[[ \t\n<+(,=]\\)\\(`\\)[^`\n\\\\]*\\(\\\\.[^`\n\\\\]*\\)*[?$]\\(`\\)"
- (2 (7 . nil))
- (4 (7 . nil)))
- ;; the last $" in the string ,"...$" is not variable
- ;; the last ?" in the string ,"...?" is not ascii code
- ("\\(^\\|[[ \t\n<+(,=]\\)\\(\"\\)[^\"\n\\\\]*\\(\\\\.[^\"\n\\\\]*\\)*[?$]\\(\"\\)"
+ ;; the last $', $", $` in the respective string is not variable
+ ;; the last ?', ?", ?` in the respective string is not ascii code
+ ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*\\\\?[?$]\\(\\2\\)"
(2 (7 . nil))
(4 (7 . nil)))
;; $' $" $` .... are variables
;; ?' ?" ?` are ascii codes
- ("[?$][#\"'`]" 0 (1 . nil))
+ ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil))
;; regexps
("\\(^\\|[=(,~?:;]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
(4 (7 . ?/))
@@ -874,7 +864,7 @@ An end of a defun is found by moving forward from the beginning of one."
1 font-lock-function-name-face)
;; keywords
(cons (concat
- "\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\("
+ "\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(defined\\?\\|\\("
(mapconcat
'identity
'("alias"
@@ -914,7 +904,7 @@ An end of a defun is found by moving forward from the beginning of one."
"yield"
)
"\\|")
- "\\)\\>")
+ "\\)\\>\\)")
2)
;; variables
'("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\>"