PATCH: add support for %W() literals

Doug Kearns djkea2 at mugca.its.monash.edu.au
Tue Aug 26 01:44:59 EDT 2003


This adds support for the new %W() word list with interpolation
literals. It also adds folding support to %q() quoted strings and %w()
words list literals. Is there any reason not to extend this folding
support to all strings?

Thanks,
Doug

Index: syntax/ruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v
retrieving revision 1.9
diff -u -r1.9 ruby.vim
--- syntax/ruby.vim	24 Aug 2003 12:26:45 -0000	1.9
+++ syntax/ruby.vim	25 Aug 2003 14:29:12 -0000
@@ -89,61 +89,61 @@
 syn region rubyString matchgroup=rubyStringDelimit start="%r("  end=")[iomx]*"  skip="\\\\\|\\)"  contains=rubyExprSubst fold
 
 " Generalized Single Quoted String and Array of Strings
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]!"  end="!"  skip="\\\\\|\\!"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\"" end="\"" skip="\\\\\|\\\""
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]#"  end="#"  skip="\\\\\|\\#"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\$" end="\$" skip="\\\\\|\\\$"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]%"  end="%"  skip="\\\\\|\\%"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]&"  end="&"  skip="\\\\\|\\&"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]'"  end="'"  skip="\\\\\|\\'"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\*" end="\*" skip="\\\\\|\\\*"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]+"  end="+"  skip="\\\\\|\\+"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]-"  end="-"  skip="\\\\\|\\-"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\." end="\." skip="\\\\\|\\\."
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]/"  end="/"  skip="\\\\\|\\/"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]:"  end=":"  skip="\\\\\|\\:"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq];"  end=";"  skip="\\\\\|\\;"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]="  end="="  skip="\\\\\|\\="
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]?"  end="?"  skip="\\\\\|\\?"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]@"  end="@"  skip="\\\\\|\\@"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\\" end="\\"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\^" end="\^" skip="\\\\\|\\\^"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]`"  end="`"  skip="\\\\\|\\`"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]|"  end="|"  skip="\\\\\|\\|"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\~" end="\~" skip="\\\\\|\\\~"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]{"  end="}"  skip="\\\\\|\\}"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]<"  end=">"  skip="\\\\\|\\>"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\[" end="\]" skip="\\\\\|\\\]"
-syn region rubyString matchgroup=rubyStringDelimit start="%[wq]("  end=")"  skip="\\\\\|\\)"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]!"  end="!"  skip="\\\\\|\\!"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\"" end="\"" skip="\\\\\|\\\""	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]#"  end="#"  skip="\\\\\|\\#"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\$" end="\$" skip="\\\\\|\\\$"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]%"  end="%"  skip="\\\\\|\\%"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]&"  end="&"  skip="\\\\\|\\&"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]'"  end="'"  skip="\\\\\|\\'"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\*" end="\*" skip="\\\\\|\\\*"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]+"  end="+"  skip="\\\\\|\\+"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]-"  end="-"  skip="\\\\\|\\-"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\." end="\." skip="\\\\\|\\\."	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]/"  end="/"  skip="\\\\\|\\/"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]:"  end=":"  skip="\\\\\|\\:"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq];"  end=";"  skip="\\\\\|\\;"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]="  end="="  skip="\\\\\|\\="	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]?"  end="?"  skip="\\\\\|\\?"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]@"  end="@"  skip="\\\\\|\\@"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\\" end="\\"			fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\^" end="\^" skip="\\\\\|\\\^"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]`"  end="`"  skip="\\\\\|\\`"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]|"  end="|"  skip="\\\\\|\\|"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\~" end="\~" skip="\\\\\|\\\~"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]{"  end="}"  skip="\\\\\|\\}"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]<"  end=">"  skip="\\\\\|\\>"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\[" end="\]" skip="\\\\\|\\\]"	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]("  end=")"  skip="\\\\\|\\)"	fold
 
-" Generalized Double Quoted String and Shell Command Output
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=!"  end="!"  skip="\\\\\|\\!"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\"" end="\"" skip="\\\\\|\\\"" contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=#"  end="#"  skip="\\\\\|\\#"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\$" end="\$" skip="\\\\\|\\\$" contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=%"  end="%"  skip="\\\\\|\\%"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=&"  end="&"  skip="\\\\\|\\&"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\='"  end="'"  skip="\\\\\|\\'"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\*" end="\*" skip="\\\\\|\\\*" contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=+"  end="+"  skip="\\\\\|\\+"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=-"  end="-"  skip="\\\\\|\\-"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\." end="\." skip="\\\\\|\\\." contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=/"  end="/"  skip="\\\\\|\\/"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=:"  end=":"  skip="\\\\\|\\:"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=;"  end=";"  skip="\\\\\|\\;"  contains=rubyExprSubst
-"syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=="    end="="  skip="\\\\\|\\="  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]="    end="="  skip="\\\\\|\\="  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=?"  end="?"  skip="\\\\\|\\?"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=@"  end="@"  skip="\\\\\|\\@"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\\" end="\\"			contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\^" end="\^" skip="\\\\\|\\\^" contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=`"  end="`"  skip="\\\\\|\\`"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=|"  end="|"  skip="\\\\\|\\|"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\~" end="\~" skip="\\\\\|\\\~" contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\={"  end="}"  skip="\\\\\|\\}"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=<"  end=">"  skip="\\\\\|\\>"  contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\[" end="\]" skip="\\\\\|\\\]" contains=rubyExprSubst
-syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=("  end=")"  skip="\\\\\|\\)"  contains=rubyExprSubst
+" Generalized Double Quoted String and Array of Strings and Shell Command Output
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=!"  end="!"  skip="\\\\\|\\!"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=\"" end="\"" skip="\\\\\|\\\"" contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=#"  end="#"  skip="\\\\\|\\#"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=\$" end="\$" skip="\\\\\|\\\$" contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=%"  end="%"  skip="\\\\\|\\%"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=&"  end="&"  skip="\\\\\|\\&"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\='"  end="'"  skip="\\\\\|\\'"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=\*" end="\*" skip="\\\\\|\\\*" contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=+"  end="+"  skip="\\\\\|\\+"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=-"  end="-"  skip="\\\\\|\\-"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=\." end="\." skip="\\\\\|\\\." contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=/"  end="/"  skip="\\\\\|\\/"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=:"  end=":"  skip="\\\\\|\\:"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=;"  end=";"  skip="\\\\\|\\;"  contains=rubyExprSubst	fold
+"syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=="    end="="  skip="\\\\\|\\="  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]="    end="="  skip="\\\\\|\\="  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=?"  end="?"  skip="\\\\\|\\?"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=@"  end="@"  skip="\\\\\|\\@"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=\\" end="\\"			 contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=\^" end="\^" skip="\\\\\|\\\^" contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=`"  end="`"  skip="\\\\\|\\`"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=|"  end="|"  skip="\\\\\|\\|"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=\~" end="\~" skip="\\\\\|\\\~" contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\={"  end="}"  skip="\\\\\|\\}"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=<"  end=">"  skip="\\\\\|\\>"  contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=rubyExprSubst	fold
+syn region rubyString matchgroup=rubyStringDelimit start="%[QWx]\=("  end=")"  skip="\\\\\|\\)"  contains=rubyExprSubst	fold
 
 " Normal String and Shell Command Output
 syn region rubyString matchgroup=rubyStringDelimit start="\"" end="\"" skip="\\\\\|\\\"" contains=rubyExprSubst


More information about the vim-ruby-devel mailing list