All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
3 " Language: puppet configuration file
4 " Maintainer: Luke Kanies <luke@madstop.com>
10 " Copied from the cfengine, ruby, and perl syntax files
11 " For version 5.x: Clear all syntax items
12 " For version 6.x: Quit when a syntax file was already loaded
15 elseif exists("b:current_syntax")
19 syn region puppetDefine start="^\s*\(class\|define\|site\|node\)" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments
20 syn keyword puppetDefType class define site node inherits contained
21 syn keyword puppetInherits inherits contained
22 syn region puppetDefArguments start="(" end=")" contains=puppetArgument
23 syn match puppetArgument "\w\+" contained
24 syn match puppetArgument "\$\w\+" contained
25 syn match puppetArgument "'[^']+'" contained
26 syn match puppetArgument '"[^"]+"' contained
27 syn match puppetDefName "\w\+" contained
29 syn match puppetInstance "\w\+\s*{" contains=puppetTypeBrace,puppetTypeName,puppetTypeDefault
30 syn match puppetTypeBrace "{" contained
31 syn match puppetTypeName "[a-z]\w*" contained
32 syn match puppetTypeDefault "[A-Z]\w*" contained
34 syn match puppetParam "\w\+\s*=>" contains=puppetTypeRArrow,puppetParamName
35 syn match puppetParamRArrow "=>" contained
36 syn match puppetParamName "\w\+" contained
37 syn match puppetVariable "$\w\+"
38 syn match puppetVariable "${\w\+}"
39 syn match puppetParen "("
40 syn match puppetParen ")"
41 syn match puppetBrace "{"
42 syn match puppetBrace "}"
44 syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable
46 syn keyword puppetBoolean true false
47 syn keyword puppetKeyword import inherits include
48 syn keyword puppetControl case default
50 " comments last overriding everything else
51 syn match puppetComment "\s*#.*$" contains=puppetTodo
52 syn keyword puppetTodo TODO NOTE FIXME XXX contained
54 " Define the default highlighting.
55 " For version 5.7 and earlier: only when not done already
56 " For version 5.8 and later: only when an item doesn't have highlighting yet
57 if version >= 508 || !exists("did_puppet_syn_inits")
59 let did_puppet_syn_inits = 1
60 command -nargs=+ HiLink hi link <args>
62 command -nargs=+ HiLink hi def link <args>
65 HiLink puppetVariable Identifier
66 HiLink puppetBoolean Boolean
67 HiLink puppetType Identifier
68 HiLink puppetDefault Identifier
69 HiLink puppetKeyword Define
70 HiLink puppetTypeDefs Define
71 HiLink puppetComment Comment
72 HiLink puppetString String
73 HiLink puppetTodo Todo
74 " HiLink puppetBrace Delimiter
75 " HiLink puppetTypeBrace Delimiter
76 " HiLink puppetParen Delimiter
77 HiLink puppetDelimiter Delimiter
78 HiLink puppetControl Statement
79 HiLink puppetDefType Define
80 HiLink puppetDefName Type
81 HiLink puppetTypeName Statement
82 HiLink puppetTypeDefault Type
83 HiLink puppetParamName Identifier
84 HiLink puppetArgument Identifier
89 let b:current_syntax = "puppet"