summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-08-06 03:05:23 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-08-06 03:05:23 +0000
commitf33a61c28dadf8ff2bb86d36d6428f487b671708 (patch)
tree6794731dfe7e2d526808376060893846f2ddc6c2 /misc
parent439b453e3aa244e7b824a55aa11768dca3d4a6f4 (diff)
* string.c (rb_str_lstrip_bang): new method.
* string.c (rb_str_rstrip_bang): new method. * string.c (rb_str_associate): should consider STR_ASSOC too. * eval.c (rb_undefined): do not recurse if method_missing is undefined. * process.c (proc_waitpid): now all arguments are optional. * process.c (Init_process): waitpid is now alias to wait. * process.c (Init_process): waitpid2 is now alias to wait2. * process.c (rb_waitpid): made public. * ext/pty/pty.c (pty_getpty): avoid disturbing SIGCHLD using thread and rb_waitpid. * process.c (proc_getpgrp): now takes no argument on all platforms. * process.c (proc_setpgrp): ditto. * ext/socket/socket.c (sock_s_pack_sockaddr_in): added Socket::pack_sockaddr_in(). [new] * ext/socket/socket.c (sock_s_pack_sockaddr_un): added Socket::pack_sockaddr_un(). [new] * ext/socket/socket.c (sock_s_pack_sockaddr_in): added Socket::unpack_sockaddr_in(). [new] * ext/socket/socket.c (sock_s_pack_sockaddr_un): added Socket::unpack_sockaddr_un(). [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r--misc/ruby-mode.el45
1 files changed, 37 insertions, 8 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index d29e3bd82c..40f1eaa045 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -707,6 +707,9 @@ An end of a defun is found by moving forward from the beginning of one."
(defvar ruby-font-lock-keywords
(list
+ ;; trick
+ '("\\s-+" 0 nil t)
+ '("\\S-+" 0 nil t)
(cons (concat
"\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\("
(mapconcat
@@ -750,16 +753,14 @@ An end of a defun is found by moving forward from the beginning of one."
"\\|")
"\\)\\>\\([^_]\\|$\\)")
2)
- ;; regexps
- '("/\\(\\(\\\\/\\|[^/\n]\\)*\\)/\\([iop]*\\)"
- (1 font-lock-string-face)
- (3 font-lock-constant-face))
;; variables
'("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\b\\([^_]\\|$\\)"
2 font-lock-variable-name-face)
;; variables
- '("[$@].\\(\\w\\|_\\)*"
- 0 font-lock-variable-name-face)
+ '("\\(\\$\\(\\W\\|[0-9]\\)\\)\\W"
+ 1 font-lock-variable-name-face t)
+ '("\\($\\|@\\|@@\\)\\(\\w\\(\\w\\|_\\)*\\|#{\\)"
+ 0 font-lock-variable-name-face t)
;; embedded document
'(ruby-font-lock-docs
0 font-lock-comment-face t)
@@ -772,8 +773,36 @@ An end of a defun is found by moving forward from the beginning of one."
'("^\\s *def\\s +\\([^( ]+\\)"
1 font-lock-function-name-face)
;; symbols
- '("\\(^\\|[^:]\\)\\(:\\([-+/%&|^~`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|\\[\\]\\|\\(\\w\\|_\\)+\\([!?=]\\|\\b\\)\\)\\)"
- 2 font-lock-reference-face))
+ '("\\(^\\|[^:]\\)\\(:\\([-+/%&|^~`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|\\[\\]\\|\\(\\w\\|_\\)+\\([!?=]\\|\\b\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
+ 2 font-lock-reference-face)
+ ;; strings
+ ;; %Q! !
+ '("[[\\s <+(,]%[rqQ]?\\(\\([^a-zA-Z0-9 \n]\\)[^\\2\n\\\\]*\\(\\\\.[^\\2\n\\\\]*\\)*\\2\\)"
+ 1 font-lock-string-face t)
+ ;; '...'
+ '("[[\\s <+(,]\\('[^'\n\\\\]*\\(\\\\.[^'\n\\\\]*\\)*'\\)"
+ 1 font-lock-string-face t)
+ ;; "..."
+ '("[[\\s <+(,]\\(\"[^\"\n\\\\]*\\(\\\\.[^\"\n\\\\]*\\)*\"\\)"
+ 1 font-lock-string-face t)
+ ;; `...`
+ '("[\\s <+(,]\\(`[^`\n\\\\]*\\(\\\\.[^`\n\\\\]*\\)*`\\)"
+ 1 font-lock-warning-face t)
+ ;; %x!...!
+ '("[\\s <+(,]%x\\(\\([^a-zA-Z0-9 \n]\\)[^\\2\n\\]*\\(\\\\.[^\\2\n\\]*\\)*\\2\\)"
+ 1 font-lock-warning-face t)
+ ;; regexps
+ '("\\(^\\|[=(,~?:]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|\\.g?sub!?\\)\\s *\\(/[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*/\\([iop]*\\)\\)"
+ (4 font-lock-string-face t)
+ (6 font-lock-constant-face t))
+ '("\\(/[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*/\\)\\s *[=!][=~]"
+ 1 font-lock-string-face t)
+ ;; expression expansion
+ '("#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}"
+ 0 font-lock-variable-name-face t)
+ ;; comment
+ '("^\\s *\\([^#\n'\"%/]\\|'[^'\n\\]*\\(\\\\.[^'\n\\]*\\)*'\\|\"[^\"\n\\]*\\(\\\\.[^\"\n\\]*\\)*\"\\|%[rqQx]?\\([^a-zA-Z0-9 \n]\\)[^\\4\n\\]*\\(\\\\.[^\\4\n\\]*\\)*\\4\\|/[^/\n\\]*\\(\\\\.[^/\n\\]\\)*/\\|#{[^}\\\\]*\\(\\\\.[^}\\\\]*\\)*}\\)*\\(#\\([^{\n].*\\|$\\)\\)"
+ 8 font-lock-comment-face t))
"*Additional expressions to highlight in ruby mode."))
((featurep 'hilit19)