mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* 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
This commit is contained in:
parent
439b453e3a
commit
f33a61c28d
18 changed files with 336 additions and 248 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue