Skip to content

Commit 69a7d01

Browse files
committed
* 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
1 parent 333eb83 commit 69a7d01

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Fri Jan 24 05:12:55 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
2+
3+
* misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): deal
4+
with escaped $ and ? at the end of strings. [ruby-talk:62297]
5+
6+
* misc/ruby-mode.el (ruby-font-lock-keywords): added defined?.
7+
18
Thu Jan 23 17:25:04 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
29

310
* eval.c (rb_eval): do not warn discarding already undefined

misc/ruby-mode.el

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -788,24 +788,14 @@ An end of a defun is found by moving forward from the beginning of one."
788788
'(
789789
;; #{ }, #$hoge, #@foo are not comments
790790
("\\(#\\)[{$@]" 1 (1 . nil))
791-
;; the last $' in the string ,'...$' is not variable
792-
;; the last ?' in the string ,'...?' is not ascii code
793-
("\\(^\\|[[ \t\n<+(,=]\\)\\('\\)[^'\n\\\\]*\\(\\\\.[^'\n\\\\]*\\)*[?$]\\('\\)"
794-
(2 (7 . nil))
795-
(4 (7 . nil)))
796-
;; the last $` in the string ,`...$` is not variable
797-
;; the last ?` in the string ,`...?` is not ascii code
798-
("\\(^\\|[[ \t\n<+(,=]\\)\\(`\\)[^`\n\\\\]*\\(\\\\.[^`\n\\\\]*\\)*[?$]\\(`\\)"
799-
(2 (7 . nil))
800-
(4 (7 . nil)))
801-
;; the last $" in the string ,"...$" is not variable
802-
;; the last ?" in the string ,"...?" is not ascii code
803-
("\\(^\\|[[ \t\n<+(,=]\\)\\(\"\\)[^\"\n\\\\]*\\(\\\\.[^\"\n\\\\]*\\)*[?$]\\(\"\\)"
791+
;; the last $', $", $` in the respective string is not variable
792+
;; the last ?', ?", ?` in the respective string is not ascii code
793+
("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*\\\\?[?$]\\(\\2\\)"
804794
(2 (7 . nil))
805795
(4 (7 . nil)))
806796
;; $' $" $` .... are variables
807797
;; ?' ?" ?` are ascii codes
808-
("[?$][#\"'`]" 0 (1 . nil))
798+
("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil))
809799
;; regexps
810800
("\\(^\\|[=(,~?:;]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
811801
(4 (7 . ?/))
@@ -874,7 +864,7 @@ An end of a defun is found by moving forward from the beginning of one."
874864
1 font-lock-function-name-face)
875865
;; keywords
876866
(cons (concat
877-
"\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\("
867+
"\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(defined\\?\\|\\("
878868
(mapconcat
879869
'identity
880870
'("alias"
@@ -914,7 +904,7 @@ An end of a defun is found by moving forward from the beginning of one."
914904
"yield"
915905
)
916906
"\\|")
917-
"\\)\\>")
907+
"\\)\\>\\)")
918908
2)
919909
;; variables
920910
'("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\>"

0 commit comments

Comments
 (0)