summaryrefslogtreecommitdiffstats
path: root/ext/vim
diff options
context:
space:
mode:
authorDominic Cleal <dcleal@redhat.com>2010-11-27 13:36:04 +0000
committerDominic Cleal <dcleal@redhat.com>2010-11-27 13:36:04 +0000
commitafe2d014feb2210a8666c93465d11e9c9d555f8b (patch)
tree208f5ac82b2c29610d2021821c8fca9b079e638b /ext/vim
parent143fc744a839affd328234fca26246d49d15d3d8 (diff)
parent4b35402ba85d8842d757becec5c8a7bf4d6f6654 (diff)
downloadpuppet-afe2d014feb2210a8666c93465d11e9c9d555f8b.tar.gz
puppet-afe2d014feb2210a8666c93465d11e9c9d555f8b.tar.xz
puppet-afe2d014feb2210a8666c93465d11e9c9d555f8b.zip
Merge branch 'master' of github.com:domcleal/puppet into master-old
Diffstat (limited to 'ext/vim')
-rw-r--r--ext/vim/syntax/puppet.vim11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/vim/syntax/puppet.vim b/ext/vim/syntax/puppet.vim
index 80cd91c6c..96052104d 100644
--- a/ext/vim/syntax/puppet.vim
+++ b/ext/vim/syntax/puppet.vim
@@ -19,7 +19,7 @@ endif
" match class/definition/node declarations
syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe
syn keyword puppetDefType class define node inherits contained
-syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument
+syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument,puppetString
syn match puppetArgument "\w\+" contained
syn match puppetArgument "\$\w\+" contained
syn match puppetArgument "'[^']+'" contained
@@ -33,6 +33,7 @@ syn match puppetNodeRe "/.*/" contained
"FIXME: "Foo-bar" doesn't get highlighted as expected, although "foo-bar" does.
syn match puppetInstance "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)*\s*{" contains=puppetTypeName,puppetTypeDefault
syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*[[{]" contains=puppetTypeName,puppetTypeDefault
+syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*<\?<|" contains=puppetTypeName,puppetTypeDefault
syn match puppetTypeName "[a-z]\w*" contained
syn match puppetTypeDefault "[A-Z]\w*" contained
@@ -56,19 +57,19 @@ syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fai
" rvalues
syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
-syn match puppetVariable "$\w\+"
-syn match puppetVariable "${\w\+}"
+syn match puppetVariable "$[a-zA-Z0-9_:]\+"
+syn match puppetVariable "${[a-zA-Z0-9_:]\+}"
" match anything between simple/double quotes.
" don't match variables if preceded by a backslash.
syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+
syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable
-syn match puppetString "/.*/"
+syn match puppetString "/[^/]*/"
syn match puppetNotVariable "\\$\w\+" contained
syn match puppetNotVariable "\\${\w\+}" contained
syn keyword puppetKeyword import inherits include
-syn keyword puppetControl case default if else
+syn keyword puppetControl case default if else elsif
syn keyword puppetSpecial true false undef
" comments last overriding everything else