From 5c7f13d325631467ef9eb63230c507062e92e022 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 8 Dec 2004 06:43:12 +0000 Subject: Vim syntax update: highlight the 'def'd python functions as such. --- contrib/vim/syntax/bb.vim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/vim/syntax/bb.vim b/contrib/vim/syntax/bb.vim index 041561cca..3f59cbac4 100644 --- a/contrib/vim/syntax/bb.vim +++ b/contrib/vim/syntax/bb.vim @@ -22,8 +22,6 @@ syn match bbQuote /['"]/ contained 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 bbFunction "\h\w*" display contained - " First attempt: " syn keyword bbPythonFlag python contained nextgroup=bbFunction " syn region bbPythonFuncRegion start="^python\s\+\w\+\s*()\s*{" end="^}$" keepend contains=bbPythonFuncDef @@ -52,6 +50,9 @@ syn match bbIdentifier "[a-zA-Z0-9\-_]\+" display contained syn match bbVarEq "=" contained contains=bbOperator nextgroup=bbVarValue syn match bbVarValue ".*$" contained contains=bbString +" Functions! +syn match bbFunction "\h\w*" display contained + " BitBake python metadata syn include @python syntax/python.vim if exists("b:current_syntax") @@ -74,6 +75,16 @@ syn region bbShellFuncRegion matchgroup=bbDelimiter start="{" end="^}$" keepend "hi def link bbShellFuncRegion Comment +" BitBake 'def'd python functions +syn keyword bbDef def contained + +syn match bbDefCmd "^def" skipwhite nextgroup=bbDefFunc +syn match bbDefFunc "\w\+" contains=bbFunction contained skipwhite nextgroup=bbDefArgs +syn region bbDefArgs matchgroup=bbDelimiter start="(" end=")" excludenl contained skipwhite keepend contains=bbIdentifier nextgroup=bbDefRegion +syn region bbDefRegion start=":$" end='^$' end='^\(\s\)\@!' contained contains=@python + +hi def link bbDefCmd bbStatement + hi def link bbPythonFlag Type hi def link bbStatement Statement hi def link bbString String -- cgit 1.2.3-korg