Skip to content

Commit b24a574

Browse files
committed
Fix: 'python' highlighting when not used as a keyword
It seems vscode-tmgrammar-test does not remove '>' in the beginning of the test cases before executing them. It results that '>python' will not match with a regex such as '^python'. Hence some tests had to be modified.
1 parent b65b6c7 commit b24a574

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

client/syntaxes/bitbake.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"include": "#python-keywords"
6262
},
6363
{
64-
"match": "\\b(python|def)\\b(\\(?)",
64+
"match": "(?<=^|^fakeroot +)\\b(python|def)\\b",
6565
"captures": {
6666
"1": {
6767
"name": "storage.type.function.python.bb"

client/test/grammars/test-cases/functions.bb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
> else:
2626
> return "dependency"
2727

28-
>python () {
29-
#^^^^^^ source.bb storage.type.function.python.bb - entity.name.function.python.bb
28+
python () {
29+
#<------ source.bb storage.type.function.python.bb - entity.name.function.python.bb
3030
> if d.getVar('SOMEVAR') == 'value':
3131
# ^^^^^^ source.bb entity.name.function.python.bb
3232
> d.setVar('ANOTHERVAR', 'value2')

client/test/grammars/test-cases/keywords.bb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
>INHERIT += "autotools pkgconfig"
3131
#^^^^^^^ source.bb keyword.control.bb
3232

33-
>fakeroot python foo3() {}
34-
#^^^^^^^^ source.bb keyword.control.bb
35-
# ^^^^^^ source.bb storage.type.function.python.bb
33+
fakeroot python foo3() {}
34+
#<-------- source.bb keyword.control.bb
35+
# ^^^^^^ source.bb storage.type.function.python.bb
3636

37-
>python (){}
38-
#^^^^^^ source.bb storage.type.function.python.bb
37+
python (){}
38+
#<------ source.bb storage.type.function.python.bb
3939

4040
>inherit_defer foo2
4141
#^^^^^^^^^^^^^ source.bb keyword.control.bb
4242

43-
>python(){}
44-
#^^^^^^ source.bb storage.type.function.python.bb
43+
python(){}
44+
#<------ source.bb storage.type.function.python.bb

0 commit comments

Comments
 (0)