summaryrefslogtreecommitdiffstats
path: root/bitbake/contrib/vim
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-02-10 10:13:42 +0000
committerRichard Purdie <richard@openedhand.com>2006-02-10 10:13:42 +0000
commite068eea7850a859bb0fe00bcb3b029ec63a6ce66 (patch)
tree9fe7edbe10647d95b3e2801e921c29c2cbb70702 /bitbake/contrib/vim
parentc6a95b3e1bc01e149e344097687a6c3fae20d522 (diff)
downloadpoky-e068eea7850a859bb0fe00bcb3b029ec63a6ce66.tar.gz
Update bitbake to latest bitbake svn
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@264 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/contrib/vim')
-rw-r--r--bitbake/contrib/vim/syntax/bitbake.vim120
1 files changed, 120 insertions, 0 deletions
diff --git a/bitbake/contrib/vim/syntax/bitbake.vim b/bitbake/contrib/vim/syntax/bitbake.vim
new file mode 100644
index 0000000000..5d2bc633e1
--- /dev/null
+++ b/bitbake/contrib/vim/syntax/bitbake.vim
@@ -0,0 +1,120 @@
1" Vim syntax file
2"
3" Copyright (C) 2004 Chris Larson <kergoth@handhelds.org>
4" This file is licensed under the MIT license, see COPYING.MIT in
5" this source distribution for the terms.
6"
7" Language: BitBake
8" Maintainer: Chris Larson <kergoth@handhelds.org>
9" Filenames: *.bb, *.bbclass
10
11if version < 600
12 syntax clear
13elseif exists("b:current_syntax")
14 finish
15endif
16
17syn case match
18
19
20" Catch incorrect syntax (only matches if nothing else does)
21"
22syn match bbUnmatched "."
23
24
25" Other
26
27syn match bbComment "^#.*$" display contains=bbTodo
28syn keyword bbTodo TODO FIXME XXX contained
29syn match bbDelimiter "[(){}=]" contained
30syn match bbQuote /['"]/ contained
31syn match bbArrayBrackets "[\[\]]" contained
32
33
34" BitBake strings
35
36syn match bbContinue "\\$"
37syn region bbString matchgroup=bbQuote start=/"/ skip=/\\$/ excludenl end=/"/ contained keepend contains=bbTodo,bbContinue,bbVarDeref
38syn region bbString matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ contained keepend contains=bbTodo,bbContinue,bbVarDeref
39
40
41" BitBake variable metadata
42
43syn keyword bbExportFlag export contained nextgroup=bbIdentifier skipwhite
44syn match bbVarDeref "${[a-zA-Z0-9\-_\.]\+}" contained
45syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.]\+\(_[${}a-zA-Z0-9\-_\.]\+\)\?\)\s*\(\(:=\)\|\(+=\)\|\(=+\)\|\(?=\)\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq
46
47syn match bbIdentifier "[a-zA-Z0-9\-_\.]\+" display contained
48"syn keyword bbVarEq = display contained nextgroup=bbVarValue
49syn match bbVarEq "\(:=\)\|\(+=\)\|\(=+\)\|\(?=\)\|=" contained nextgroup=bbVarValue
50syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref
51
52
53" BitBake variable metadata flags
54syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag
55syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(=\)\@=" keepend excludenl contained contains=bbIdentifier nextgroup=bbVarEq
56"syn match bbVarFlagFlag "\[\([a-zA-Z0-9\-_\.]\+\)\]\s*\(=\)\@=" contains=bbIdentifier nextgroup=bbVarEq
57
58
59" Functions!
60syn match bbFunction "\h\w*" display contained
61
62
63" BitBake python metadata
64syn include @python syntax/python.vim
65if exists("b:current_syntax")
66 unlet b:current_syntax
67endif
68
69syn keyword bbPythonFlag python contained nextgroup=bbFunction
70syn match bbPythonFuncDef "^\(python\s\+\)\(\w\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPythonFlag,bbFunction,bbDelimiter nextgroup=bbPythonFuncRegion skipwhite
71syn region bbPythonFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@python
72"hi def link bbPythonFuncRegion Comment
73
74
75" BitBake shell metadata
76syn include @shell syntax/sh.vim
77if exists("b:current_syntax")
78 unlet b:current_syntax
79endif
80
81syn keyword bbFakerootFlag fakeroot contained nextgroup=bbFunction
82syn match bbShellFuncDef "^\(fakeroot\s*\)\?\(\w\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbFakerootFlag,bbFunction,bbDelimiter nextgroup=bbShellFuncRegion skipwhite
83syn region bbShellFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@shell
84"hi def link bbShellFuncRegion Comment
85
86
87" BitBake 'def'd python functions
88syn keyword bbDef def contained
89syn region bbDefRegion start='^def\s\+\w\+\s*([^)]*)\s*:\s*$' end='^\(\s\|$\)\@!' contains=@python
90
91
92" BitBake statements
93syn keyword bbStatement include inherit addtask addhandler EXPORT_FUNCTIONS display contained
94syn match bbStatementLine "^\(include\|inherit\|addtask\|addhandler\|EXPORT_FUNCTIONS\)\s\+" contains=bbStatement nextgroup=bbStatementRest
95syn match bbStatementRest ".*$" contained contains=bbString,bbVarDeref
96
97" Highlight
98"
99hi def link bbArrayBrackets Statement
100hi def link bbUnmatched Error
101hi def link bbVarDeref String
102hi def link bbContinue Special
103hi def link bbDef Statement
104hi def link bbPythonFlag Type
105hi def link bbExportFlag Type
106hi def link bbFakerootFlag Type
107hi def link bbStatement Statement
108hi def link bbString String
109hi def link bbTodo Todo
110hi def link bbComment Comment
111hi def link bbOperator Operator
112hi def link bbError Error
113hi def link bbFunction Function
114hi def link bbDelimiter Delimiter
115hi def link bbIdentifier Identifier
116hi def link bbVarEq Operator
117hi def link bbQuote String
118hi def link bbVarValue String
119
120let b:current_syntax = "bb"