Merge "Fix "unknown binary op: string + list" errors"
This commit is contained in:
@@ -1212,6 +1212,33 @@ def init(g, handle):
|
|||||||
g["BOOT_KERNEL_MODULES_LIST"] = ["foo.ko"]
|
g["BOOT_KERNEL_MODULES_LIST"] = ["foo.ko"]
|
||||||
g["BOOT_KERNEL_MODULES_LIST"] += ["bar.ko"]
|
g["BOOT_KERNEL_MODULES_LIST"] += ["bar.ko"]
|
||||||
g["BOOT_KERNEL_MODULES_FILTER_2"] = ["%%/%s" % m for m in g["BOOT_KERNEL_MODULES_LIST"]]
|
g["BOOT_KERNEL_MODULES_FILTER_2"] = ["%%/%s" % m for m in g["BOOT_KERNEL_MODULES_LIST"]]
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc: "List appended to string",
|
||||||
|
mkname: "product.mk",
|
||||||
|
in: `
|
||||||
|
NATIVE_BRIDGE_PRODUCT_PACKAGES := \
|
||||||
|
libnative_bridge_vdso.native_bridge \
|
||||||
|
native_bridge_guest_app_process.native_bridge \
|
||||||
|
native_bridge_guest_linker.native_bridge
|
||||||
|
|
||||||
|
NATIVE_BRIDGE_MODIFIED_GUEST_LIBS := \
|
||||||
|
libaaudio \
|
||||||
|
libamidi \
|
||||||
|
libandroid \
|
||||||
|
libandroid_runtime
|
||||||
|
|
||||||
|
NATIVE_BRIDGE_PRODUCT_PACKAGES += \
|
||||||
|
$(addsuffix .native_bridge,$(NATIVE_BRIDGE_ORIG_GUEST_LIBS))
|
||||||
|
`,
|
||||||
|
expected: `load("//build/make/core:product_config.rbc", "rblf")
|
||||||
|
|
||||||
|
def init(g, handle):
|
||||||
|
cfg = rblf.cfg(handle)
|
||||||
|
g["NATIVE_BRIDGE_PRODUCT_PACKAGES"] = "libnative_bridge_vdso.native_bridge native_bridge_guest_app_process.native_bridge native_bridge_guest_linker.native_bridge"
|
||||||
|
g["NATIVE_BRIDGE_MODIFIED_GUEST_LIBS"] = "libaaudio libamidi libandroid libandroid_runtime"
|
||||||
|
g["NATIVE_BRIDGE_PRODUCT_PACKAGES"] += " " + " ".join(rblf.addsuffix(".native_bridge", g.get("NATIVE_BRIDGE_ORIG_GUEST_LIBS", "")))
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@@ -81,10 +81,12 @@ func (pcv productConfigVariable) emitSet(gctx *generationContext, asgn *assignme
|
|||||||
emitAppend := func() {
|
emitAppend := func() {
|
||||||
pcv.emitGet(gctx, true)
|
pcv.emitGet(gctx, true)
|
||||||
gctx.write(" += ")
|
gctx.write(" += ")
|
||||||
|
value := asgn.value
|
||||||
if pcv.valueType() == starlarkTypeString {
|
if pcv.valueType() == starlarkTypeString {
|
||||||
gctx.writef(`" " + `)
|
gctx.writef(`" " + `)
|
||||||
|
value = &toStringExpr{expr: value}
|
||||||
}
|
}
|
||||||
asgn.value.emit(gctx)
|
value.emit(gctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch asgn.flavor {
|
switch asgn.flavor {
|
||||||
@@ -136,10 +138,12 @@ func (scv otherGlobalVariable) emitSet(gctx *generationContext, asgn *assignment
|
|||||||
emitAppend := func() {
|
emitAppend := func() {
|
||||||
scv.emitGet(gctx, true)
|
scv.emitGet(gctx, true)
|
||||||
gctx.write(" += ")
|
gctx.write(" += ")
|
||||||
|
value := asgn.value
|
||||||
if scv.valueType() == starlarkTypeString {
|
if scv.valueType() == starlarkTypeString {
|
||||||
gctx.writef(`" " + `)
|
gctx.writef(`" " + `)
|
||||||
|
value = &toStringExpr{expr: value}
|
||||||
}
|
}
|
||||||
asgn.value.emit(gctx)
|
value.emit(gctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch asgn.flavor {
|
switch asgn.flavor {
|
||||||
@@ -193,10 +197,12 @@ func (lv localVariable) emitSet(gctx *generationContext, asgn *assignmentNode) {
|
|||||||
case asgnAppend:
|
case asgnAppend:
|
||||||
lv.emitGet(gctx, false)
|
lv.emitGet(gctx, false)
|
||||||
gctx.write(" += ")
|
gctx.write(" += ")
|
||||||
|
value := asgn.value
|
||||||
if lv.valueType() == starlarkTypeString {
|
if lv.valueType() == starlarkTypeString {
|
||||||
gctx.writef(`" " + `)
|
gctx.writef(`" " + `)
|
||||||
|
value = &toStringExpr{expr: value}
|
||||||
}
|
}
|
||||||
asgn.value.emit(gctx)
|
value.emit(gctx)
|
||||||
case asgnMaybeAppend:
|
case asgnMaybeAppend:
|
||||||
gctx.writef("%s(%q, ", cfnLocalAppend, lv)
|
gctx.writef("%s(%q, ", cfnLocalAppend, lv)
|
||||||
asgn.value.emit(gctx)
|
asgn.value.emit(gctx)
|
||||||
|
Reference in New Issue
Block a user