[nginx] Contrib: updated vim syntax rules for variables.

Maxim Dounin mdounin at mdounin.ru
Mon Dec 25 17:37:59 UTC 2017


details:   http://hg.nginx.org/nginx/rev/e2685c467496
branches:  
changeset: 7178:e2685c467496
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Dec 25 19:41:00 2017 +0300
description:
Contrib: updated vim syntax rules for variables.

Non-quoted parameters are allowed to contain variables in curly brackets
(see d91a8c4ac6bb), so vim syntax rules were adjusted accordingly.

diffstat:

 contrib/vim/syntax/nginx.vim |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff --git a/contrib/vim/syntax/nginx.vim b/contrib/vim/syntax/nginx.vim
--- a/contrib/vim/syntax/nginx.vim
+++ b/contrib/vim/syntax/nginx.vim
@@ -15,7 +15,7 @@ endif
 syn match ngxName '\([^;{} \t\\]\|\\.\)\+'
     \ contains=@ngxDirectives
     \ nextgroup=@ngxParams skipwhite skipempty
-syn match ngxParam '\([^;{ \t\\]\|\\.\)\+'
+syn match ngxParam '\(\${\|[^;{ \t\\]\|\\.\)\+'
     \ contained
     \ contains=ngxVariable
     \ nextgroup=@ngxParams skipwhite skipempty
@@ -29,7 +29,7 @@ syn region ngxBlock start=+{+ end=+}+ co
     \ contains=@ngxTopLevel
 syn match ngxComment '#.*$'
 
-syn match ngxVariable '\$\w\+' contained
+syn match ngxVariable '\$\(\w\+\|{\w\+}\)' contained
 syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
 
 syn cluster ngxTopLevel
@@ -52,7 +52,7 @@ syn cluster ngxParams add=ngxBoolean
 syn cluster ngxTopLevel add=ngxDirectiveListen
 syn keyword ngxDirectiveListen listen
     \ nextgroup=@ngxListenParams skipwhite skipempty
-syn match ngxListenParam '\([^;{ \t\\]\|\\.\)\+'
+syn match ngxListenParam '\(\${\|[^;{ \t\\]\|\\.\)\+'
     \ contained
     \ nextgroup=@ngxListenParams skipwhite skipempty
 syn region ngxListenString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+


More information about the nginx-devel mailing list