comparison contrib/vim/syntax/nginx.vim @ 7178:e2685c467496

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 25 Dec 2017 19:41:00 +0300
parents 7943298d4ac0
children f505aeaba752
comparison
equal deleted inserted replaced
7177:d91a8c4ac6bb 7178:e2685c467496
13 endif 13 endif
14 14
15 syn match ngxName '\([^;{} \t\\]\|\\.\)\+' 15 syn match ngxName '\([^;{} \t\\]\|\\.\)\+'
16 \ contains=@ngxDirectives 16 \ contains=@ngxDirectives
17 \ nextgroup=@ngxParams skipwhite skipempty 17 \ nextgroup=@ngxParams skipwhite skipempty
18 syn match ngxParam '\([^;{ \t\\]\|\\.\)\+' 18 syn match ngxParam '\(\${\|[^;{ \t\\]\|\\.\)\+'
19 \ contained 19 \ contained
20 \ contains=ngxVariable 20 \ contains=ngxVariable
21 \ nextgroup=@ngxParams skipwhite skipempty 21 \ nextgroup=@ngxParams skipwhite skipempty
22 syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ 22 syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+
23 \ contains=ngxVariableString 23 \ contains=ngxVariableString
27 syn match ngxSemicolon ';' contained 27 syn match ngxSemicolon ';' contained
28 syn region ngxBlock start=+{+ end=+}+ contained 28 syn region ngxBlock start=+{+ end=+}+ contained
29 \ contains=@ngxTopLevel 29 \ contains=@ngxTopLevel
30 syn match ngxComment '#.*$' 30 syn match ngxComment '#.*$'
31 31
32 syn match ngxVariable '\$\w\+' contained 32 syn match ngxVariable '\$\(\w\+\|{\w\+}\)' contained
33 syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained 33 syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
34 34
35 syn cluster ngxTopLevel 35 syn cluster ngxTopLevel
36 \ contains=ngxName,ngxString,ngxComment 36 \ contains=ngxName,ngxString,ngxComment
37 syn cluster ngxDirectives 37 syn cluster ngxDirectives
50 " listen directive 50 " listen directive
51 51
52 syn cluster ngxTopLevel add=ngxDirectiveListen 52 syn cluster ngxTopLevel add=ngxDirectiveListen
53 syn keyword ngxDirectiveListen listen 53 syn keyword ngxDirectiveListen listen
54 \ nextgroup=@ngxListenParams skipwhite skipempty 54 \ nextgroup=@ngxListenParams skipwhite skipempty
55 syn match ngxListenParam '\([^;{ \t\\]\|\\.\)\+' 55 syn match ngxListenParam '\(\${\|[^;{ \t\\]\|\\.\)\+'
56 \ contained 56 \ contained
57 \ nextgroup=@ngxListenParams skipwhite skipempty 57 \ nextgroup=@ngxListenParams skipwhite skipempty
58 syn region ngxListenString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ 58 syn region ngxListenString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+
59 \ contained 59 \ contained
60 \ nextgroup=@ngxListenParams skipwhite skipempty 60 \ nextgroup=@ngxListenParams skipwhite skipempty