aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/vim
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2004-12-08 19:23:47 +0000
committerChris Larson <clarson@kergoth.com>2004-12-08 19:23:47 +0000
commit0669996d356dabd3fb52927e98105fe97bb6c970 (patch)
treeba4e8e3a8da17e70eeb8dee88098254e90790be5 /contrib/vim
parente8bc5b52481dbdcfefc531c6bc93d0023413fab4 (diff)
downloadbitbake-0669996d356dabd3fb52927e98105fe97bb6c970.tar.gz
bitbake-0669996d356dabd3fb52927e98105fe97bb6c970.tar.bz2
bitbake-0669996d356dabd3fb52927e98105fe97bb6c970.zip
Vim syntax: limit the areas in which variable dereferences are matched and highlighted.
Diffstat (limited to 'contrib/vim')
-rw-r--r--contrib/vim/syntax/bb.vim14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/vim/syntax/bb.vim b/contrib/vim/syntax/bb.vim
index a7bc15e4..2a1461be 100644
--- a/contrib/vim/syntax/bb.vim
+++ b/contrib/vim/syntax/bb.vim
@@ -24,8 +24,8 @@ syn match bbQuote /['"]/ contained
"syn region bbString matchgroup=bbQuote start=/"/ skip=/\\$/ excludenl end=/"/ keepend contains=bbTodo
"syn region bbString matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ keepend contains=bbTodo
syn match bbContinue "\\$"
-syn region bbString matchgroup=bbQuote start=/"/ skip=/\\$/ excludenl end=/"/ contained keepend contains=bbTodo,bbContinue
-syn region bbString matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ contained keepend contains=bbTodo,bbContinue
+syn region bbString matchgroup=bbQuote start=/"/ skip=/\\$/ excludenl end=/"/ contained keepend contains=bbTodo,bbContinue,bbVarDeref
+syn region bbString matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ contained keepend contains=bbTodo,bbContinue,bbVarDeref
" First attempt:
" syn keyword bbPythonFlag python contained nextgroup=bbFunction
@@ -51,14 +51,13 @@ syn region bbString matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ c
" BitBake variable metadata
syn keyword bbExportFlag export contained nextgroup=bbIdentifier skipwhite
-syn match bbVarOverrideDeref "${[a-zA-Z0-9\-_\.]\+}"
-hi def link bbVarOverrideDeref String
-syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.]\+\(_[${}a-zA-Z0-9\-_\.]\+\)\?\)\s*\(\(:=\)\|\(+=\)\|\(=+\)\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarOverrideDeref nextgroup=bbVarEq
+syn match bbVarDeref "${[a-zA-Z0-9\-_\.]\+}" contained
+syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.]\+\(_[${}a-zA-Z0-9\-_\.]\+\)\?\)\s*\(\(:=\)\|\(+=\)\|\(=+\)\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq
syn match bbIdentifier "[a-zA-Z0-9\-_\.]\+" display contained
"syn keyword bbVarEq = display contained nextgroup=bbVarValue
syn match bbVarEq "\(:=\)\|\(+=\)\|\(=+\)\|=" contained nextgroup=bbVarValue
-syn match bbVarValue ".*$" contained contains=bbString
+syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref
" BitBake variable metadata flags
@@ -106,11 +105,12 @@ syn region bbDefRegion matchgroup=bbDelimiter start=":$" end='^\(\s\|$\)\@!' co
" BitBake statements
syn keyword bbStatement include inherit addtask addhandler EXPORT_FUNCTIONS display contained
syn match bbStatementLine "^\(include\|inherit\|addtask\|addhandler\|EXPORT_FUNCTIONS\)\s\+" contains=bbStatement nextgroup=bbStatementRest
-syn match bbStatementRest ".*$" contained contains=bbString,bbVarOverrideDeref
+syn match bbStatementRest ".*$" contained contains=bbString,bbVarDeref
syn match bbArrayBrackets "[\[\]]" contained
hi def link bbArrayBrackets Statement
+hi def link bbVarDeref String
hi def link bbContinue Special
hi def link bbDef Statement
hi def link bbPythonFlag Type