annotate runtime/syntax/upstart.vim @ 3210:767bb493e7d3 v7.3.375

updated for version 7.3.375 Problem: Duplicate return statement. Solution: Remove the superfluous one. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Wed, 14 Dec 2011 15:07:29 +0100
parents 6f63330ec225
children af1e8a1714c2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: Upstart job files
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Michael Biebl <biebl@debian.org>
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 " James Hunt <james.hunt@ubuntu.com>
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 " Last Change: 2011 Mar 22
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 " License: GPL v2
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 " Version: 0.4
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 " Remark: Syntax highlighting for Upstart (init(8)) job files.
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 "
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 " It is inspired by the initng syntax file and includes sh.vim to do the
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 " highlighting of script blocks.
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 if version < 600
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 syntax clear
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 elseif exists("b:current_syntax")
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 finish
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 endif
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 let is_bash = 1
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 syn include @Shell syntax/sh.vim
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 syn case match
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 " avoid need to use 'match' for most events
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 setlocal iskeyword+=-
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 syn match upstartComment /#.*$/ contains=upstartTodo
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 syn keyword upstartTodo TODO FIXME contained
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 syn region upstartString start=/"/ end=/"/ skip=/\\"/
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 syn region upstartScript matchgroup=upstartStatement start="script" end="end script" contains=@upstartShellCluster
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 syn cluster upstartShellCluster contains=@Shell
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 " one argument
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 syn keyword upstartStatement description author version instance expect
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 syn keyword upstartStatement pid kill normal console env exit export
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 syn keyword upstartStatement umask nice oom chroot chdir exec
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 " two arguments
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 syn keyword upstartStatement limit
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 " one or more arguments (events)
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 syn keyword upstartStatement emits
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 syn keyword upstartStatement on start stop
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 " flag, no parameter
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 syn keyword upstartStatement respawn service instance manual debug task
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 " prefix for exec or script
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 syn keyword upstartOption pre-start post-start pre-stop post-stop
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 " option for kill
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 syn keyword upstartOption timeout
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 " option for oom
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 syn keyword upstartOption never
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59 " options for console
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 syn keyword upstartOption output owner
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 " options for expect
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 syn keyword upstartOption fork daemon
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63 " options for limit
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64 syn keyword upstartOption unlimited
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 " 'options' for start/stop on
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 syn keyword upstartOption and or
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 " Upstart itself and associated utilities
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 syn keyword upstartEvent runlevel
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 syn keyword upstartEvent started
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 syn keyword upstartEvent starting
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 syn keyword upstartEvent startup
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74 syn keyword upstartEvent stopped
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 syn keyword upstartEvent stopping
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 syn keyword upstartEvent control-alt-delete
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
77 syn keyword upstartEvent keyboard-request
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78 syn keyword upstartEvent power-status-changed
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 " D-Bus
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 syn keyword upstartEvent dbus-activation
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 " Display Manager (ie gdm)
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
84 syn keyword upstartEvent desktop-session-start
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
85 syn keyword upstartEvent login-session-start
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
86
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87 " mountall
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
88 syn keyword upstartEvent all-swaps
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 syn keyword upstartEvent filesystem
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
90 syn keyword upstartEvent mounted
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
91 syn keyword upstartEvent mounting
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
92 syn keyword upstartEvent local-filesystems
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
93 syn keyword upstartEvent remote-filesystems
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
94 syn keyword upstartEvent virtual-filesystems
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
95
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
96 " SysV umountnfs.sh
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
97 syn keyword upstartEvent mounted-remote-filesystems
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
98
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
99 " upstart-udev-bridge and ifup/down
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
100 syn match upstartEvent /\<\i\{-1,}-device-\(added\|removed\|up\|down\)/
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
101
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
102 " upstart-socket-bridge
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
103 syn keyword upstartEvent socket
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
104
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
105 hi def link upstartComment Comment
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
106 hi def link upstartTodo Todo
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 hi def link upstartString String
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
108 hi def link upstartStatement Statement
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
109 hi def link upstartOption Type
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
110 hi def link upstartEvent Define
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
111
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
112 let b:current_syntax = "upstart"