<div dir="ltr"><div>More info about this patch.<br><br>Before the patch<br><a href="https://www.flickr.com/photos/othree/24844596133/">https://www.flickr.com/photos/othree/24844596133/</a><br><br></div><div>After the patch<br><a href="https://www.flickr.com/photos/othree/25471327825/">https://www.flickr.com/photos/othree/25471327825/</a><br><br></div><div>The major difference is the `rewrite ` directives are correct now.<br></div><div>Old syntax had wrong syntax on rewrite if following regexp have character `{`.<br></div><div>Which have special function in regexp.<br><br></div><div>The easiest way to solve this issue is to remove the `ngxBlock` definition.<br></div><div><br>Cons of this patch:<br><br></div><div>Old syntax have some debug feature. (incorrect directive follow by `{}` block will not highlight)<br></div><div>New syntax don't have this feature.<br></div><div><br></div><div>If want to have both correct syntax and debug feature.<br></div><div>Will lead to more complete syntax definition.<br></div><div>And will be slower.<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-03 23:11 GMT+08:00 OOO <span dir="ltr"><<a href="mailto:othree@gmail.com" target="_blank">othree@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"># HG changeset patch<br># User Kao, Wei-Ko(othree) <<a href="mailto:othree@gmail.com" target="_blank">othree@gmail.com</a>><br># Date 1457016287 -28800<br>#      Thu Mar 03 22:44:47 2016 +0800<br># Node ID 078464d1da32d30b0edef6f441d750765c1a4110<br># Parent  3b9fe734a76ca0863ec87596369690831e9f4086<br>Contrib: removed ngxBlock syntax group<br><br>ngxBlock syntax group is not design well. If any directive's parameter<br>have `{`, then the syntax highlight of that directive will incorrect.<br><br>diff -r 3b9fe734a76c -r 078464d1da32 contrib/vim/syntax/nginx.vim<br>--- a/contrib/vim/syntax/nginx.vim    Tue Mar 01 15:18:07 2016 +0300<br>+++ b/contrib/vim/syntax/nginx.vim    Thu Mar 03 22:44:47 2016 +0800<br>@@ -10,28 +10,26 @@<br> setlocal iskeyword+=:<br> <br> syn match ngxVariable '\$\(\w\+\|{\w\+}\)'<br>-syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained<br> syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained<br>-syn region ngxBlock start=+^+ end=+{+ skip=+\${+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline<br> syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString<br> syn match ngxComment ' *#.*$'<br> <br> syn keyword ngxBoolean on<br> syn keyword ngxBoolean off<br> <br>-syn keyword ngxDirectiveBlock http         contained<br>-syn keyword ngxDirectiveBlock mail         contained<br>-syn keyword ngxDirectiveBlock events       contained<br>-syn keyword ngxDirectiveBlock server       contained<br>-syn keyword ngxDirectiveBlock types        contained<br>-syn keyword ngxDirectiveBlock location     contained<br>-syn keyword ngxDirectiveBlock upstream     contained<br>-syn keyword ngxDirectiveBlock charset_map  contained<br>-syn keyword ngxDirectiveBlock limit_except contained<br>-syn keyword ngxDirectiveBlock if           contained<br>-syn keyword ngxDirectiveBlock geo          contained<br>-syn keyword ngxDirectiveBlock map          contained<br>-syn keyword ngxDirectiveBlock split_clients contained<br>+syn keyword ngxDirectiveBlock http<br>+syn keyword ngxDirectiveBlock mail<br>+syn keyword ngxDirectiveBlock events<br>+syn keyword ngxDirectiveBlock server<br>+syn keyword ngxDirectiveBlock types<br>+syn keyword ngxDirectiveBlock location<br>+syn keyword ngxDirectiveBlock upstream<br>+syn keyword ngxDirectiveBlock charset_map<br>+syn keyword ngxDirectiveBlock limit_except<br>+syn keyword ngxDirectiveBlock if<br>+syn keyword ngxDirectiveBlock geo<br>+syn keyword ngxDirectiveBlock map<br>+syn keyword ngxDirectiveBlock split_clients<br> <br> syn keyword ngxDirectiveImportant include<br> syn keyword ngxDirectiveImportant root<br>@@ -819,9 +817,7 @@<br> <br> hi link ngxComment Comment<br> hi link ngxVariable Identifier<br>-hi link ngxVariableBlock Identifier<br> hi link ngxVariableString PreProc<br>-hi link ngxBlock Normal<br> hi link ngxString String<br> <br> hi link ngxBoolean Boolean<span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div>OOO</div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">OOO</div>
</div>