PATCH: remove Vim 5.x related sections

Doug Kearns djkea2 at mugca.its.monash.edu.au
Tue Sep 9 22:41:28 EDT 2003


I've removed all Vim 5.x related sections - support for versions less
than 6 was really only an illusion anyway.

This should allow for some simplifications, which have begun with the
reorganized general delimited input syntax groups.

Regards,
Doug

Index: syntax/ruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- syntax/ruby.vim	9 Sep 2003 05:37:42 -0000	1.18
+++ syntax/ruby.vim	9 Sep 2003 11:53:17 -0000	1.19
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:	Ruby
 " Maintainer:	Doug Kearns <djkea2 at mugca.its.monash.edu.au>
-" Info:		$Id: ruby.vim,v 1.18 2003/09/09 05:37:42 dkearns Exp $
+" Info:		$Id: ruby.vim,v 1.19 2003/09/09 11:53:17 dkearns Exp $
 " URL:		http://vim-ruby.sourceforge.net
 " Anon CVS:	See above site
 " Licence:	GPL (http://www.gnu.org)
@@ -57,124 +57,47 @@
   "syn match rubyPredefinedConstant "\<\(::\)\=\zs\(NotImplementError\)\>"
 endif
 
-"
-" BEGIN Autogenerated Stuff
-"
-" Generalized Regular Expression
-syn region rubyString matchgroup=rubyStringDelimiter start="%r!"  end="![iomx]*"  skip="\\\\\|\\!"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r\"" end="\"[iomx]*" skip="\\\\\|\\\"" contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r#"  end="#[iomx]*"  skip="\\\\\|\\#"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r\$" end="\$[iomx]*" skip="\\\\\|\\\$" contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r%"  end="%[iomx]*"  skip="\\\\\|\\%"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r&"  end="&[iomx]*"  skip="\\\\\|\\&"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r'"  end="'[iomx]*"  skip="\\\\\|\\'"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r\*" end="\*[iomx]*" skip="\\\\\|\\\*" contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r+"  end="+[iomx]*"  skip="\\\\\|\\+"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r-"  end="-[iomx]*"  skip="\\\\\|\\-"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r\." end="\.[iomx]*" skip="\\\\\|\\\." contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r/"  end="/[iomx]*"  skip="\\\\\|\\/"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r:"  end=":[iomx]*"  skip="\\\\\|\\:"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r;"  end=";[iomx]*"  skip="\\\\\|\\;"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r="  end="=[iomx]*"  skip="\\\\\|\\="  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r?"  end="?[iomx]*"  skip="\\\\\|\\?"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r@"  end="@[iomx]*"  skip="\\\\\|\\@"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r\\" end="\\[iomx]*"		    contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r\^" end="\^[iomx]*" skip="\\\\\|\\\^" contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r`"  end="`[iomx]*"  skip="\\\\\|\\`"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r|"  end="|[iomx]*"  skip="\\\\\|\\|"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r\~" end="\~[iomx]*" skip="\\\\\|\\\~" contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r{"  end="}[iomx]*"  skip="\\\\\|\\}"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r<"  end=">[iomx]*"  skip="\\\\\|\\>"  contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r\[" end="\][iomx]*" skip="\\\\\|\\\]" contains=rubyExprSubst fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%r("  end=")[iomx]*"  skip="\\\\\|\\)"  contains=rubyExprSubst fold
-
-" Generalized Single Quoted String, Symbol and Array of Strings
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]!"  end="!"  skip="\\\\\|\\!"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\"" end="\"" skip="\\\\\|\\\""	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]#"  end="#"  skip="\\\\\|\\#"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\$" end="\$" skip="\\\\\|\\\$"	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]%"  end="%"  skip="\\\\\|\\%"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]&"  end="&"  skip="\\\\\|\\&"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]'"  end="'"  skip="\\\\\|\\'"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\*" end="\*" skip="\\\\\|\\\*"	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]+"  end="+"  skip="\\\\\|\\+"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]-"  end="-"  skip="\\\\\|\\-"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\." end="\." skip="\\\\\|\\\."	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]/"  end="/"  skip="\\\\\|\\/"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]:"  end=":"  skip="\\\\\|\\:"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw];"  end=";"  skip="\\\\\|\\;"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]="  end="="  skip="\\\\\|\\="		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]?"  end="?"  skip="\\\\\|\\?"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]@"  end="@"  skip="\\\\\|\\@"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\\" end="\\"				fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\^" end="\^" skip="\\\\\|\\\^"	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]`"  end="`"  skip="\\\\\|\\`"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]|"  end="|"  skip="\\\\\|\\|"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\~" end="\~" skip="\\\\\|\\\~"	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]{"  end="}"  skip="\\\\\|\\}"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]<"  end=">"  skip="\\\\\|\\>"		fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\[" end="\]" skip="\\\\\|\\\]"	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]("  end=")"  skip="\\\\\|\\)"		fold
-
-" Generalized Double Quoted String and Array of Strings and Shell Command Output
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=!"  end="!"  skip="\\\\\|\\!"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\"" end="\"" skip="\\\\\|\\\"" contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=#"  end="#"  skip="\\\\\|\\#"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\$" end="\$" skip="\\\\\|\\\$" contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=%"  end="%"  skip="\\\\\|\\%"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=&"  end="&"  skip="\\\\\|\\&"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\='"  end="'"  skip="\\\\\|\\'"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\*" end="\*" skip="\\\\\|\\\*" contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=+"  end="+"  skip="\\\\\|\\+"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=-"  end="-"  skip="\\\\\|\\-"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\." end="\." skip="\\\\\|\\\." contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=/"  end="/"  skip="\\\\\|\\/"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=:"  end=":"  skip="\\\\\|\\:"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=;"  end=";"  skip="\\\\\|\\;"  contains=rubyExprSubst	fold
-"syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=="    end="="  skip="\\\\\|\\="  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]="    end="="  skip="\\\\\|\\="  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=?"  end="?"  skip="\\\\\|\\?"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=@"  end="@"  skip="\\\\\|\\@"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\\" end="\\"		   contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\^" end="\^" skip="\\\\\|\\\^" contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=`"  end="`"  skip="\\\\\|\\`"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=|"  end="|"  skip="\\\\\|\\|"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\~" end="\~" skip="\\\\\|\\\~" contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={"  end="}"  skip="\\\\\|\\}"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<"  end=">"  skip="\\\\\|\\>"  contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=rubyExprSubst	fold
-syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=("  end=")"  skip="\\\\\|\\)"  contains=rubyExprSubst	fold
+" Normal Regular Expression
+syn region rubyString matchgroup=rubyStringDelimiter start="^\s*/" start="\<and\s*/"lc=3 start="\<or\s*/"lc=2 start="\<while\s*/"lc=5 start="\<until\s*/"lc=5 start="\<unless\s*/"lc=6 start="\<if\s*/"lc=2 start="\<elsif\s*/"lc=5 start="\<when\s*/"lc=4 start="[\~=!|&(,[]\s*/"lc=1 end="/[iomx]*" skip="\\\\\|\\/" contains=rubyExprSubst
 
 " Normal String and Shell Command Output
 syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=rubyExprSubst
 syn region rubyString matchgroup=rubyStringDelimiter start="'"  end="'"  skip="\\\\\|\\'"
 syn region rubyString matchgroup=rubyStringDelimiter start="`"  end="`"  skip="\\\\\|\\`"  contains=rubyExprSubst
