Created
June 12, 2013 13:48
-
-
Save shirosaki/5765418 to your computer and use it in GitHub Desktop.
Fix performance of ruby syntax for new regexp engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/syntax/ruby.vim b/syntax/ruby.vim | |
index e4bc98f..dac2d1a 100644 | |
--- a/syntax/ruby.vim | |
+++ b/syntax/ruby.vim | |
@@ -117,10 +117,7 @@ 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 | |
-syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>\%(\s*(\)\@!" | |
-syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(DATA\|FALSE\|NIL\)\>\%(\s*(\)\@!" | |
-syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!" | |
-syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!" | |
+syn match rubyPredefinedConstant "\%([^.]\.\_s*\)\@<!\%(MatchingData\|ARG\(F\|V\)\|ENV\|DATA\|FALSE\|NIL\|STD\(ERR\|IN\|OUT\)\|TOPLEVEL_BINDING\|TRUE\|RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!" | |
" Normal Regular Expression | |
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment