7
|
1 " Vim syntax file
|
831
|
2 " Language: Ruby
|
|
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
4 " Info: $Id$
|
|
5 " URL: http://vim-ruby.rubyforge.org
|
|
6 " Anon CVS: See above site
|
|
7 " Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
529
|
8 " ----------------------------------------------------------------------------
|
|
9 "
|
7
|
10 " Previous Maintainer: Mirko Nasato
|
|
11 " Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN)
|
529
|
12 " ----------------------------------------------------------------------------
|
7
|
13
|
|
14 " For version 5.x: Clear all syntax items
|
|
15 " For version 6.x: Quit when a syntax file was already loaded
|
|
16 if version < 600
|
|
17 syntax clear
|
|
18 elseif exists("b:current_syntax")
|
|
19 finish
|
|
20 endif
|
|
21
|
529
|
22 if has("folding") && exists("ruby_fold")
|
|
23 setlocal foldmethod=syntax
|
|
24 endif
|
7
|
25
|
529
|
26 if exists("ruby_space_errors")
|
|
27 if !exists("ruby_no_trail_space_error")
|
|
28 syn match rubySpaceError display excludenl "\s\+$"
|
|
29 endif
|
|
30 if !exists("ruby_no_tab_space_error")
|
|
31 syn match rubySpaceError display " \+\t"me=e-1
|
|
32 endif
|
7
|
33 endif
|
|
34
|
529
|
35 " Expression Substitution and Backslash Notation
|
|
36 syn match rubyEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display
|
|
37 syn match rubyEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display
|
|
38 syn match rubyInterpolation "#{[^}]*}" contained
|
|
39 syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" contained display
|
|
40 syn match rubyNoInterpolation "\\#{[^}]*}" contained
|
|
41 syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" contained display
|
|
42
|
|
43 syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE
|
|
44
|
|
45 syn region rubyNestedParentheses start="(" end=")" skip="\\\\\|\\)" transparent contained contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape
|
|
46 syn region rubyNestedCurlyBraces start="{" end="}" skip="\\\\\|\\}" transparent contained contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape
|
|
47 syn region rubyNestedAngleBrackets start="<" end=">" skip="\\\\\|\\>" transparent contained contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape
|
|
48 syn region rubyNestedSquareBrackets start="\[" end="\]" skip="\\\\\|\\\]" transparent contained contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape
|
|
49
|
|
50 syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyEscape
|
|
51 syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets
|
|
52
|
|
53 " Numbers and ASCII Codes
|
|
54 syn match rubyASCIICode "\w\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
|
|
55 syn match rubyInteger "\<0[xX]\x\+\%(_\x\+\)*\>" display
|
|
56 syn match rubyInteger "\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display
|
|
57 syn match rubyInteger "\<0[oO]\=\o\+\%(_\o\+\)*\>" display
|
|
58 syn match rubyInteger "\<0[bB][01]\+\%(_[01]\+\)*\>" display
|
|
59 syn match rubyFloat "\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*\>" display
|
|
60 syn match rubyFloat "\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>" display
|
7
|
61
|
529
|
62 " Identifiers
|
|
63 syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
|
|
64 syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
|
|
65
|
|
66 syn match rubyConstant "\%(\%(\.\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\>\%(\s*(\)\@!"
|
|
67 syn match rubyClassVariable "@@\h\w*" display
|
|
68 syn match rubyInstanceVariable "@\h\w*" display
|
|
69 syn match rubyGlobalVariable "$\%(\h\w*\|-.\)"
|
|
70 syn match rubySymbol ":\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)"
|
|
71 syn match rubySymbol ":\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)"
|
|
72 syn match rubySymbol ":\@<!:\%(\$\|@@\=\)\=\h\w*[?!=]\="
|
|
73 syn region rubySymbol start=":\@<!:\"" end="\"" skip="\\\\\|\\\""
|
|
74 syn match rubyBlockParameter "\%(\%(\<do\>\|{\)\s*\)\@<=|\s*\zs[( ,a-zA-Z0-9_*)]\+\ze\s*|" display
|
7
|
75
|
529
|
76 syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~1-9]#
|
532
|
77 syn match rubyPredefinedVariable "$_\>" display
|
|
78 syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display
|
|
79 syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display
|
|
80 syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display
|
529
|
81 syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>\%(\s*(\)\@!"
|
|
82 syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>\%(\s*(\)\@!"
|
|
83 syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!"
|
|
84 "Obsolete Global Constants
|
|
85 "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>"
|
|
86 "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>"
|
|
87
|
|
88 " Normal Regular Expression
|
548
|
89 syn region rubyString matchgroup=rubyStringDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\)\|[;\~=!|&(,[>]\)\s*\)\@<=/" end="/[iomx]*" skip="\\\\\|\\/" contains=@rubyStringSpecial
|
529
|
90 syn region rubyString matchgroup=rubyStringDelimiter start="\%(\<\%(split\|scan\|gsub\|sub\)\s*\)\@<=/" end="/[iomx]*" skip="\\\\\|\\/" contains=@rubyStringSpecial
|
7
|
91
|
|
92 " Normal String and Shell Command Output
|
529
|
93 syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial
|
548
|
94 syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'"
|
|
95 syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial
|
529
|
96
|
|
97 " Generalized Regular Expression
|
|
98 syn region rubyString matchgroup=rubyStringDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomx]*" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
|
99 syn region rubyString matchgroup=rubyStringDelimiter start="%r{" end="}[iomx]*" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
|
100 syn region rubyString matchgroup=rubyStringDelimiter start="%r<" end=">[iomx]*" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
|
101 syn region rubyString matchgroup=rubyStringDelimiter start="%r\[" end="\][iomx]*" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
|
102 syn region rubyString matchgroup=rubyStringDelimiter start="%r(" end=")[iomx]*" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
7
|
103
|
529
|
104 " Generalized Single Quoted String, Symbol and Array of Strings
|
|
105 syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
|
106 syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
|
107 syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
|
108 syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
|
109 syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
|
110
|
|
111 " Generalized Double Quoted String and Array of Strings and Shell Command Output
|
|
112 " Note: %= is not matched here as the beginning of a double quoted string
|
|
113 syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
|
114 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
|
115 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
|
116 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
|
117 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
|
118 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
7
|
119
|
|
120 " Here Document
|
529
|
121 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<-\=\zs\%(\h\w*\)+ end=+$+ oneline contains=TOP
|
|
122 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=TOP
|
|
123 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=TOP
|
|
124 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=TOP
|
7
|
125
|
529
|
126 syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<\z(\h\w*\)\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial nextgroup=rubyFunction fold keepend
|
|
127 syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<"\z([^"]*\)"\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial nextgroup=rubyFunction fold keepend
|
|
128 syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<'\z([^']*\)'\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart nextgroup=rubyFunction fold keepend
|
|
129 syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<`\z([^`]*\)`\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial nextgroup=rubyFunction fold keepend
|
|
130
|
|
131 syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<-\z(\h\w*\)\ze+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial nextgroup=rubyFunction fold keepend
|
|
132 syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<-"\z([^"]*\)"\ze+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial nextgroup=rubyFunction fold keepend
|
|
133 syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<-'\z([^']*\)'\ze+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart nextgroup=rubyFunction fold keepend
|
|
134 syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@<!<<-`\z([^`]*\)`\ze+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial nextgroup=rubyFunction fold keepend
|
|
135
|
|
136 if exists('main_syntax') && main_syntax == 'eruby'
|
548
|
137 let b:ruby_no_expensive = 1
|
529
|
138 end
|
7
|
139
|
|
140 " Expensive Mode - colorize *end* according to opening statement
|
548
|
141 if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
|
142 syn region rubyFunction matchgroup=rubyDefine start="\<def\s\+" end="\%(\s*\%(\s\|(\|;\|$\|#\)\)\@=" oneline
|
|
143 syn region rubyClass matchgroup=rubyDefine start="\<class\s\+" end="\%(\s*\%(\s\|<\|;\|$\|#\)\)\@=" oneline
|
529
|
144 syn match rubyDefine "\<class\ze<<"
|
548
|
145 syn region rubyModule matchgroup=rubyDefine start="\<module\s\+" end="\%(\s*\%(\s\|;\|$\|#\)\)\@=" oneline
|
7
|
146
|
548
|
147 syn region rubyBlock start="\<def\>" matchgroup=rubyDefine end="\<end\>" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo nextgroup=rubyFunction fold
|
|
148 syn region rubyBlock start="\<class\>" matchgroup=rubyDefine end="\<end\>" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo nextgroup=rubyClass fold
|
|
149 syn region rubyBlock start="\<module\>" matchgroup=rubyDefine end="\<end\>" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo nextgroup=rubyModule fold
|
7
|
150
|
529
|
151 " modifiers
|
|
152 syn match rubyControl "\<\%(if\|unless\|while\|until\)\>" display
|
7
|
153
|
|
154 " *do* requiring *end*
|
529
|
155 syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold
|
7
|
156
|
|
157 " *{* requiring *}*
|
529
|
158 syn region rubyCurlyBlock start="{" end="}" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold
|
7
|
159
|
|
160 " statements without *do*
|
529
|
161 syn region rubyNoDoBlock matchgroup=rubyControl start="\<\%(case\|begin\)\>" start="\%(^\|\.\.\.\=\|[,;=([<>~\*/%!&^|+-]\)\s*\zs\%(if\|unless\)\>" end="\<end\>" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold
|
7
|
162
|
|
163 " statement with optional *do*
|
532
|
164 syn region rubyOptDoLine matchgroup=rubyControl start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[?:,;=([<>~\*/%!&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" end="\%(\<do\>\|:\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo
|
|
165 syn region rubyOptDoBlock start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyControl end="\<end\>" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo nextgroup=rubyOptDoLine fold
|
7
|
166
|
|
167 if !exists("ruby_minlines")
|
|
168 let ruby_minlines = 50
|
|
169 endif
|
|
170 exec "syn sync minlines=" . ruby_minlines
|
|
171
|
529
|
172 else
|
|
173 syn region rubyFunction matchgroup=rubyControl start="\<def\s\+" end="\ze\%(\s\|(\|;\|$\)" oneline
|
|
174 syn region rubyClass matchgroup=rubyControl start="\<class\s\+" end="\ze\%(\s\|<\|;\|$\)" oneline
|
|
175 syn match rubyControl "\<class\ze<<"
|
548
|
176 syn region rubyModule matchgroup=rubyControl start="\<module\s\+" end="\ze\%(\s\|;\|$\)" oneline
|
7
|
177 syn keyword rubyControl case begin do for if unless while until end
|
529
|
178 endif
|
7
|
179
|
|
180 " Keywords
|
529
|
181 " Note: the following keywords have already been defined:
|
|
182 " begin case class def do end for if module unless until while
|
|
183 syn keyword rubyControl and break else elsif ensure in next not or redo rescue retry return then when
|
|
184 syn match rubyOperator "\<defined?" display
|
|
185 syn keyword rubyKeyword alias super undef yield
|
|
186 syn keyword rubyBoolean true false
|
|
187 syn keyword rubyPseudoVariable nil self __FILE__ __LINE__
|
|
188 syn keyword rubyBeginEnd BEGIN END
|
|
189
|
|
190 " Special Methods
|
|
191 if !exists("ruby_no_special_methods")
|
|
192 syn keyword rubyAccess public protected private
|
|
193 syn keyword rubyAttribute attr attr_accessor attr_reader attr_writer
|
532
|
194 syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>\)"
|
548
|
195 syn keyword rubyEval eval class_eval instance_eval module_eval
|
529
|
196 syn keyword rubyException raise fail catch throw
|
|
197 syn keyword rubyInclude autoload extend include load require
|
|
198 syn keyword rubyKeyword callcc caller lambda proc
|
|
199 endif
|
7
|
200
|
|
201 " Comments and Documentation
|
529
|
202 syn match rubySharpBang "\%^#!.*" display
|
548
|
203 syn keyword rubyTodo FIXME NOTE TODO XXX contained
|
529
|
204 syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
|
|
205 syn region rubyDocumentation start="^=begin" end="^=end.*$" contains=rubySpaceError,rubyTodo,@Spell fold
|
7
|
206
|
529
|
207 " Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
|
|
208 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>" transparent contains=NONE
|
|
209 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>" transparent contains=NONE
|
|
210 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>" transparent contains=NONE
|
|
211 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE
|
|
212
|
|
213 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE
|
|
214 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE
|
|
215 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE
|
|
216 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>" transparent contains=NONE
|
|
217 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(load\|loop\|private\|proc\|protected\)\>" transparent contains=NONE
|
|
218 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|raise\|throw\|trap\)\>" transparent contains=NONE
|
7
|
219
|
|
220 " __END__ Directive
|
529
|
221 syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold
|
7
|
222
|
|
223 " Define the default highlighting.
|
|
224 " For version 5.7 and earlier: only when not done already
|
|
225 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
226 if version >= 508 || !exists("did_ruby_syntax_inits")
|
|
227 if version < 508
|
|
228 let did_ruby_syntax_inits = 1
|
|
229 command -nargs=+ HiLink hi link <args>
|
|
230 else
|
|
231 command -nargs=+ HiLink hi def link <args>
|
|
232 endif
|
|
233
|
|
234 HiLink rubyDefine Define
|
|
235 HiLink rubyFunction Function
|
|
236 HiLink rubyControl Statement
|
|
237 HiLink rubyInclude Include
|
529
|
238 HiLink rubyInteger Number
|
|
239 HiLink rubyASCIICode rubyInteger
|
|
240 HiLink rubyFloat Float
|
|
241 HiLink rubyBoolean rubyPseudoVariable
|
7
|
242 HiLink rubyException Exception
|
529
|
243 HiLink rubyClass Type
|
|
244 HiLink rubyModule Type
|
|
245 if !exists("ruby_no_identifiers")
|
|
246 HiLink rubyIdentifier Identifier
|
|
247 else
|
|
248 HiLink rubyIdentifier NONE
|
|
249 endif
|
7
|
250 HiLink rubyClassVariable rubyIdentifier
|
|
251 HiLink rubyConstant rubyIdentifier
|
|
252 HiLink rubyGlobalVariable rubyIdentifier
|
529
|
253 HiLink rubyBlockParameter rubyIdentifier
|
7
|
254 HiLink rubyInstanceVariable rubyIdentifier
|
|
255 HiLink rubyPredefinedIdentifier rubyIdentifier
|
|
256 HiLink rubyPredefinedConstant rubyPredefinedIdentifier
|
|
257 HiLink rubyPredefinedVariable rubyPredefinedIdentifier
|
|
258 HiLink rubySymbol rubyIdentifier
|
|
259 HiLink rubyKeyword Keyword
|
529
|
260 HiLink rubyOperator Operator
|
7
|
261 HiLink rubyBeginEnd Statement
|
529
|
262 HiLink rubyAccess Statement
|
|
263 HiLink rubyAttribute Statement
|
|
264 HiLink rubyEval Statement
|
|
265 HiLink rubyPseudoVariable Constant
|
7
|
266
|
|
267 HiLink rubyComment Comment
|
|
268 HiLink rubyData Comment
|
|
269 HiLink rubyDataDirective Delimiter
|
529
|
270 HiLink rubyDocumentation Comment
|
|
271 HiLink rubyEscape Special
|
|
272 HiLink rubyInterpolation Special
|
|
273 HiLink rubyNoInterpolation rubyString
|
|
274 HiLink rubySharpBang PreProc
|
|
275 HiLink rubyStringDelimiter Delimiter
|
|
276 HiLink rubyString String
|
|
277 HiLink rubyTodo Todo
|
|
278
|
|
279 HiLink rubyError Error
|
|
280 HiLink rubySpaceError rubyError
|
7
|
281
|
|
282 delcommand HiLink
|
|
283 endif
|
|
284
|
|
285 let b:current_syntax = "ruby"
|
|
286
|
529
|
287 " vim: nowrap sw=2 sts=2 ts=8 ff=unix:
|