| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim syntax file | 
					
						
							| 
									
										
										
										
											2006-04-15 20:25:09 +00:00
										 |  |  | " Language:		Ruby | 
					
						
							|  |  |  | " Maintainer:		Doug Kearns <dougkearns@gmail.com> | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  | " URL:			https://github.com/vim-ruby/vim-ruby | 
					
						
							| 
									
										
										
										
											2006-04-15 20:25:09 +00:00
										 |  |  | " Release Coordinator:	Doug Kearns <dougkearns@gmail.com> | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | " Last Change:		2018 Jul 09 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | " ---------------------------------------------------------------------------- | 
					
						
							|  |  |  | " | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Previous Maintainer:	Mirko Nasato | 
					
						
							|  |  |  | " Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN) | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | " ---------------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Prelude {{{1 | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | if exists("b:current_syntax") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " this file uses line continuations | 
					
						
							|  |  |  | let s:cpo_sav = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Folding Config {{{1 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | if has("folding") && exists("ruby_fold") | 
					
						
							|  |  |  |   setlocal foldmethod=syntax | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | let s:foldable_groups = split( | 
					
						
							|  |  |  |       \	  get( | 
					
						
							|  |  |  |       \	    b:, | 
					
						
							|  |  |  |       \	    'ruby_foldable_groups', | 
					
						
							|  |  |  |       \	    get(g:, 'ruby_foldable_groups', 'ALL') | 
					
						
							|  |  |  |       \	  ) | 
					
						
							|  |  |  |       \	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function! s:foldable(...) abort | 
					
						
							|  |  |  |   if index(s:foldable_groups, 'ALL') > -1 | 
					
						
							|  |  |  |     return 1 | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   for l:i in a:000 | 
					
						
							|  |  |  |     if index(s:foldable_groups, l:i) > -1 | 
					
						
							|  |  |  |       return 1 | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   endfor | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return 0 | 
					
						
							|  |  |  | endfunction " }}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo,rubyModuleName,rubyClassName,rubySymbolDelimiter | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Whitespace Errors {{{1 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | if exists("ruby_space_errors") | 
					
						
							|  |  |  |   if !exists("ruby_no_trail_space_error") | 
					
						
							|  |  |  |     syn match rubySpaceError display excludenl "\s\+$" | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   if !exists("ruby_no_tab_space_error") | 
					
						
							|  |  |  |     syn match rubySpaceError display " \+\t"me=e-1 | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Operators {{{1 | 
					
						
							| 
									
										
										
										
											2007-05-05 17:54:07 +00:00
										 |  |  | if exists("ruby_operators") | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |   syn match  rubyOperator "[~!^|*/%+-]\|&\.\@!\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@1<!>\|\*\*\|\.\.\.\|\.\.\|::" | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  |   syn match  rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |   syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@2<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop | 
					
						
							| 
									
										
										
										
											2007-05-05 17:54:07 +00:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Expression Substitution and Backslash Notation {{{1 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}"						    contained display | 
					
						
							|  |  |  | syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display | 
					
						
							|  |  |  | syn match rubyQuoteEscape  "\\[\\']"											    contained display | 
					
						
							| 
									
										
										
										
											2007-05-05 17:54:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | syn region rubyInterpolation	      matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn match  rubyInterpolation	      "#\%(\$\|@@\=\)\w\+"    display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable | 
					
						
							| 
									
										
										
										
											2007-05-05 17:54:07 +00:00
										 |  |  | syn match  rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn match  rubyInterpolation	      "#\$\%(-\w\|\W\)"       display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | syn match  rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)"    display contained | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn region rubyNoInterpolation	      start="\\#{" end="}"	      contained | 
					
						
							| 
									
										
										
										
											2007-05-05 17:54:07 +00:00
										 |  |  | syn match  rubyNoInterpolation	      "\\#{"		      display contained | 
					
						
							|  |  |  | syn match  rubyNoInterpolation	      "\\#\%(\$\|@@\=\)\w\+"  display contained | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn match  rubyNoInterpolation	      "\\#\$\W"		      display contained | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn match rubyDelimiterEscape	"\\[(<{\[)>}\]]" transparent display contained contains=NONE | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn region rubyNestedParentheses    start="("  skip="\\\\\|\\)"  matchgroup=rubyString end=")"	transparent contained | 
					
						
							|  |  |  | syn region rubyNestedCurlyBraces    start="{"  skip="\\\\\|\\}"  matchgroup=rubyString end="}"	transparent contained | 
					
						
							|  |  |  | syn region rubyNestedAngleBrackets  start="<"  skip="\\\\\|\\>"  matchgroup=rubyString end=">"	transparent contained | 
					
						
							|  |  |  | syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]"	transparent contained | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Regular Expression Metacharacters {{{1 | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | " These are mostly Oniguruma ready | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn region rubyRegexpComment	matchgroup=rubyRegexpSpecial   start="(?#"								  skip="\\)"  end=")"  contained | 
					
						
							|  |  |  | syn region rubyRegexpParens	matchgroup=rubyRegexpSpecial   start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)"  end=")"  contained transparent contains=@rubyRegexpSpecial | 
					
						
							|  |  |  | syn region rubyRegexpBrackets	matchgroup=rubyRegexpCharClass start="\[\^\="								  skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline | 
					
						
							|  |  |  | syn match  rubyRegexpCharClass	"\\[DdHhSsWw]"	       contained display | 
					
						
							|  |  |  | syn match  rubyRegexpCharClass	"\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained | 
					
						
							|  |  |  | syn match  rubyRegexpEscape	"\\[].*?+^$|\\/(){}[]" contained | 
					
						
							|  |  |  | syn match  rubyRegexpQuantifier	"[*?+][?+]\="	       contained display | 
					
						
							|  |  |  | syn match  rubyRegexpQuantifier	"{\d\+\%(,\d*\)\=}?\=" contained display | 
					
						
							|  |  |  | syn match  rubyRegexpAnchor	"[$^]\|\\[ABbGZz]"     contained display | 
					
						
							|  |  |  | syn match  rubyRegexpDot	"\."		       contained display | 
					
						
							|  |  |  | syn match  rubyRegexpSpecial	"|"		       contained display | 
					
						
							|  |  |  | syn match  rubyRegexpSpecial	"\\[1-9]\d\=\d\@!"     contained display | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | syn match  rubyRegexpSpecial	"\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display | 
					
						
							|  |  |  | syn match  rubyRegexpSpecial	"\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display | 
					
						
							|  |  |  | syn match  rubyRegexpSpecial	"\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display | 
					
						
							|  |  |  | syn match  rubyRegexpSpecial	"\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn cluster rubyStringSpecial	      contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape | 
					
						
							|  |  |  | syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets | 
					
						
							|  |  |  | syn cluster rubyRegexpSpecial	      contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Numbers and ASCII Codes {{{1 | 
					
						
							|  |  |  | syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@1<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" | 
					
						
							|  |  |  | syn match rubyInteger	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>"								display | 
					
						
							|  |  |  | syn match rubyInteger	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>"						display | 
					
						
							|  |  |  | syn match rubyInteger	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>"								display | 
					
						
							|  |  |  | syn match rubyInteger	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*r\=i\=\>"								display | 
					
						
							|  |  |  | syn match rubyFloat	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>"					display | 
					
						
							|  |  |  | syn match rubyFloat	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)r\=i\=\>"	display | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Identifiers {{{1 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent | 
					
						
							|  |  |  | syn match rubyBlockArgument	    "&[_[:lower:]][_[:alnum:]]"		 contains=NONE display transparent | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | syn match  rubyClassName	"\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained | 
					
						
							|  |  |  | syn match  rubyModuleName	"\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn match  rubyConstant		"\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  | syn match  rubyClassVariable	"@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn match  rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*"	display | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  | syn match  rubyGlobalVariable	"$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | syn match  rubySymbolDelimiter	":" contained | 
					
						
							|  |  |  | syn match  rubySymbol		"[]})\"':]\@1<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" contains=rubySymbolDelimiter | 
					
						
							|  |  |  | syn match  rubySymbol		"[]})\"':]\@1<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" contains=rubySymbolDelimiter | 
					
						
							|  |  |  | syn match  rubySymbol		"[]})\"':]\@1<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contains=rubySymbolDelimiter | 
					
						
							|  |  |  | syn match  rubySymbol		"[]})\"':]\@1<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" contains=rubySymbolDelimiter | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | if s:foldable(':') | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  |   syn region rubySymbol		matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'"  end="'"  skip="\\\\\|\\'"  contains=rubyQuoteEscape fold | 
					
						
							|  |  |  |   syn region rubySymbol		matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | else | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  |   syn region rubySymbol		matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'"  end="'"  skip="\\\\\|\\'"  contains=rubyQuoteEscape | 
					
						
							|  |  |  |   syn region rubySymbol		matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn match  rubyCapitalizedMethod	"\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)*\s*(\@=" | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  | syn match  rubyBlockParameter	  "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" oneline display contains=rubyBlockParameter | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | syn match rubyInvalidVariable	 "$[^ A-Za-z_-]" | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  | syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~]# | 
					
						
							|  |  |  | syn match rubyPredefinedVariable "$\d\+"										   display | 
					
						
							| 
									
										
										
										
											2005-09-25 22:16:38 +00:00
										 |  |  | syn match rubyPredefinedVariable "$_\>"											   display | 
					
						
							|  |  |  | syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>"									   display | 
					
						
							|  |  |  | syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>"					   display | 
					
						
							|  |  |  | syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(ARGF\|ARGV\|ENV\|DATA\|FALSE\|NIL\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!" | 
					
						
							|  |  |  | syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Normal Regular Expression {{{1 | 
					
						
							|  |  |  | if s:foldable('/') | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | else | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Generalized Regular Expression {{{1 | 
					
						
							|  |  |  | if s:foldable('%') | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{"				end="}[iomxneus]*"   skip="\\\\\|\\}"	 contains=@rubyRegexpSpecial fold | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<"				end=">[iomxneus]*"   skip="\\\\\|\\>"	 contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\["				end="\][iomxneus]*"  skip="\\\\\|\\\]"	 contains=@rubyRegexpSpecial fold | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r("				end=")[iomxneus]*"   skip="\\\\\|\\)"	 contains=@rubyRegexpSpecial fold | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)"				end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{"				end="}[iomxneus]*"   skip="\\\\\|\\}"	 contains=@rubyRegexpSpecial | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<"				end=">[iomxneus]*"   skip="\\\\\|\\>"	 contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\["				end="\][iomxneus]*"  skip="\\\\\|\\\]"	 contains=@rubyRegexpSpecial | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r("				end=")[iomxneus]*"   skip="\\\\\|\\)"	 contains=@rubyRegexpSpecial | 
					
						
							|  |  |  |   syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)"				end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Normal String {{{1 | 
					
						
							|  |  |  | let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : '' | 
					
						
							|  |  |  | exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" ' . | 
					
						
							|  |  |  |       \ (s:foldable('%') ? 'fold' : '') . ' contains=@rubyStringSpecial' . s:spell_cluster | 
					
						
							|  |  |  | exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" ' . | 
					
						
							|  |  |  |       \ (s:foldable('%') ? 'fold' : '') . ' contains=rubyQuoteEscape'	 . s:spell_cluster | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Shell Command Output {{{1 | 
					
						
							|  |  |  | if s:foldable('%') | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Generalized Single Quoted String, Symbol and Array of Strings {{{1 | 
					
						
							|  |  |  | if s:foldable('%') | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{"				     end="}"   skip="\\\\\|\\}"	  fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<"				     end=">"   skip="\\\\\|\\>"	  fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\["				     end="\]"  skip="\\\\\|\\\]"  fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]("				     end=")"   skip="\\\\\|\\)"	  fold contains=rubyNestedParentheses,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)"			     end="\z1" skip="\\\\\|\\\z1" fold | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)"    end="\z1" skip="\\\\\|\\\z1" fold | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{"				     end="}"   skip="\\\\\|\\}"	  fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<"				     end=">"   skip="\\\\\|\\>"	  fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\["				     end="\]"  skip="\\\\\|\\\]"  fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s("				     end=")"   skip="\\\\\|\\)"	  fold contains=rubyNestedParentheses,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)"			     end="\z1" skip="\\\\\|\\\z1" fold | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{"				     end="}"   skip="\\\\\|\\}"	  contains=rubyNestedCurlyBraces,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<"				     end=">"   skip="\\\\\|\\>"	  contains=rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\["				     end="\]"  skip="\\\\\|\\\]"  contains=rubyNestedSquareBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]("				     end=")"   skip="\\\\\|\\)"	  contains=rubyNestedParentheses,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)"			     end="\z1" skip="\\\\\|\\\z1" | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)"    end="\z1" skip="\\\\\|\\\z1" | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{"				     end="}"   skip="\\\\\|\\}"	  contains=rubyNestedCurlyBraces,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<"				     end=">"   skip="\\\\\|\\>"	  contains=rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\["				     end="\]"  skip="\\\\\|\\\]"  contains=rubyNestedSquareBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s("				     end=")"   skip="\\\\\|\\)"	  contains=rubyNestedParentheses,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)"			     end="\z1" skip="\\\\\|\\\z1" | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Generalized Double Quoted String and Array of Strings and Shell Command Output {{{1 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | " Note: %= is not matched here as the beginning of a double quoted string | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | if s:foldable('%') | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)"	      end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={"			      end="}"	skip="\\\\\|\\}"   contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape    fold | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<"			      end=">"	skip="\\\\\|\\>"   contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape  fold | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\["			      end="\]"	skip="\\\\\|\\\]"  contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=("			      end=")"	skip="\\\\\|\\)"   contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape    fold | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)"			      end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)"	      end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={"			      end="}"	skip="\\\\\|\\}"   contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<"			      end=">"	skip="\\\\\|\\>"   contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\["			      end="\]"	skip="\\\\\|\\\]"  contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=("			      end=")"	skip="\\\\\|\\)"   contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)"			      end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Array of Symbols {{{1 | 
					
						
							|  |  |  | if s:foldable('%') | 
					
						
							|  |  |  |   " Array of Symbols | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"	fold | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{"				  end="}"   skip="\\\\\|\\}"	fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<"				  end=">"   skip="\\\\\|\\>"	fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\["				  end="\]"  skip="\\\\\|\\\]"	fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i("				  end=")"   skip="\\\\\|\\)"	fold contains=rubyNestedParentheses,rubyDelimiterEscape | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Array of interpolated Symbols | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"	contains=@rubyStringSpecial fold | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{"				  end="}"   skip="\\\\\|\\}"	contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape    fold | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<"				  end=">"   skip="\\\\\|\\>"	contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape  fold | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\["				  end="\]"  skip="\\\\\|\\\]"	contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I("				  end=")"   skip="\\\\\|\\)"	contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape    fold | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   " Array of Symbols | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{"				  end="}"   skip="\\\\\|\\}"	contains=rubyNestedCurlyBraces,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<"				  end=">"   skip="\\\\\|\\>"	contains=rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\["				  end="\]"  skip="\\\\\|\\\]"	contains=rubyNestedSquareBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i("				  end=")"   skip="\\\\\|\\)"	contains=rubyNestedParentheses,rubyDelimiterEscape | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Array of interpolated Symbols | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"	contains=@rubyStringSpecial | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{"				  end="}"   skip="\\\\\|\\}"	contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<"				  end=">"   skip="\\\\\|\\>"	contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\["				  end="\]"  skip="\\\\\|\\\]"	contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape | 
					
						
							|  |  |  |   syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I("				  end=")"   skip="\\\\\|\\)"	contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Here Document {{{1 | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+	 end=+$+ oneline contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  | syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  | syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  | syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | if s:foldable('<<') | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc		    fold keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3    matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart		    fold keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc		    keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3    matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart		    keepend | 
					
						
							|  |  |  |   syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " eRuby Config {{{1 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | if exists('main_syntax') && main_syntax == 'eruby' | 
					
						
							| 
									
										
										
										
											2005-10-10 20:59:28 +00:00
										 |  |  |   let b:ruby_no_expensive = 1 | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Module, Class, Method and Alias Declarations {{{1 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn match  rubyAliasDeclaration    "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite | 
					
						
							|  |  |  | syn match  rubyAliasDeclaration2   "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable | 
					
						
							|  |  |  | syn match  rubyMethodDeclaration   "[^[:space:];#(]\+"	 contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | syn match  rubyClassDeclaration    "[^[:space:];#<]\+"	 contained contains=rubyClassName,rubyOperator | 
					
						
							|  |  |  | syn match  rubyModuleDeclaration   "[^[:space:];#<]\+"	 contained contains=rubyModuleName,rubyOperator | 
					
						
							|  |  |  | syn match  rubyMethodName "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration | 
					
						
							|  |  |  | syn match  rubyMethodName "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 | 
					
						
							|  |  |  | syn match  rubyMethodName "\%([[:space:].]\|^\)\@2<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyMethodName,rubyBlockParameter | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Keywords {{{1 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | " Note: the following keywords have already been defined: | 
					
						
							|  |  |  | " begin case class def do end for if module unless until while | 
					
						
							|  |  |  | syn match   rubyControl	       "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!" | 
					
						
							|  |  |  | syn match   rubyOperator       "\<defined?" display | 
					
						
							|  |  |  | syn match   rubyKeyword	       "\<\%(super\|yield\)\>[?!]\@!" | 
					
						
							|  |  |  | syn match   rubyBoolean	       "\<\%(true\|false\)\>[?!]\@!" | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn match   rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__dir__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn match   rubyBeginEnd       "\<\%(BEGIN\|END\)\>[?!]\@!" | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Expensive Mode {{{1 | 
					
						
							|  |  |  | " Match 'end' with the appropriate opening keyword for syntax based folding | 
					
						
							|  |  |  | " and special highlighting of module/class/method definitions | 
					
						
							| 
									
										
										
										
											2005-10-10 20:59:28 +00:00
										 |  |  | if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  |   syn match  rubyDefine "\<alias\>"  nextgroup=rubyAliasDeclaration  skipwhite skipnl | 
					
						
							|  |  |  |   syn match  rubyDefine "\<def\>"    nextgroup=rubyMethodDeclaration skipwhite skipnl | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  |   syn match  rubyDefine "\<undef\>"  nextgroup=rubyMethodName	     skipwhite skipnl | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  |   syn match  rubyClass	"\<class\>"  nextgroup=rubyClassDeclaration  skipwhite skipnl | 
					
						
							|  |  |  |   syn match  rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |   if s:foldable('def') | 
					
						
							|  |  |  |     syn region rubyMethodBlock start="\<def\>"	matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyMethodBlock start="\<def\>"	matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if s:foldable('class') | 
					
						
							|  |  |  |     syn region rubyBlock start="\<class\>"	matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyBlock start="\<class\>"	matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if s:foldable('module') | 
					
						
							|  |  |  |     syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  |   " modifiers | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |   syn match rubyLineContinuation    "\\$" nextgroup=rubyConditionalModifier,rubyRepeatModifier skipwhite skipnl | 
					
						
							|  |  |  |   syn match rubyConditionalModifier "\<\%(if\|unless\)\>" | 
					
						
							|  |  |  |   syn match rubyRepeatModifier	    "\<\%(while\|until\)\>" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if s:foldable('do') | 
					
						
							|  |  |  |     syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  |   " curly bracket block or hash literal | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |   if s:foldable('{') | 
					
						
							|  |  |  |     syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if s:foldable('[') | 
					
						
							|  |  |  |     syn region rubyArrayLiteral	matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  |   " statements without 'do' | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |   if s:foldable('begin') | 
					
						
							|  |  |  |     syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if s:foldable('case') | 
					
						
							|  |  |  |     syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if s:foldable('if') | 
					
						
							|  |  |  |     syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  |   syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!"	contained containedin=rubyCaseExpression | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  |   syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  |   syn match rubyExceptional	  "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyBlockExpression | 
					
						
							|  |  |  |   syn match rubyMethodExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyMethodBlock | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  |   " statements with optional 'do' | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  |   syn region rubyOptionalDoLine   matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if s:foldable('for') | 
					
						
							|  |  |  |     syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if !exists("ruby_minlines") | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  |     let ruby_minlines = 500 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   endif | 
					
						
							|  |  |  |   exec "syn sync minlines=" . ruby_minlines | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | else | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  |   syn match rubyControl "\<def\>[?!]\@!"    nextgroup=rubyMethodDeclaration skipwhite skipnl | 
					
						
							|  |  |  |   syn match rubyControl "\<class\>[?!]\@!"  nextgroup=rubyClassDeclaration  skipwhite skipnl | 
					
						
							|  |  |  |   syn match rubyControl "\<module\>[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl | 
					
						
							|  |  |  |   syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|end\)\>[?!]\@!" | 
					
						
							|  |  |  |   syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!" | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Special Methods {{{1 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | if !exists("ruby_no_special_methods") | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  |   syn keyword rubyAccess    public protected private public_class_method private_class_method public_constant private_constant module_function | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  |   " attr is a common variable name | 
					
						
							|  |  |  |   syn match   rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" | 
					
						
							|  |  |  |   syn keyword rubyAttribute attr_accessor attr_reader attr_writer | 
					
						
							|  |  |  |   syn match   rubyControl   "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)" | 
					
						
							| 
									
										
										
										
											2005-10-10 20:59:28 +00:00
										 |  |  |   syn keyword rubyEval	    eval class_eval instance_eval module_eval | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  |   syn keyword rubyException raise fail catch throw | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  |   syn keyword rubyInclude   autoload gem load require require_relative | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  |   syn keyword rubyKeyword   callcc caller lambda proc | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  |   " false positive with 'include?' | 
					
						
							|  |  |  |   syn match   rubyMacro     "\<include\>[?!]\@!" | 
					
						
							|  |  |  |   syn keyword rubyMacro     extend prepend refine using | 
					
						
							|  |  |  |   syn keyword rubyMacro     alias_method define_method define_singleton_method remove_method undef_method | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Comments and Documentation {{{1 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn match   rubySharpBang "\%^#!.*" display | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn keyword rubyTodo	  FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | syn match   rubyComment   "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | if !exists("ruby_no_comment_fold") && s:foldable('#') | 
					
						
							|  |  |  |   syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  |   syn region rubyDocumentation	  start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold | 
					
						
							| 
									
										
										
										
											2007-05-05 17:54:07 +00:00
										 |  |  | else | 
					
						
							|  |  |  |   syn region rubyDocumentation	  start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Keyword Nobbling {{{1 | 
					
						
							| 
									
										
										
										
											2005-09-16 21:47:57 +00:00
										 |  |  | " Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%([_[:lower:]][_[:alnum:]]*\|\<\%(BEGIN\|END\)\>\)" transparent contains=NONE | 
					
						
							|  |  |  | syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]"			       transparent contains=NONE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " More Symbols {{{1 | 
					
						
							|  |  |  | syn match  rubySymbol		"\%([{(,]\_s*\)\zs\l\w*[!?]\=::\@!"he=e-1 | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | syn match  rubySymbol		"[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | syn match  rubySymbol		"\%([{(,]\_s*\)\zs[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1 | 
					
						
							|  |  |  | syn match  rubySymbol		"[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " __END__ Directive {{{1 | 
					
						
							|  |  |  | if s:foldable('__END__') | 
					
						
							|  |  |  |   syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Default Highlighting {{{1 | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyClass			rubyDefine | 
					
						
							|  |  |  | hi def link rubyModule			rubyDefine | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | hi def link rubyMethodExceptional	rubyDefine | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyDefine			Define | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | hi def link rubyAccess			rubyMacro | 
					
						
							|  |  |  | hi def link rubyAttribute		rubyMacro | 
					
						
							|  |  |  | hi def link rubyMacro			Macro | 
					
						
							|  |  |  | hi def link rubyMethodName		rubyFunction | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyFunction		Function | 
					
						
							|  |  |  | hi def link rubyConditional		Conditional | 
					
						
							|  |  |  | hi def link rubyConditionalModifier	rubyConditional | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | hi def link rubyExceptional		rubyConditional | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyRepeat			Repeat | 
					
						
							|  |  |  | hi def link rubyRepeatModifier		rubyRepeat | 
					
						
							|  |  |  | hi def link rubyOptionalDo		rubyRepeat | 
					
						
							|  |  |  | hi def link rubyControl			Statement | 
					
						
							|  |  |  | hi def link rubyInclude			Include | 
					
						
							|  |  |  | hi def link rubyInteger			Number | 
					
						
							|  |  |  | hi def link rubyASCIICode		Character | 
					
						
							|  |  |  | hi def link rubyFloat			Float | 
					
						
							|  |  |  | hi def link rubyBoolean			Boolean | 
					
						
							|  |  |  | hi def link rubyException		Exception | 
					
						
							|  |  |  | if !exists("ruby_no_identifiers") | 
					
						
							|  |  |  |   hi def link rubyIdentifier		Identifier | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   hi def link rubyIdentifier		NONE | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyClassVariable		rubyIdentifier | 
					
						
							|  |  |  | hi def link rubyConstant		Type | 
					
						
							| 
									
										
										
										
											2019-01-17 16:07:22 +01:00
										 |  |  | hi def link rubyClassName		rubyConstant | 
					
						
							|  |  |  | hi def link rubyModuleName		rubyConstant | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyGlobalVariable		rubyIdentifier | 
					
						
							|  |  |  | hi def link rubyInstanceVariable	rubyIdentifier | 
					
						
							|  |  |  | hi def link rubyPredefinedIdentifier	rubyIdentifier | 
					
						
							|  |  |  | hi def link rubyPredefinedConstant	rubyPredefinedIdentifier | 
					
						
							|  |  |  | hi def link rubyPredefinedVariable	rubyPredefinedIdentifier | 
					
						
							|  |  |  | hi def link rubySymbol			Constant | 
					
						
							|  |  |  | hi def link rubyKeyword			Keyword | 
					
						
							|  |  |  | hi def link rubyOperator		Operator | 
					
						
							|  |  |  | hi def link rubyBeginEnd		Statement | 
					
						
							|  |  |  | hi def link rubyEval			Statement | 
					
						
							|  |  |  | hi def link rubyPseudoVariable		Constant | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | hi def link rubyCapitalizedMethod	rubyLocalVariableOrMethod | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | hi def link rubyComment			Comment | 
					
						
							|  |  |  | hi def link rubyData			Comment | 
					
						
							|  |  |  | hi def link rubyDataDirective		Delimiter | 
					
						
							|  |  |  | hi def link rubyDocumentation		Comment | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | hi def link rubyTodo			Todo | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-28 20:54:39 +02:00
										 |  |  | hi def link rubyQuoteEscape		rubyStringEscape | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | hi def link rubyStringEscape		Special | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyInterpolationDelimiter	Delimiter | 
					
						
							|  |  |  | hi def link rubyNoInterpolation		rubyString | 
					
						
							|  |  |  | hi def link rubySharpBang		PreProc | 
					
						
							|  |  |  | hi def link rubyRegexpDelimiter		rubyStringDelimiter | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | hi def link rubySymbolDelimiter		rubySymbol | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyStringDelimiter		Delimiter | 
					
						
							| 
									
										
										
										
											2013-06-12 21:29:15 +02:00
										 |  |  | hi def link rubyHeredoc			rubyString | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | hi def link rubyString			String | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | hi def link rubyRegexpEscape		rubyRegexpSpecial | 
					
						
							|  |  |  | hi def link rubyRegexpQuantifier	rubyRegexpSpecial | 
					
						
							|  |  |  | hi def link rubyRegexpAnchor		rubyRegexpSpecial | 
					
						
							|  |  |  | hi def link rubyRegexpDot		rubyRegexpCharClass | 
					
						
							|  |  |  | hi def link rubyRegexpCharClass		rubyRegexpSpecial | 
					
						
							|  |  |  | hi def link rubyRegexpSpecial		Special | 
					
						
							|  |  |  | hi def link rubyRegexpComment		Comment | 
					
						
							|  |  |  | hi def link rubyRegexp			rubyString | 
					
						
							| 
									
										
										
										
											2007-05-10 16:56:30 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | hi def link rubyInvalidVariable		Error | 
					
						
							|  |  |  | hi def link rubyError			Error | 
					
						
							|  |  |  | hi def link rubySpaceError		rubyError | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Postscript {{{1 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | let b:current_syntax = "ruby" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | let &cpo = s:cpo_sav | 
					
						
							|  |  |  | unlet! s:cpo_sav | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: |