From 6417a4e6af2b7732ec0da6af24f1a56f7cdada3f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 31 Mar 2016 09:01:50 +0200 Subject: Set part of variable override implementation --- build2/test/module.cxx | 14 ++++++++------ build2/test/rule.cxx | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 11 deletions(-) (limited to 'build2/test') diff --git a/build2/test/module.cxx b/build2/test/module.cxx index 10948ab..d5f6430 100644 --- a/build2/test/module.cxx +++ b/build2/test/module.cxx @@ -38,12 +38,14 @@ namespace build2 { auto& v (var_pool); - v.find ("test"); - v.find ("test.input"); - v.find ("test.output"); - v.find ("test.roundtrip"); - v.find ("test.options"); - v.find ("test.arguments"); + // @@ OVR + + v.insert ("test"); + v.insert ("test.input"); + v.insert ("test.output"); + v.insert ("test.roundtrip"); + v.insert ("test.options"); + v.insert ("test.arguments"); } } diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index 8c89bc7..063d148 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -66,9 +66,12 @@ namespace build2 { // See if there is a scope variable. // + // @@ I don't think we use this (e.g., test.exe = true) anymore. + // We now do exe{*}: test = true. + // if (!l.defined ()) l = t.base_scope ()[ - var_pool.find (string("test.") + t.type ().name)]; + var_pool.insert (string("test.") + t.type ().name)]; r = l && cast (l); } @@ -143,12 +146,14 @@ namespace build2 if (!il && !ol && !rl) { + // @@ Again, don't think we use this anymore. + // string n ("test."); n += t.type ().name; - const variable& in (var_pool.find (n + ".input")); - const variable& on (var_pool.find (n + ".output")); - const variable& rn (var_pool.find (n + ".roundtrip")); + const variable& in (var_pool.insert (n + ".input")); + const variable& on (var_pool.insert (n + ".output")); + const variable& rn (var_pool.insert (n + ".roundtrip")); // We should only keep value(s) that were specified together // in the innermost scope. @@ -288,11 +293,13 @@ namespace build2 if (!l) { + // @@ Again, don't think we do it. + // var.resize (5); var += t.type ().name; var += '.'; var += n; - l = t.base_scope ()[var_pool.find (var)]; + l = t.base_scope ()[var_pool.insert (var)]; } if (l) -- cgit v1.1