Merge "Additional heuristics: variables with names ending with _LIST are lists"

This commit is contained in:
Treehugger Robot
2021-09-06 00:09:39 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 1 deletions

View File

@@ -414,7 +414,7 @@ endif
def init(g, handle):
cfg = rblf.cfg(handle)
if rblf.filter(g.get("PRODUCT_LIST", ""), g["TARGET_PRODUCT"]):
if rblf.filter(g.get("PRODUCT_LIST", []), g["TARGET_PRODUCT"]):
pass
`,
},

View File

@@ -299,6 +299,10 @@ func (ctx *parseContext) addVariable(name string) variable {
vt = vi.valueType
}
}
if strings.HasSuffix(name, "_LIST") && vt == starlarkTypeUnknown {
// Heuristics: Variables with "_LIST" suffix are lists
vt = starlarkTypeList
}
v = &otherGlobalVariable{baseVariable{nam: name, typ: vt}}
}
ctx.variables[name] = v