Skip to content

Commit 5fe4faa

Browse files
mschwan-phytecchrisbra
authored andcommitted
runtime(bitbake): fix multiline Python function parameter syntax
Fix syntax highlighting for def-style Python functions, with their parameters spanning multiple lines. E.g. the following should match as valid Python code in Bitbake recipes: def myFunction(one, two, \ three, four): pass For this to work, use the prefix modifier "\_" before the wildcard ".", to also match newline characters. closes: #18565 Signed-off-by: Martin Schwan <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 64c8105 commit 5fe4faa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

runtime/syntax/bitbake.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
" Ricardo Salveti <[email protected]>
55
" Copyright: Copyright (C) 2004 Chris Larson <[email protected]>
66
" Copyright (C) 2008 Ricardo Salveti <[email protected]>
7+
" Last Change: 2022 Jul 25
8+
" 2025 Oct 13 by Vim project: update multiline function syntax #18565
79
"
810
" This file is licensed under the MIT license, see COPYING.MIT in
911
" this source distribution for the terms.
@@ -95,7 +97,7 @@ syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$
9597

9698
" BitBake 'def'd python functions
9799
syn keyword bbPyDef def contained
98-
syn region bbPyDefRegion start='^\(def\s\+\)\([0-9A-Za-z_-]\+\)\(\s*(.*)\s*\):\s*$' end='^\(\s\|$\)\@!' contains=@python
100+
syn region bbPyDefRegion start='^\(def\s\+\)\([0-9A-Za-z_-]\+\)\(\s*(\_.*)\s*\):\s*$' end='^\(\s\|$\)\@!' contains=@python
99101

100102
" Highlighting Definitions
101103
hi def link bbUnmatched Error

0 commit comments

Comments
 (0)