Hello All,

The JavaScript syntax file does not currently highlight regular
expression literals which contain any modifiers other than g and/or i.
So, for example, the following literal would not be highlighted

/^Match me$/gm

ECMA-262 edition 5.1[1] defines the flags in the syntax in §7.8.5 as
being any IdentifierPart, although it is currently limited to the
characters "g", "i", and "m" in §15.10.4.1.  Mozilla also supports
a non-standard "y" modifier.[2]  I am not aware of any others.

The attached patch adds support for the "m" modifier.

I tried emailing this to Claudio Fleiner, who is listed as the current
maintainer in the file header 2 weeks ago, but since I haven't
received a response, I decided to follow-up here.  I hope that is not
a severe breach of protocol.

Thanks for considering,
Kevin


1.  
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262%20edition%205.1,%20June%202011.pdf
2.  
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


diff -r c61da758a9a2 runtime/syntax/javascript.vim
--- a/runtime/syntax/javascript.vim	Wed Apr 24 18:34:45 2013 +0200
+++ b/runtime/syntax/javascript.vim	Thu Apr 25 21:50:32 2013 -0600
@@ -42,7 +42,7 @@
 
 syn match   javaScriptSpecialCharacter "'\\.'"
 syn match   javaScriptNumber	       "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
-syn region  javaScriptRegexpString     start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
+syn region  javaScriptRegexpString     start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gim]\{0,2\}\s*$+ end=+/[gim]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
 
 syn keyword javaScriptConditional	if else switch
 syn keyword javaScriptRepeat		while for do in

Raspunde prin e-mail lui