Ignore variable assignments that come after a rule definition
These private variables sometimes have references to make variables like $< or $@. When converted to starlark, they become invalid local variables like _< and _@, preventing the file from being loaded even if it's never executed. Bug: 226974242 Test: go test Change-Id: Iafd4c6939731f3b7c051c9e41464134d5b672f23
This commit is contained in:
@@ -531,7 +531,7 @@ func (ctx *parseContext) backNode() {
|
||||
|
||||
func (ctx *parseContext) handleAssignment(a *mkparser.Assignment) []starlarkNode {
|
||||
// Handle only simple variables
|
||||
if !a.Name.Const() {
|
||||
if !a.Name.Const() || a.Target != nil {
|
||||
return []starlarkNode{ctx.newBadNode(a, "Only simple variables are handled")}
|
||||
}
|
||||
name := a.Name.Strings[0]
|
||||
|
Reference in New Issue
Block a user