Vim syntax update: Highlight overrides that include variable derefences (i.e. FILES_...
[vuplus_bitbake] / contrib / vim / syntax / bb.vim
index a79993d..4eded8b 100644 (file)
@@ -23,8 +23,9 @@ 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 region bbString            matchgroup=bbQuote start=/"/ skip=/\\$/ excludenl end=/"/ contained keepend contains=bbTodo
-syn region bbString            matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ contained 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
 
 " First attempt:
 " syn keyword bbPythonFlag     python contained nextgroup=bbFunction
@@ -48,7 +49,9 @@ syn region bbString           matchgroup=bbQuote start=/'/ skip=/\\$/ excludenl end=/'/ c
 " hi def link bbPythonFlag     Type
 
 " BitBake variable metadata
-syn match bbVarDef             "^\([a-zA-Z0-9\-_]\+\)\s*\(=\)\@=" contains=bbIdentifier nextgroup=bbVarEq
+syn match bbVarOverrideDeref   "[\${}()]"
+hi def link bbVarOverrideDeref         Statement
+syn match bbVarDef             "^\([a-zA-Z0-9\-_]\+\(_\(\${\)\?[a-zA-Z0-9\-_]\+\(}\)\?\)\?\)\s*\(=\)\@=" contains=bbIdentifier,bbVarOverrideDeref nextgroup=bbVarEq
 syn match bbIdentifier         "[a-zA-Z0-9\-_]\+" display contained
 "syn keyword bbVarEq   = display contained nextgroup=bbVarValue
 syn match bbVarEq              "=" contained contains=bbOperator nextgroup=bbVarValue
@@ -72,7 +75,7 @@ if exists("b:current_syntax")
 endif
 
 syn keyword bbPythonFlag       python contained nextgroup=bbFunction
-syn match bbPythonFuncDef      "^\(python\s\+\w\+\s*()\s*\)\({\)\@=" contains=bbPythonFlag,bbFunction,bbDelimiter nextgroup=bbPythonFuncRegion
+syn match bbPythonFuncDef      "^\(python\s\+\)\(\w\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPythonFlag,bbFunction,bbDelimiter nextgroup=bbPythonFuncRegion
 syn region bbPythonFuncRegion  matchgroup=bbDelimiter start="{" end="^}$" keepend contained contains=@python
 "hi def link bbPythonFuncRegion        Comment
 
@@ -103,6 +106,7 @@ syn keyword bbStatement             include inherit addtask addhandler
 syn match bbArrayBrackets      "[\[\]]" contained
 hi def link bbArrayBrackets    Statement
 
+hi def link bbContinue         Special
 hi def link bbDef              Statement
 hi def link bbPythonFlag       Type
 hi def link bbStatement                Statement