PATCH: reorder identifier syntax matching

Doug Kearns dougkearns at gmail.com
Tue Aug 2 10:58:04 EDT 2005


On Sun, Jul 31, 2005 at 01:17:21AM +1000, Doug Kearns wrote:
> This reorders the identifier matching so that those containing some of
> the more unusual predefined identifiers, such as $_, will match properly
> without having to mess around with 'iskeyword'.

Scrap that... just make it a special case.
 
Regards,
Doug 


Index: syntax/ruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v
retrieving revision 1.49
diff -u -r1.49 ruby.vim
--- syntax/ruby.vim	30 Jul 2005 15:22:23 -0000	1.49
+++ syntax/ruby.vim	1 Aug 2005 15:00:11 -0000
@@ -68,17 +68,6 @@
 syn match rubyLocalVariableOrMethod "[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
 
 if !exists("ruby_no_identifiers")
-  syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\_`~1-9]#
-  syn match rubyPredefinedVariable "$-[0FIKadilpvw]"									display
-  syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>"					display
-  syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOAD_PATH\|SAFE\|VERBOSE\)\>"				display
-  syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>"					display
-  syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>"		display
-  syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>"	display
-  "Obsolete Global Constants
-  "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>"
-  "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(NotImplementError\)\>"
-
   syn match  rubyConstant		"\%(::\)\=\zs\u\w*"	display
   syn match  rubyClassVariable		"@@\h\w*"		display
   syn match  rubyInstanceVariable	"@\h\w*"		display
@@ -89,6 +78,18 @@
   syn region rubySymbol			start=":\@<!:\"" end="\"" skip="\\\\\|\\\""
   syn match  rubyIterator		"|[ ,a-zA-Z0-9_*]\+|"		display
   syn match  rubyIterator		"|\s*([ ,a-zA-Z0-9_*]\+)\s*|"	display
+
+  syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~1-9]#
+  syn match rubyPredefinedVariable "$_\>"											display
+  syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>"									display
+  syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>"					display
+  syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOAD_PATH\|SAFE\|VERBOSE\)\>"				display
+  syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>"					display
+  syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>"		display
+  syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>"	display
+  "Obsolete Global Constants
+  "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>"
+  "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(NotImplementError\)\>"
 else
   syn match NONE +$['"]+
 endif


More information about the vim-ruby-devel mailing list