aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2004-12-08 06:43:12 +0000
committerChris Larson <clarson@kergoth.com>2004-12-08 06:43:12 +0000
commit5c7f13d325631467ef9eb63230c507062e92e022 (patch)
tree4c0638cb62997be0292264509e00872e4c38aa37 /contrib
parent7d63e5d1cd326c40df4254d3533217f2f39b87bd (diff)
downloadbitbake-5c7f13d325631467ef9eb63230c507062e92e022.tar.gz
Vim syntax update: highlight the 'def'd python functions as such.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/vim/syntax/bb.vim15
1 files changed, 13 insertions, 2 deletions
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