Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

Commit

Permalink
vim: match regexp language features
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Fournier <marc.fournier@camptocamp.com>
  • Loading branch information
Marc Fournier authored and jamtur01 committed Sep 9, 2009
1 parent 78c1f1a commit 502e520
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion syntax/puppet.vim
Expand Up @@ -17,14 +17,15 @@ elseif exists("b:current_syntax")
endif endif


" match class/definition/node declarations " match class/definition/node declarations
syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe
syn keyword puppetDefType class define node inherits contained syn keyword puppetDefType class define node inherits contained
syn region puppetDefArguments start="(" end=")" contains=puppetArgument syn region puppetDefArguments start="(" end=")" contains=puppetArgument
syn match puppetArgument "\w\+" contained syn match puppetArgument "\w\+" contained
syn match puppetArgument "\$\w\+" contained syn match puppetArgument "\$\w\+" contained
syn match puppetArgument "'[^']+'" contained syn match puppetArgument "'[^']+'" contained
syn match puppetArgument '"[^"]+"' contained syn match puppetArgument '"[^"]+"' contained
syn match puppetDefName "\w\+" contained syn match puppetDefName "\w\+" contained
syn match puppetNodeRe "/.*/" contained


" match 'foo' in 'class foo { ...' " match 'foo' in 'class foo { ...'
" match 'foo::bar' in 'class foo::bar { ...' " match 'foo::bar' in 'class foo::bar { ...'
Expand Down Expand Up @@ -60,6 +61,7 @@ syn match puppetVariable "${\w\+}"
" don't match variables if preceded by a backslash. " don't match variables if preceded by a backslash.
syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+ syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+
syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable
syn match puppetString "/.*/"
syn match puppetNotVariable "\\$\w\+" contained syn match puppetNotVariable "\\$\w\+" contained
syn match puppetNotVariable "\\${\w\+}" contained syn match puppetNotVariable "\\${\w\+}" contained


Expand Down Expand Up @@ -97,6 +99,7 @@ if version >= 508 || !exists("did_puppet_syn_inits")
HiLink puppetControl Statement HiLink puppetControl Statement
HiLink puppetDefType Define HiLink puppetDefType Define
HiLink puppetDefName Type HiLink puppetDefName Type
HiLink puppetNodeRe Type
HiLink puppetTypeName Statement HiLink puppetTypeName Statement
HiLink puppetTypeDefault Type HiLink puppetTypeDefault Type
HiLink puppetParamName Identifier HiLink puppetParamName Identifier
Expand Down

0 comments on commit 502e520

Please sign in to comment.