diff options
| author | Chris Larson <chris_larson@mentor.com> | 2011-01-10 12:00:41 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-10 22:10:41 +0000 |
| commit | d967f3b73138d118b48805dd5e2fbb592a07c990 (patch) | |
| tree | baaf6a233f5ea3293acdac72d6ab82e8547130da /bitbake/contrib | |
| parent | cbcd8e5296d3b74e8eac34ddb12efdfce6ed3cdb (diff) | |
| download | poky-d967f3b73138d118b48805dd5e2fbb592a07c990.tar.gz | |
vim: properly highlight python inside of ${@}
(Bitbake rev: 4210eb0b783bf9bbdf80b6c6806f66f3e6ec1e77)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/contrib')
| -rw-r--r-- | bitbake/contrib/vim/syntax/bitbake.vim | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/bitbake/contrib/vim/syntax/bitbake.vim b/bitbake/contrib/vim/syntax/bitbake.vim index bcabf5c448..a06dd9e0ac 100644 --- a/bitbake/contrib/vim/syntax/bitbake.vim +++ b/bitbake/contrib/vim/syntax/bitbake.vim | |||
| @@ -19,6 +19,11 @@ if exists("b:current_syntax") | |||
| 19 | finish | 19 | finish |
| 20 | endif | 20 | endif |
| 21 | 21 | ||
| 22 | syn include @python syntax/python.vim | ||
| 23 | if exists("b:current_syntax") | ||
| 24 | unlet b:current_syntax | ||
| 25 | endif | ||
| 26 | |||
| 22 | " BitBake syntax | 27 | " BitBake syntax |
| 23 | 28 | ||
| 24 | " Matching case | 29 | " Matching case |
| @@ -39,8 +44,8 @@ syn match bbArrayBrackets "[\[\]]" contained | |||
| 39 | 44 | ||
| 40 | " BitBake strings | 45 | " BitBake strings |
| 41 | syn match bbContinue "\\$" | 46 | syn match bbContinue "\\$" |
| 42 | syn region bbString matchgroup=bbQuote start=+"+ skip=+\\$+ excludenl end=+"+ contained keepend contains=bbTodo,bbContinue,bbVarDeref,@Spell | 47 | syn region bbString matchgroup=bbQuote start=+"+ skip=+\\$+ excludenl end=+"+ contained keepend contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell |
| 43 | syn region bbString matchgroup=bbQuote start=+'+ skip=+\\$+ excludenl end=+'+ contained keepend contains=bbTodo,bbContinue,bbVarDeref,@Spell | 48 | syn region bbString matchgroup=bbQuote start=+'+ skip=+\\$+ excludenl end=+'+ contained keepend contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell |
| 44 | 49 | ||
| 45 | " Vars definition | 50 | " Vars definition |
| 46 | syn match bbExport "^export" nextgroup=bbIdentifier skipwhite | 51 | syn match bbExport "^export" nextgroup=bbIdentifier skipwhite |
| @@ -50,7 +55,7 @@ syn match bbVarDeref "${[a-zA-Z0-9\-_\.\/\+]\+}" contained | |||
| 50 | syn match bbVarEq "\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)" contained nextgroup=bbVarValue | 55 | syn match bbVarEq "\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)" contained nextgroup=bbVarValue |
| 51 | syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.\/\+]\+\(_[${}a-zA-Z0-9\-_\.\/\+]\+\)\?\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq | 56 | syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.\/\+]\+\(_[${}a-zA-Z0-9\-_\.\/\+]\+\)\?\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq |
| 52 | syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref,bbVarPyValue | 57 | syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref,bbVarPyValue |
| 53 | syn match bbVarPyValue "${@[a-zA-Z0-9\-_\.\(\)]\+}" contained | 58 | syn region bbVarPyValue start=+${@+ skip=+\\$+ excludenl end=+}+ contained contains=@python |
| 54 | 59 | ||
| 55 | " Vars metadata flags | 60 | " Vars metadata flags |
| 56 | syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag | 61 | syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag |
| @@ -78,14 +83,10 @@ if exists("b:current_syntax") | |||
| 78 | unlet b:current_syntax | 83 | unlet b:current_syntax |
| 79 | endif | 84 | endif |
| 80 | syn keyword bbShFakeRootFlag fakeroot contained | 85 | syn keyword bbShFakeRootFlag fakeroot contained |
| 81 | syn match bbShFuncDef "^\(fakeroot\s*\)\?\([0-9A-Za-z_}${-]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbDelimiter nextgroup=bbShFuncRegion skipwhite | 86 | syn match bbShFuncDef "^\(fakeroot\s*\)\?\([0-9A-Za-z_-]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbDelimiter nextgroup=bbShFuncRegion skipwhite |
| 82 | syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@shell | 87 | syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@shell |
| 83 | 88 | ||
| 84 | " BitBake python metadata | 89 | " BitBake python metadata |
| 85 | syn include @python syntax/python.vim | ||
| 86 | if exists("b:current_syntax") | ||
| 87 | unlet b:current_syntax | ||
| 88 | endif | ||
| 89 | syn keyword bbPyFlag python contained | 90 | syn keyword bbPyFlag python contained |
| 90 | syn match bbPyFuncDef "^\(python\s\+\)\([0-9A-Za-z_-]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbDelimiter nextgroup=bbPyFuncRegion skipwhite | 91 | syn match bbPyFuncDef "^\(python\s\+\)\([0-9A-Za-z_-]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbDelimiter nextgroup=bbPyFuncRegion skipwhite |
| 91 | syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@python | 92 | syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@python |
| @@ -120,5 +121,3 @@ hi def link bbOEFunctions Special | |||
| 120 | hi def link bbVarPyValue PreProc | 121 | hi def link bbVarPyValue PreProc |
| 121 | 122 | ||
| 122 | let b:current_syntax = "bb" | 123 | let b:current_syntax = "bb" |
| 123 | |||
| 124 | |||