-"
-" END Autogenerated Stuff
-"
 
-" Normal Regular Expression
-syn region rubyString matchgroup=rubyStringDelimiter start="^\s*/" start="\<and\s*/"lc=3 start="\<or\s*/"lc=2 start="\<while\s*/"lc=5 start="\<until\s*/"lc=5 start="\<unless\s*/"lc=6 start="\<if\s*/"lc=2 start="\<elsif\s*/"lc=5 start="\<when\s*/"lc=4 start="[\~=!|&(,[]\s*/"lc=1 end="/[iomx]*" skip="\\\\\|\\/" contains=rubyExprSubst
+" Generalized Regular Expression
+syn region rubyString matchgroup=rubyStringDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)"	end="\z1[iomx]*" skip="\\\\\|\\\z1" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%r{"				end="}[iomx]*"	 skip="\\\\\|\\}"   contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%r<"				end=">[iomx]*"	 skip="\\\\\|\\>"   contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%r\["				end="\][iomx]*"	 skip="\\\\\|\\\]"  contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%r("				end=")[iomx]*"	 skip="\\\\\|\\)"   contains=rubyExprSubst fold
+
+" Generalized Single Quoted String, Symbol and Array of Strings
+syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]{"				    end="}"   skip="\\\\\|\\}"	 fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]<"				    end=">"   skip="\\\\\|\\>"	 fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]\["				    end="\]"  skip="\\\\\|\\\]"	 fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[qsw]("				    end=")"   skip="\\\\\|\\)"	 fold
+
+" Generalized Double Quoted String and Array of Strings and Shell Command Output
+" Note: %= is not matched here as the beginning of a double quoted string
+syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)"	    end="\z1" skip="\\\\\|\\\z1" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={"				    end="}"   skip="\\\\\|\\}"	 contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<"				    end=">"   skip="\\\\\|\\>"	 contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\["				    end="\]"  skip="\\\\\|\\\]"	 contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=("				    end=")"   skip="\\\\\|\\)"	 contains=rubyExprSubst fold
 
 " Here Document
