~jocave/checkbox/hybrid-amd-gpu-mods

« back to all changes in this revision

Viewing changes to plainbox/contrib/pxu.vim

  • Committer: Zygmunt Krynicki
  • Date: 2013-05-29 07:50:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2153.
  • Revision ID: zygmunt.krynicki@canonical.com-20130529075030-ngwz245hs2u3y6us
checkbox: move current checkbox code into checkbox-old

This patch cleans up the top-level directory of the project into dedicated
sub-project directories. One for checkbox-old (the current checkbox and all the
associated stuff), one for plainbox and another for checkbox-ng.

There are some associated changes, such as updating the 'source' mode of
checkbox provider in plainbox, and fixing paths in various test scripts that we
have.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
" Vim syntax file
2
 
" Language:    PlainBox Unit Definition
3
 
" Maintainer:  Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
4
 
" Last Change: 2014 Mar 04
5
 
" URL: https://launchpad.net/checkbox
6
 
"
7
 
" This file is part of Checkbox.
8
 
"
9
 
" Copyright 2012 Canonical Ltd.
10
 
" Written by:
11
 
"   Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
12
 
"
13
 
" Checkbox is free software: you can redistribute it and/or modify
14
 
" it under the terms of the GNU General Public License version 3,
15
 
" as published by the Free Software Foundation.
16
 
"
17
 
" Checkbox is distributed in the hope that it will be useful,
18
 
" but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
" GNU General Public License for more details.
21
 
"
22
 
" You should have received a copy of the GNU General Public License
23
 
" along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.
24
 
 
25
 
" Standard syntax initialization
26
 
if version < 600
27
 
  syntax clear
28
 
elseif exists("b:current_syntax")
29
 
  finish
30
 
endif
31
 
 
32
 
" Should match case except for the keys of each field
33
 
syn case match
34
 
 
35
 
" Everything that is not explicitly matched by the rules below
36
 
syn match pxuElse "^.*$"
37
 
 
38
 
" Common separators
39
 
syn match pxuComma ", *"
40
 
syn match pxuSpace " "
41
 
 
42
 
" Define some common expressions we can use later on
43
 
syn match pxuPlugin contained "\%(shell\|manual\|local\|resource\|attachment\|user-interact\|user-verify\|user-interact-verify\)"
44
 
syn match pxuFlags contained "\%(preserve-locale\|expected-failure\|legacy-remote\|multi-node\)"
45
 
syn match pxuId contained "[a-z0-9][a-z0-9+./:-]\+"
46
 
syn match pxuVariable contained "\${.\{-}}"
47
 
syn match pxuSpecialVariable contained "\%(\$PLAINBOX_SESSION_SHARE\|\$PLAINBOX_PROVIDER_DATA\)"
48
 
syn match pxuDeprecatedVariable contained "\%(\$CHECKBOX_SHARE\|\$CHECKBOX_DATA\)"
49
 
syn match pxuEstimatedDuration contained "\<\d+(\.\d+)?\>"
50
 
syn match pxuColonColon contained "::"
51
 
 
52
 
" #-Comments
53
 
syn match pxuComment "^#.*$" contains=@Spell
54
 
 
55
 
syn case ignore
56
 
 
57
 
" leading dot in multi-line fields
58
 
syn match pxuLeadingDot contained "^\s+\."
59
 
 
60
 
" List of all legal keys
61
 
syn match pxuKey contained "^\%(id\|plugin\|_?summary\|_?description\|requires\|depends\|estimated_duration\|command\|user\|environ\|flags\): *"
62
 
 
63
 
syn match pxuDeprecatedKey contained "^\%(name\): *"
64
 
 
65
 
" Fields for which we do strict syntax checking
66
 
syn region pxuStrictField start="^id" end="$" contains=pxuKey,pxuId,pxuSpace oneline
67
 
syn region pxuStrictField start="^plugin" end="$" contains=pxuKey,pxuPlugin,pxuSpace oneline
68
 
syn region pxuStrictField start="^flags" end="$" contains=pxuKey,pxuFlags,pxuSpace oneline
69
 
syn region pxuStrictField start="^estimated_duration" end="$" contains=pxuKey,pxuEstimatedDuration,pxuSpace oneline
70
 
 
71
 
" Catch-all for the other legal fields
72
 
syn region pxuField start="^\%(id\|plugin\|_?summary\|_?description\|requires\|depends\|estimated_duration\|command\|user\|environ\):" end="$" contains=pxuKey,pxuDeprecatedKey,pxuVariable,pxuColonColon,pxuId oneline
73
 
syn region pxuMultiField start="^\%(command\|depends\|requires\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=pxuKey,pxuDeprecatedkey,pxuVariable,pxuSpecialVariable,pxuDeprecatedVariable,pxuId,pxuComment,pxuLeadingDot
74
 
syn region pxuMultiFieldSpell start="^_?\%(description\|summary\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=pxuKey,pxuDeprecatedKey,pxuComment,pxuLeadingDot,@Spell
75
 
 
76
 
" Associate our matches and regions with pretty colours
77
 
if version >= 508 || !exists("did_pxu_syn_inits")
78
 
  if version < 508
79
 
    let did_pxu_syn_inits = 1
80
 
    command -nargs=+ HiLink hi link <args>
81
 
  else
82
 
    command -nargs=+ HiLink hi def link <args>
83
 
  endif
84
 
 
85
 
  HiLink pxuPlugin                 Keyword
86
 
  HiLink pxuKey                    Keyword
87
 
  HiLink pxuField                  Normal
88
 
  HiLink pxuStrictField            Error
89
 
  HiLink pxuDeprecatedKey          Error
90
 
  HiLink pxuDeprecatedVariable     Error
91
 
  HiLink pxuEstimatedDuratin       Float
92
 
  HiLink pxuMultiField             Normal
93
 
  HiLink pxuMultiFieldSpell        Normal
94
 
  HiLink pxuId                     Identifier
95
 
  HiLink pxuFlags                  Identifier
96
 
  HiLink pxuVariable               Identifier
97
 
  HiLink pxuSpecialVariable        Identifier
98
 
  HiLink pxuComment                Comment
99
 
  HiLink pxuElse                   Special
100
 
  HiLink pxuLeadingDot             Error
101
 
  HiLink pxuColonColon             Keyword
102
 
 
103
 
  delcommand HiLink
104
 
endif
105
 
 
106
 
let b:current_syntax = "pxu"
107
 
 
108
 
" vim: ts=4 sw=4