diff options
author | 2021-08-26 09:10:23 -0700 | |
---|---|---|
committer | 2021-09-02 09:34:47 -0700 | |
commit | 468e11fbbefe99168e965b541b5a47ec11032e1d (patch) | |
tree | bd26fffb820d9d4ab6c9a3d9be511decb003c8b8 /mk2rbc/variable.go | |
parent | 5eeb6fc3f2823591677763bee5a87ed7ec0b3681 (diff) |
Additional heuristics: variables with names ending with _LIST are lists
Bug: 193540681
Test: internal
Change-Id: Ic23bf0f0eadb159285650f0b7e20307788c12387
Diffstat (limited to 'mk2rbc/variable.go')
-rw-r--r-- | mk2rbc/variable.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mk2rbc/variable.go b/mk2rbc/variable.go index 88d63c96e..4bb9ed52d 100644 --- a/mk2rbc/variable.go +++ b/mk2rbc/variable.go @@ -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 |