-if version < 600
-  syn region rubyString matchgroup=rubyStringDelimiter start=+<<-\(\u\{3,}\|'\u\{3,}'\|"\u\{3,}"\|`\u\{3,}`\)+hs=s+2 end=+^\s*\u\{3,}$+			   fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+<<-\(EOF\|'EOF'\|"EOF"\|`EOF`\)+hs=s+2		   end=+^\s*EOF$+   contains=rubyExprSubst fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+<<-\(EOS\|'EOS'\|"EOS"\|`EOS`\)+hs=s+2		   end=+^\s*EOS$+   contains=rubyExprSubst fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+<<\(\u\{3,}\|'\u\{3,}'\|"\u\{3,}"\|`\u\{3,}`\)+hs=s+2  end=+^\u\{3,}$+			   fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+<<\(EOF\|'EOF'\|"EOF"\|`EOF`\)+hs=s+2		   end=+^EOF$+	    contains=rubyExprSubst fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+<<\(EOS\|'EOS'\|"EOS"\|`EOS`\)+hs=s+2		   end=+^EOS$+	    contains=rubyExprSubst fold
-else
-  syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<\z(\h\w*\)\ze\s*$+hs=s+2 end=+^\z1$+ contains=rubyExprSubst fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<"\z(.*\)"\ze\s*$+hs=s+2  end=+^\z1$+ contains=rubyExprSubst fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<'\z(.*\)'\ze\s*$+hs=s+2  end=+^\z1$+			fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<`\z(.*\)`\ze\s*$+hs=s+2  end=+^\z1$+ contains=rubyExprSubst fold
-
-  syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<-\z(\h\w*\)\ze\s*$+hs=s+3 end=+^\s*\zs\z1$+ contains=rubyExprSubst fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<-"\z(.*\)"\ze\s*$+hs=s+3  end=+^\s*\zs\z1$+ contains=rubyExprSubst fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<-'\z(.*\)'\ze\s*$+hs=s+3  end=+^\s*\zs\z1$+			       fold
-  syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<-`\z(.*\)`\ze\s*$+hs=s+3  end=+^\s*\zs\z1$+ contains=rubyExprSubst fold
-endif
+syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<\z(\h\w*\)\ze\s*$+hs=s+2 end=+^\z1$+ contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<"\z(.*\)"\ze\s*$+hs=s+2  end=+^\z1$+ contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<'\z(.*\)'\ze\s*$+hs=s+2  end=+^\z1$+			      fold
+syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<`\z(.*\)`\ze\s*$+hs=s+2  end=+^\z1$+ contains=rubyExprSubst fold
+
+syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<-\z(\h\w*\)\ze\s*$+hs=s+3 end=+^\s*\zs\z1$+ contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<-"\z(.*\)"\ze\s*$+hs=s+3  end=+^\s*\zs\z1$+ contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<-'\z(.*\)'\ze\s*$+hs=s+3  end=+^\s*\zs\z1$+			     fold
+syn region rubyString matchgroup=rubyStringDelimiter start=+\(\(class\s*\|\(\.\|::\)\)\_s*\)\@<!<<-`\z(.*\)`\ze\s*$+hs=s+3  end=+^\s*\zs\z1$+ contains=rubyExprSubst fold
 
 " Expensive Mode - colorize *end* according to opening statement
 if !exists("ruby_no_expensive")
@@ -237,27 +160,23 @@
 endif
 
 " Comments and Documentation
-if version < 600
-  syn match  rubySharpBang "^#!.*" contained
-else
-  syn match  rubySharpBang "\%^#!.*"
-endif
+syn match   rubySharpBang     "\%^#!.*"
 syn keyword rubyTodo          FIXME NOTE TODO XXX contained
 syn match   rubyComment       "#.*" contains=rubySharpBang,rubyTodo, at Spell
 syn region  rubyDocumentation start="^=begin" end="^=end.*$" contains=rubyTodo, at Spell fold
 
 " Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>"	    transparent contains=NONE
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>"		    transparent contains=NONE
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>"	    transparent contains=NONE
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE
-
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>"	transparent contains=NONE
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(attr_writer\|autoload\|callcc\|catch\|caller\)\>"		transparent contains=NONE
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>"	transparent contains=NONE
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(extend\|fail\|fork\|include\|lambda\)\>"			transparent contains=NONE
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(load\|loop\|private\|proc\|protected\)\>"			transparent contains=NONE
-syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(public\|require\|raise\|throw\|trap\)\>"			transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>"			transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>"				transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>"			transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>"		transparent contains=NONE
+
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>"		transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(attr_writer\|autoload\|callcc\|catch\|caller\)\>"		transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>"	transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(extend\|fail\|fork\|include\|lambda\)\>"			transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(load\|loop\|private\|proc\|protected\)\>"			transparent contains=NONE
+syn match rubyKeywordAsMethod "\(\(\.\@<!\.\)\|::\)\_s*\(public\|require\|raise\|throw\|trap\)\>"			transparent contains=NONE
 
 " __END__ Directive
 syn region rubyData matchgroup=rubyDataDirective start="^__END__$" matchgroup=NONE end="." skip="." fold


More information about the vim-ruby-devel mailing list