From 649d388ff422a9a049e2b50768db357a73ee59d5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 2 Dec 2022 15:34:53 +0200 Subject: Fail if scope or target qualification in variable expansion is unknown There are three options here: we can "fall through" to an outer scope (there is always the global scope backstop; this is the old semantics, sort of), we can return NULL straight away, or we can fail. It feels like in most cases unknown scope or target is a mistake and doing anything other than failing is just making things harder to debug. --- old-tests/variable/override/buildfile | 4 ++++ old-tests/variable/override/p/buildfile | 2 ++ old-tests/variable/type-pattern-append/buildfile | 2 ++ 3 files changed, 8 insertions(+) (limited to 'old-tests') diff --git a/old-tests/variable/override/buildfile b/old-tests/variable/override/buildfile index 87dc273..c0330cb 100644 --- a/old-tests/variable/override/buildfile +++ b/old-tests/variable/override/buildfile @@ -3,6 +3,8 @@ if ($p.t != [null]) [$p.t] p.v = [null] } +/: + print "/ :" $(/: p.v) if ($p.a == as) @@ -22,6 +24,8 @@ print ". :" $p.v d/ { + file{t}: + if ($p.d_a == as) { p.v = x diff --git a/old-tests/variable/override/p/buildfile b/old-tests/variable/override/p/buildfile index 166d869..8f4df28 100644 --- a/old-tests/variable/override/p/buildfile +++ b/old-tests/variable/override/p/buildfile @@ -15,6 +15,8 @@ print "p :" $p.v d/ { + file{t}: + if ($p.p_d_a == as) { p.v = x diff --git a/old-tests/variable/type-pattern-append/buildfile b/old-tests/variable/type-pattern-append/buildfile index 348f70f..3077c32 100644 --- a/old-tests/variable/type-pattern-append/buildfile +++ b/old-tests/variable/type-pattern-append/buildfile @@ -1,3 +1,5 @@ +./ sub/: + # Typed append/prepend. # #dir{a*}: x += [bool] true -- cgit v1.1