~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to ext/vim/puppet.vim

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2008-07-26 15:43:45 UTC
  • mto: (3.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080726154345-1fmgo76b4l72ulvc
ImportĀ upstreamĀ versionĀ 0.24.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
" puppet syntax file
2
 
" Filename:     puppet.vim
3
 
" Language:     puppet configuration file 
4
 
" Maintainer:   Luke Kanies <luke@madstop.com>
5
 
" URL:          http://reductivelabs.com/svn/puppet/trunk/ext/vim/puppet.vim
6
 
" Last Change: 
7
 
" Version:      
8
 
"
9
 
" $Id: puppet.vim 875 2006-02-07 23:56:16Z luke $
10
 
 
11
 
" Copied from the cfengine, ruby, and perl syntax files
12
 
" For version 5.x: Clear all syntax items
13
 
" For version 6.x: Quit when a syntax file was already loaded
14
 
if version < 600
15
 
  syntax clear
16
 
elseif exists("b:current_syntax")
17
 
  finish
18
 
endif
19
 
 
20
 
syn region  puppetDefine        start="^\s*\(class\|define\|site\|node\)" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments
21
 
syn keyword puppetDefType       class define site node inherits contained
22
 
syn keyword puppetInherits      inherits contained
23
 
syn region  puppetDefArguments  start="(" end=")" contains=puppetArgument
24
 
syn match   puppetArgument      "\w\+" contained
25
 
syn match   puppetDefName     "\w\+" contained
26
 
 
27
 
syn match   puppetInstance           "\w\+\s*{" contains=puppetTypeBrace,puppetTypeName,puppetTypeDefault
28
 
syn match   puppetTypeBrace       "{" contained
29
 
syn match   puppetTypeName       "[a-z]\w*" contained
30
 
syn match   puppetTypeDefault    "[A-Z]\w*" contained
31
 
 
32
 
syn match   puppetParam           "\w\+\s*=>" contains=puppetTypeRArrow,puppetParamName
33
 
syn match   puppetParamRArrow       "=>" contained
34
 
syn match   puppetParamName       "\w\+" contained
35
 
syn match   puppetVariable           "$\w\+"
36
 
syn match   puppetVariable           "${\w\+}"
37
 
syn match   puppetParen           "("
38
 
syn match   puppetParen           ")"
39
 
syn match   puppetBrace           "{"
40
 
syn match   puppetBrace           "}"
41
 
 
42
 
syn region  puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable
43
 
 
44
 
syn keyword puppetBoolean    true false 
45
 
syn keyword puppetKeyword    import inherits include
46
 
syn keyword puppetControl    case default 
47
 
 
48
 
" comments last overriding everything else
49
 
syn match   puppetComment            "\s*#.*$" contains=puppetTodo
50
 
syn keyword puppetTodo               TODO NOTE FIXME XXX contained
51
 
 
52
 
" Define the default highlighting.
53
 
" For version 5.7 and earlier: only when not done already
54
 
" For version 5.8 and later: only when an item doesn't have highlighting yet
55
 
if version >= 508 || !exists("did_puppet_syn_inits")
56
 
  if version < 508
57
 
    let did_puppet_syn_inits = 1
58
 
    command -nargs=+ HiLink hi link <args>
59
 
  else
60
 
    command -nargs=+ HiLink hi def link <args>
61
 
  endif
62
 
 
63
 
  HiLink puppetVariable             Identifier
64
 
  HiLink puppetBoolean              Boolean
65
 
  HiLink puppetType                 Identifier
66
 
  HiLink puppetDefault              Identifier
67
 
  HiLink puppetKeyword              Define
68
 
  HiLink puppetTypeDefs             Define
69
 
  HiLink puppetComment              Comment
70
 
  HiLink puppetString               String
71
 
  HiLink puppetTodo                 Todo
72
 
"  HiLink puppetBrace                Delimiter
73
 
"  HiLink puppetTypeBrace            Delimiter
74
 
"  HiLink puppetParen                Delimiter
75
 
  HiLink puppetDelimiter            Delimiter
76
 
  HiLink puppetControl              Statement
77
 
  HiLink puppetDefType              Define
78
 
  HiLink puppetDefName              Type
79
 
  HiLink puppetTypeName             Statement
80
 
  HiLink puppetTypeDefault          Type
81
 
  HiLink puppetParamName            Identifier
82
 
  HiLink puppetArgument             Identifier
83
 
 
84
 
  delcommand HiLink
85
 
endif
86
 
 
87
 
let b:current_syntax = "puppet"