@@ -342,12 +342,12 @@ syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,
342342
343343" Keywords {{{1
344344" TODO: reorganise
345- syn match rubyControl " \<\% (break\| in\| next\| redo\| retry\| return\)\> "
346- syn match rubyKeyword " \<\% (super\| yield\)\> "
347- syn match rubyBoolean " \<\% (true\| false\)\> [?!]\@ !"
348- syn match rubyPseudoVariable " \<\( self\| nil\)\> [?!]\@ !"
349- syn match rubyPseudoVariable " \< __\% (ENCODING\| dir\| FILE\| LINE\| callee\| method\) __\> "
350- syn match rubyBeginEnd " \<\% (BEGIN\| END\)\> "
345+ syn match rubyControl " \% #=1 \ <\% (break\| in\| next\| redo\| retry\| return\)\> "
346+ syn match rubyKeyword " \% #=1 \ <\% (super\| yield\)\> "
347+ syn match rubyBoolean " \% #=1 \ <\% (true\| false\)\> [?!]\@ !"
348+ syn match rubyPseudoVariable " \% #=1 \ <\( self\| nil\)\> [?!]\@ !"
349+ syn match rubyPseudoVariable " \% #=1 \ < __\% (ENCODING\| dir\| FILE\| LINE\| callee\| method\) __\> "
350+ syn match rubyBeginEnd " \% #=1 \ <\% (BEGIN\| END\)\> "
351351
352352" Expensive Mode {{{1
353353" Match 'end' with the appropriate opening keyword for syntax based folding
@@ -410,19 +410,20 @@ endif
410410
411411" Special Methods {{{1
412412if ! exists (" ruby_no_special_methods" )
413- syn match rubyAccess " \<\% (public\| protected\| private\)\> "
414- syn match rubyAccess " \<\% (public_class_method\| private_class_method\)\> "
415- syn match rubyAccess " \<\% (public_constant\| private_constant\)\> "
416- syn match rubyAccess " \< module_function\> "
417- syn match rubyAttribute " \% (\% (^\| ;\)\s *\)\@ <=attr\>\(\s *[.=]\)\@ !" " attr is a common variable name
418- syn match rubyAttribute " \<\% (attr_accessor\| attr_reader\| attr_writer\)\> "
419- syn match rubyControl " \<\% (abort\| at_exit\| exit\| fork\| loop\| trap\)\> "
420- syn match rubyEval " \<\% (eval\| class_eval\| instance_eval\| module_eval\)\> "
421- syn match rubyException " \<\% (raise\| fail\| catch\| throw\)\> "
422- syn match rubyInclude " \<\% (autoload\| gem\| load\| require\| require_relative\)\> "
423- syn match rubyKeyword " \<\% (callcc\| caller\| lambda\| proc\)\> "
424- syn match rubyMacro " \<\% (extend\| include\| prepend\| refine\| using\)\> "
425- syn match rubyMacro " \<\% (alias_method\| define_method\| define_singleton_method\| remove_method\| undef_method\)\> "
413+ syn match rubyAccess " \<\% (public\| protected\| private\)\> " " use re=2
414+ syn match rubyAccess " \% #=1\<\% (public\| private\) _class_method\> "
415+ syn match rubyAccess " \% #=1\<\% (public\| private\) _constant\> "
416+ syn match rubyAccess " \% #=1\< module_function\> "
417+ syn match rubyAttribute " \% #=1\% (\% (^\| ;\)\s *\)\@ <=attr\>\(\s *[.=]\)\@ !" " attr is a common variable name
418+ syn match rubyAttribute " \% #=1\< attr_\% (accessor\| reader\| writer\)\> "
419+ syn match rubyControl " \% #=1\<\% (abort\| at_exit\| exit\| fork\| loop\| trap\)\> "
420+ syn match rubyEval " \% #=1\< eval\> "
421+ syn match rubyEval " \% #=1\<\% (class\| instance\| module\) _eval\> "
422+ syn match rubyException " \% #=1\<\% (raise\| fail\| catch\| throw\)\> "
423+ syn match rubyInclude " \% #=1\<\% (autoload\| gem\| load\| require\% (_relative\)\=\)\> "
424+ syn match rubyKeyword " \% #=1\<\% (callcc\| caller\| lambda\| proc\)\> "
425+ syn match rubyMacro " \% #=1\<\% (extend\| include\| prepend\| refine\| using\)\> "
426+ syn match rubyMacro " \% #=1\<\% (alias\| define\| define_singleton\| remove\| undef\) _method\> "
426427endif
427428
428429" Comments and Documentation {{{1
@@ -455,9 +456,9 @@ syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|&\.\|::\)\_s*\%([_[:lower:]][_
455456syn match rubyBangPredicateMethod " \% (\h\| [^\x 00-\x 7F]\)\% (\w\| [^\x 00-\x 7F]\) *[?!]"
456457
457458if ! exists (" ruby_no_special_methods" )
458- syn match rubyControl " \< exit!" display
459+ syn match rubyControl " \% #=1 \ < exit!" display
459460endif
460- syn match rubyDefinedOperator " \< defined?" display
461+ syn match rubyDefinedOperator " \% #=1 \ < defined?" display
461462
462463" 1.9-style Hash Keys and Keyword Parameters {{{1
463464syn match rubySymbol " \% ([{(|,]\_ s*\)\@ <=\% (\h\| [^\x 00-\x 7F]\)\% (\w\| [^\x 00-\x 7F]\) *[?!]\= ::\@ !" he =e - 1
0 commit comments