Fixing syntax for funcions with '-' in the name and for python code doesn't have...
Ricardo Salveti [Mon, 2 Jun 2008 04:38:29 +0000 (01:38 -0300)]
syntax/bitbake.vim

index bd9caa1..2e08906 100644 (file)
@@ -69,15 +69,15 @@ syn match bbStatementLine       "^\(addtask\|addhandler\|after\|before\|EXPORT_F
 syn keyword bbOEFunctions       do_fetch do_unpack do_patch do_configure do_compile do_stage do_install do_package contained
 
 " Generic Functions
-syn match bbFunction            "\h\w*" display contained contains=bbOEFunctions
+syn match bbFunction            "\h[0-9A-Za-z_-]*" display contained contains=bbOEFunctions
 
 " BitBake shell metadata
 syn include @shell syntax/sh.vim
 if exists("b:current_syntax")
   unlet b:current_syntax
 endif
-syn keyword bbShFakeRootFlag    fakeroot contained nextgroup=bbFunction
-syn match bbShFuncDef           "^\(fakeroot\s*\)\?\(\w\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbDelimiter nextgroup=bbShFuncRegion skipwhite
+syn keyword bbShFakeRootFlag    fakeroot contained
+syn match bbShFuncDef           "^\(fakeroot\s*\)\?\([0-9A-Za-z_-]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbDelimiter nextgroup=bbShFuncRegion skipwhite
 syn region bbShFuncRegion       matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@shell
 
 " BitBake python metadata
@@ -85,13 +85,13 @@ syn include @python syntax/python.vim
 if exists("b:current_syntax")
   unlet b:current_syntax
 endif
-syn keyword bbPyFlag            python contained nextgroup=bbFunction
-syn match bbPyFuncDef           "^\(python\s\+\)\(\w\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbDelimiter nextgroup=bbPyFuncRegion skipwhite 
+syn keyword bbPyFlag            python contained
+syn match bbPyFuncDef           "^\(python\s\+\)\([0-9A-Za-z_-]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbDelimiter nextgroup=bbPyFuncRegion skipwhite 
 syn region bbPyFuncRegion       matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@python
 
 " BitBake 'def'd python functions
 syn keyword bbPyDef             def contained
-syn region bbPyDefRegion        start='^def\s\+\w\+\s*([^)]*)\s*:\s*$' end='^\(\s\|$\)\@!' contains=@python
+syn region bbPyDefRegion        start='^\(def\s\+\)\([0-9A-Za-z_-]\+\)\(\s*(.*)\s*\):\s*$' end='^\(\s\|$\)\@!' contains=@python
 
 " Highlighting Definitions
 hi def link bbUnmatched         Error
@@ -104,7 +104,7 @@ hi def link bbDelimiter         Keyword
 hi def link bbArrayBrackets     Statement
 hi def link bbContinue          Special
 hi def link bbExportFlag        Type
-hi def link bbIdentifier       Identifier
+hi def link bbIdentifier           Identifier
 hi def link bbVarDeref          PreProc
 hi def link bbVarDef            Identifier
 hi def link bbVarValue          String