Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various bug fixes #43

Merged
merged 9 commits into from
Nov 1, 2023
29 changes: 7 additions & 22 deletions client/syntaxes/bitbake.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"include": "#comment"
},
{
"include": "#variable-reference"
"include": "#variable-expansion"
},
{
"include": "#functions"
Expand Down Expand Up @@ -58,18 +58,6 @@
"name": "storage.type.function.python.bb"
}
}
},
{
"match": "\\b(bbplain|bb|self)\\b(?=\\s+|\\.)",
"captures": {
"1": {
"name": "support.class.built-in-object.bb"
}
}
},
{
"match": "(?<=(import|inherit|from)\\s+)([a-zA-Z_][\\w_]*)(?=\\s+)",
"name": "support.class.bb"
}
]
},
Expand All @@ -84,7 +72,7 @@
}
},
{
"match": "\\b(def|class|global|nonlocal|and|or|not|in|is|lambda)\\b",
"match": "\\b(def|class|global|nonlocal|and|or|not|in|is|lambda)\\b\\s+",
"captures": {
"1": {
"name": "storage.type.function.python.bb"
Expand Down Expand Up @@ -113,7 +101,7 @@
"name": "constant.character.escape.bb"
},
{
"include": "#variable-reference"
"include": "#variable-expansion"
}
]
},
Expand All @@ -123,7 +111,7 @@
"end": "(')",
"patterns": [
{
"include": "#variable-reference"
"include": "#variable-expansion"
}
]
}
Expand All @@ -147,7 +135,7 @@
}
},
"functions": {
"match": "\\s*([a-zA-Z_][\\w_]*)(:(append|prepend|remove))?(?=\\s*\\()",
"match": "([a-zA-Z_][\\w_]*)(:([a-zA-Z_][\\w_]*))?(?=\\s*\\()",
"captures": {
"1": {
"name": "entity.name.function.python.bb"
Expand All @@ -160,7 +148,7 @@
}
}
},
"variable-reference": {
"variable-expansion": {
"begin": "(\\$\\{)",
"beginCaptures": {
"1": {
Expand Down Expand Up @@ -217,9 +205,6 @@
"captures": {
"1": {
"name": "variable.other.names.bb"
},
"2": {
"name": "keyword.other.bitbake-operator.bb"
}
}
},
Expand All @@ -228,7 +213,7 @@
"name": "keyword.operator.bb"
},
"bitbake-operator": {
"match": "(?<=:)(os|nooverride|qemuarm|qemumips64|qemumips|qemuppc|qemux86-64|qemux86|append|prepend|remove|task-configure|task-compile)",
"match": "(?<=:)(append|prepend|remove)",
"name": "keyword.other.bitbake-operator.bb"
},
"parenthesis-open": {
Expand Down
42 changes: 10 additions & 32 deletions client/test/grammars/snaps/bitbake-operator.bb
Original file line number Diff line number Diff line change
@@ -1,40 +1,18 @@
KBRANCH:os

KBRANCH:nooverride

KBRANCH:qemuarm

KBRANCH:qemumips64

KBRANCH:qemumips

KBRANCH:qemuppc

KBRANCH:qemux86-64

KBRANCH:qemux86

KBRANCH:append

KBRANCH:prepend

KBRANCH:remove

KBRANCH:task-configure

KBRANCH:task-compile

KBRANCH:qemuarm = "standard/arm-versatile-926ejs" # comments

DEPENDS:append:machine = "libmad"

KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"

KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"

KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"

python do_foo:append() {
bb.plain("first")
}

python do_foo:prepend() {
bb.plain("first")
}

python do_foo:remove() {
bb.plain("first")
}

91 changes: 4 additions & 87 deletions client/test/grammars/snaps/keywords.bb
Original file line number Diff line number Diff line change
@@ -1,86 +1,10 @@
# Keywords (Should target bitbake keywords only and exclude python and shell keywords)

python do_foo(){
from foo1 import bar1
# require foo

if
require foo1

whatif

ifnot

elif

else

for

while

break

continue

return

yield

try

except

finally

raise

assert

import

from

as

pass

del

with

async

await

def

class

global

nonlocal

and

or

not

in

is

lambda

self

True

False
}

require foo2

inherit fo3
inherit foo2

addtask printdate after do_fetch before do_build

Expand All @@ -94,14 +18,7 @@ EXPORT_FUNCTIONS functionname

INHERIT += "autotools pkgconfig"

bbplain

bb

fakeroot python foo() {}

def bar3():
pass
fakeroot python foo3() {}

python (){}

9 changes: 0 additions & 9 deletions client/test/grammars/snaps/nested-patterns.bb

This file was deleted.

58 changes: 11 additions & 47 deletions client/test/grammars/test-cases/bitbake-operator.bb
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
# SYNTAX TEST "source.bb" "bitbake-operators"

>KBRANCH:os
# ^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:nooverride
# ^^^^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:qemuarm
# ^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:qemumips64
# ^^^^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:qemumips
# ^^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:qemuppc
# ^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:qemux86-64
# ^^^^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:qemux86
# ^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:append
# ^^^^^^ source.bb keyword.other.bitbake-operator.bb

Expand All @@ -33,31 +9,19 @@
>KBRANCH:remove
# ^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:task-configure
# ^^^^^^^^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:task-compile
# ^^^^^^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KBRANCH:qemuarm = "standard/arm-versatile-926ejs" # comments
# ^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>DEPENDS:append:machine = "libmad"
# ^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"
# ^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
# ^^^^^^ source.bb keyword.other.bitbake-operator.bb
# ^^^^^^^ source.bb keyword.other.bitbake-operator.bb

>KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
# ^^^^^^ source.bb keyword.other.bitbake-operator.bb
# ^^^^^^^^^^ source.bb keyword.other.bitbake-operator.bb


>python do_foo:append() {
# ^^^^^^ source.bb keyword.operator.bb keyword.other.bitbake-operator.bb
> bb.plain("first")
>}

>python do_foo:prepend() {
# ^^^^^^^ source.bb keyword.operator.bb keyword.other.bitbake-operator.bb
> bb.plain("first")
>}

>python do_foo:remove() {
# ^^^^^^ source.bb keyword.operator.bb keyword.other.bitbake-operator.bb
> bb.plain("first")
>}

Loading
Loading