Mercurial > hg > RemoteEditor > vim7
comparison runtime/syntax/ruby.vim @ 9:6a13985590e6
*** empty log message ***
author | axmo |
---|---|
date | Fri, 29 Aug 2008 15:41:29 +0900 |
parents | 76efa0be13f1 |
children | e170173ecb68 |
comparison
equal
deleted
inserted
replaced
8:f21b6f345e69 | 9:6a13985590e6 |
---|---|
17 | 17 |
18 if has("folding") && exists("ruby_fold") | 18 if has("folding") && exists("ruby_fold") |
19 setlocal foldmethod=syntax | 19 setlocal foldmethod=syntax |
20 endif | 20 endif |
21 | 21 |
22 syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyTodo | |
23 | |
22 if exists("ruby_space_errors") | 24 if exists("ruby_space_errors") |
23 if !exists("ruby_no_trail_space_error") | 25 if !exists("ruby_no_trail_space_error") |
24 syn match rubySpaceError display excludenl "\s\+$" | 26 syn match rubySpaceError display excludenl "\s\+$" |
25 endif | 27 endif |
26 if !exists("ruby_no_tab_space_error") | 28 if !exists("ruby_no_tab_space_error") |
30 | 32 |
31 " Operators | 33 " Operators |
32 if exists("ruby_operators") | 34 if exists("ruby_operators") |
33 syn match rubyOperator "\%([~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::\)" | 35 syn match rubyOperator "\%([~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::\)" |
34 syn match rubyPseudoOperator "\%(-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\)" | 36 syn match rubyPseudoOperator "\%(-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\)" |
35 syn region rubyBracketOperator matchgroup=rubyOperator start="\%([_[:lower:]]\w*[?!=]\=\|[})]\)\@<=\[\s*" end="\s*]" contains=TOP | 37 syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop |
36 endif | 38 endif |
37 | 39 |
38 " Expression Substitution and Backslash Notation | 40 " Expression Substitution and Backslash Notation |
39 syn match rubyEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display | 41 syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display |
40 syn match rubyEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display | 42 syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display |
41 | 43 |
42 syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=TOP | 44 syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop |
43 syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable | 45 syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable |
44 syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained | 46 syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained |
45 syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable | 47 syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable |
46 syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained | 48 syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained |
47 syn region rubyNoInterpolation start="\\#{" end="}" contained | 49 syn region rubyNoInterpolation start="\\#{" end="}" contained |
49 syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained | 51 syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained |
50 syn match rubyNoInterpolation "\\#\$\W" display contained | 52 syn match rubyNoInterpolation "\\#\$\W" display contained |
51 | 53 |
52 syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE | 54 syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE |
53 | 55 |
54 syn region rubyNestedParentheses start="(" end=")" skip="\\\\\|\\)" transparent contained contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape | 56 syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained |
55 syn region rubyNestedCurlyBraces start="{" end="}" skip="\\\\\|\\}" transparent contained contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape | 57 syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained |
56 syn region rubyNestedAngleBrackets start="<" end=">" skip="\\\\\|\\>" transparent contained contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape | 58 syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained |
57 if exists("ruby_operators") | 59 syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained |
58 syn region rubyNestedSquareBrackets start="\[" end="\]" skip="\\\\\|\\\]" transparent contained contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape | 60 |
59 else | 61 " These are mostly Oniguruma ready |
60 syn region rubyNestedSquareBrackets start="\[" end="\]" skip="\\\\\|\\\]" transparent containedin=rubyArrayLiteral contained contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape | 62 syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained |
61 endif | 63 syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial |
62 | 64 syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline |
63 syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyEscape | 65 syn match rubyRegexpCharClass "\\[DdHhSsWw]" contained display |
66 syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained | |
67 syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained display | |
68 syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display | |
69 syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display | |
70 syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display | |
71 syn match rubyRegexpDot "\." contained display | |
72 syn match rubyRegexpSpecial "|" contained display | |
73 syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display | |
74 syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display | |
75 syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display | |
76 syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display | |
77 syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display | |
78 | |
79 syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape | |
64 syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets | 80 syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets |
81 syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment | |
65 | 82 |
66 " Numbers and ASCII Codes | 83 " Numbers and ASCII Codes |
67 syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" | 84 syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" |
68 syn match rubyInteger "\<0[xX]\x\+\%(_\x\+\)*\>" display | 85 syn match rubyInteger "\<0[xX]\x\+\%(_\x\+\)*\>" display |
69 syn match rubyInteger "\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display | 86 syn match rubyInteger "\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display |
81 syn match rubyInstanceVariable "@\h\w*" display | 98 syn match rubyInstanceVariable "@\h\w*" display |
82 syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" | 99 syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" |
83 syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" | 100 syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" |
84 syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" | 101 syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" |
85 syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\h\w*" | 102 syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\h\w*" |
86 syn match rubySymbol "[]})\"':]\@<!:\h\w*[?!=]\=" | 103 syn match rubySymbol "[]})\"':]\@<!:\h\w*\%([?!=]>\@!\)\=" |
87 syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" | 104 syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" |
88 syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold | 105 syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold |
89 | 106 |
90 syn match rubyBlockParameter "\h\w*" contained | 107 syn match rubyBlockParameter "\h\w*" contained |
91 syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter | 108 syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter |
92 | 109 |
93 syn match rubyInvalidVariable "$[^ A-Za-z-]" | 110 syn match rubyInvalidVariable "$[^ A-Za-z_-]" |
94 syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~1-9]# | 111 syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~1-9]# |
95 syn match rubyPredefinedVariable "$_\>" display | 112 syn match rubyPredefinedVariable "$_\>" display |
96 syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display | 113 syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display |
97 syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display | 114 syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display |
98 syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display | 115 syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display |
102 "Obsolete Global Constants | 119 "Obsolete Global Constants |
103 "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" | 120 "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" |
104 "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>" | 121 "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>" |
105 | 122 |
106 " Normal Regular Expression | 123 " Normal Regular Expression |
107 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyStringSpecial fold | 124 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial keepend fold |
108 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\<\%(split\|scan\|gsub\|sub\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyStringSpecial fold | 125 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold |
126 | |
127 " Generalized Regular Expression | |
128 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold | |
129 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold | |
130 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold | |
131 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold | |
132 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold | |
109 | 133 |
110 " Normal String and Shell Command Output | 134 " Normal String and Shell Command Output |
111 syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold | 135 syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold |
112 syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" fold | 136 syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" fold |
113 syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold | 137 syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold |
114 | |
115 " Generalized Regular Expression | |
116 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold | |
117 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold | |
118 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold | |
119 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold | |
120 syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold | |
121 | 138 |
122 " Generalized Single Quoted String, Symbol and Array of Strings | 139 " Generalized Single Quoted String, Symbol and Array of Strings |
123 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold | 140 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold |
124 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape | 141 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape |
125 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape | 142 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape |
126 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape | 143 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape |
127 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape | 144 syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape |
128 syn region rubySymbol start="%[s]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold | 145 syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold |
129 syn region rubySymbol start="%[s]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape | 146 syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape |
130 syn region rubySymbol start="%[s]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape | 147 syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape |
131 syn region rubySymbol start="%[s]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape | 148 syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape |
132 syn region rubySymbol start="%[s](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape | 149 syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape |
133 | 150 |
134 " Generalized Double Quoted String and Array of Strings and Shell Command Output | 151 " Generalized Double Quoted String and Array of Strings and Shell Command Output |
135 " Note: %= is not matched here as the beginning of a double quoted string | 152 " Note: %= is not matched here as the beginning of a double quoted string |
136 syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold | 153 syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold |
137 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold | 154 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold |
139 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold | 156 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold |
140 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold | 157 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold |
141 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold | 158 syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold |
142 | 159 |
143 " Here Document | 160 " Here Document |
144 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\h\w*\)+ end=+$+ oneline contains=TOP | 161 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\h\w*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop |
145 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=TOP | 162 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop |
146 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=TOP | 163 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop |
147 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=TOP | 164 syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop |
148 | 165 |
149 syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<\z(\h\w*\)\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend | 166 syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<\z(\h\w*\)\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend |
150 syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<"\z([^"]*\)"\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend | 167 syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<"\z([^"]*\)"\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend |
151 syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<'\z([^']*\)'\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart fold keepend | 168 syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<'\z([^']*\)'\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart fold keepend |
152 syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<`\z([^`]*\)`\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend | 169 syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<`\z([^`]*\)`\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend |
161 end | 178 end |
162 | 179 |
163 syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite | 180 syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite |
164 syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable | 181 syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable |
165 syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable | 182 syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable |
166 syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant | 183 syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator |
167 syn match rubyModuleDeclaration "[^[:space:];#]\+" contained contains=rubyConstant | 184 syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator |
168 syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:].:?!=]\@!" contained containedin=rubyMethodDeclaration | 185 syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:].:?!=]\@!" contained containedin=rubyMethodDeclaration |
169 syn match rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 | 186 syn match rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 |
170 syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|==\|=\~\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration | 187 syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|==\|=\~\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration |
188 | |
189 syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter | |
171 | 190 |
172 " Expensive Mode - match 'end' with the appropriate opening keyword for syntax | 191 " Expensive Mode - match 'end' with the appropriate opening keyword for syntax |
173 " based folding and special highlighting of module/class/method definitions | 192 " based folding and special highlighting of module/class/method definitions |
174 if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") | 193 if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") |
175 syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl | 194 syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl |
176 syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl | 195 syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl |
196 syn match rubyDefine "\<undef\>" nextgroup=rubyFunction skipwhite skipnl | |
177 syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl | 197 syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl |
178 syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl | 198 syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl |
179 syn region rubyBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=TOP fold | 199 syn region rubyBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold |
180 syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=TOP fold | 200 syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop fold |
181 syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=TOP fold | 201 syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop fold |
182 | 202 |
183 " modifiers | 203 " modifiers |
184 syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display | 204 syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display |
185 syn match rubyRepeatModifier "\<\%(while\|until\)\>" display | 205 syn match rubyRepeatModifier "\<\%(while\|until\)\>" display |
186 | 206 |
187 syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=TOP fold | 207 syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold |
188 " curly bracket block or hash literal | 208 " curly bracket block or hash literal |
189 syn region rubyCurlyBlock start="{" end="}" contains=TOP fold | 209 syn region rubyCurlyBlock start="{" end="}" contains=ALLBUT,@rubyNotTop fold |
190 syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=TOP fold | 210 syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold |
191 | 211 |
192 " statements without 'do' | 212 " statements without 'do' |
193 syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=TOP fold | 213 syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold |
194 syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=TOP fold | 214 syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold |
195 syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!?]\)\s*\)\@<=\%(if\|unless\)\>" end="\<end\>" contains=TOP fold | 215 syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold |
196 | 216 |
197 syn keyword rubyConditional then else when contained containedin=rubyCaseExpression | 217 syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression |
198 syn keyword rubyConditional then else elsif contained containedin=rubyConditionalExpression | 218 syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression |
199 | 219 |
200 " statements with optional 'do' | 220 " statements with optional 'do' |
201 syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=TOP | 221 syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop |
202 syn region rubyRepeatExpression start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=TOP nextgroup=rubyOptionalDoLine fold | 222 syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold |
203 | 223 |
204 if !exists("ruby_minlines") | 224 if !exists("ruby_minlines") |
205 let ruby_minlines = 50 | 225 let ruby_minlines = 50 |
206 endif | 226 endif |
207 exec "syn sync minlines=" . ruby_minlines | 227 exec "syn sync minlines=" . ruby_minlines |
208 | 228 |
209 else | 229 else |
210 syn match rubyControl "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl | 230 syn match rubyControl "\<def\>[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl |
211 syn match rubyControl "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl | 231 syn match rubyControl "\<class\>[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl |
212 syn match rubyControl "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl | 232 syn match rubyControl "\<module\>[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl |
213 syn keyword rubyControl case begin do for if unless while until else elsif then when end | 233 syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|then\|when\|end\)\>[?!]\@!" |
214 syn keyword rubyKeyword alias | 234 syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!" |
215 endif | 235 endif |
216 | 236 |
217 " Keywords | 237 " Keywords |
218 " Note: the following keywords have already been defined: | 238 " Note: the following keywords have already been defined: |
219 " begin case class def do end for if module unless until while | 239 " begin case class def do end for if module unless until while |
220 syn keyword rubyControl and break ensure in next not or redo rescue retry return | 240 syn match rubyControl "\<\%(and\|break\|ensure\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!" |
221 syn match rubyOperator "\<defined?" display | 241 syn match rubyOperator "\<defined?" display |
222 syn keyword rubyKeyword super undef yield | 242 syn match rubyKeyword "\<\%(super\|yield\)\>[?!]\@!" |
223 syn keyword rubyBoolean true false | 243 syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!" |
224 syn keyword rubyPseudoVariable nil self __FILE__ __LINE__ | 244 syn match rubyPseudoVariable "\<\%(nil\|self\|__FILE__\|__LINE__\)\>[?!]\@!" |
225 syn keyword rubyBeginEnd BEGIN END | 245 syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!" |
226 | 246 |
227 " Special Methods | 247 " Special Methods |
228 if !exists("ruby_no_special_methods") | 248 if !exists("ruby_no_special_methods") |
229 syn keyword rubyAccess public protected private | 249 syn keyword rubyAccess public protected private module_function |
230 syn keyword rubyAttribute attr attr_accessor attr_reader attr_writer | 250 " attr is a common variable name |
231 syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>\)" | 251 syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" |
252 syn keyword rubyAttribute attr_accessor attr_reader attr_writer | |
253 syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)" | |
232 syn keyword rubyEval eval class_eval instance_eval module_eval | 254 syn keyword rubyEval eval class_eval instance_eval module_eval |
233 syn keyword rubyException raise fail catch throw | 255 syn keyword rubyException raise fail catch throw |
234 syn keyword rubyInclude autoload extend include load require | 256 " false positive with 'include?' |
257 syn match rubyInclude "\<include\>[?!]\@!" | |
258 syn keyword rubyInclude autoload extend load require | |
235 syn keyword rubyKeyword callcc caller lambda proc | 259 syn keyword rubyKeyword callcc caller lambda proc |
236 endif | 260 endif |
237 | 261 |
238 " Comments and Documentation | 262 " Comments and Documentation |
239 syn match rubySharpBang "\%^#!.*" display | 263 syn match rubySharpBang "\%^#!.*" display |
249 " Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver | 273 " Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver |
250 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>" transparent contains=NONE | 274 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>" transparent contains=NONE |
251 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>" transparent contains=NONE | 275 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>" transparent contains=NONE |
252 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>" transparent contains=NONE | 276 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>" transparent contains=NONE |
253 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE | 277 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE |
278 | |
279 syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE | |
280 syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE | |
254 | 281 |
255 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE | 282 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE |
256 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE | 283 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE |
257 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE | 284 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE |
258 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>" transparent contains=NONE | 285 syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>" transparent contains=NONE |
303 | 330 |
304 hi def link rubyComment Comment | 331 hi def link rubyComment Comment |
305 hi def link rubyData Comment | 332 hi def link rubyData Comment |
306 hi def link rubyDataDirective Delimiter | 333 hi def link rubyDataDirective Delimiter |
307 hi def link rubyDocumentation Comment | 334 hi def link rubyDocumentation Comment |
308 hi def link rubyEscape Special | 335 hi def link rubyTodo Todo |
336 | |
337 hi def link rubyStringEscape Special | |
309 hi def link rubyInterpolationDelimiter Delimiter | 338 hi def link rubyInterpolationDelimiter Delimiter |
310 hi def link rubyNoInterpolation rubyString | 339 hi def link rubyNoInterpolation rubyString |
311 hi def link rubySharpBang PreProc | 340 hi def link rubySharpBang PreProc |
312 hi def link rubyRegexpDelimiter rubyStringDelimiter | 341 hi def link rubyRegexpDelimiter rubyStringDelimiter |
342 hi def link rubySymbolDelimiter rubyStringDelimiter | |
313 hi def link rubyStringDelimiter Delimiter | 343 hi def link rubyStringDelimiter Delimiter |
344 hi def link rubyString String | |
345 hi def link rubyRegexpEscape rubyRegexpSpecial | |
346 hi def link rubyRegexpQuantifier rubyRegexpSpecial | |
347 hi def link rubyRegexpAnchor rubyRegexpSpecial | |
348 hi def link rubyRegexpDot rubyRegexpCharClass | |
349 hi def link rubyRegexpCharClass rubyRegexpSpecial | |
350 hi def link rubyRegexpSpecial Special | |
351 hi def link rubyRegexpComment Comment | |
314 hi def link rubyRegexp rubyString | 352 hi def link rubyRegexp rubyString |
315 hi def link rubyString String | |
316 hi def link rubyTodo Todo | |
317 | 353 |
318 hi def link rubyInvalidVariable Error | 354 hi def link rubyInvalidVariable Error |
319 hi def link rubyError Error | 355 hi def link rubyError Error |
320 hi def link rubySpaceError rubyError | 356 hi def link rubySpaceError rubyError |
321 | 357 |
322 let b:current_syntax = "ruby" | 358 let b:current_syntax = "ruby" |
323 | 359 |
324 " vim: nowrap sw=2 sts=2 ts=8 noet ff=unix: | 360 " vim: nowrap sw=2 sts=2 ts=8 noet: |