From c0f6b9b835e8ede26e407d7431d0a44aeb41dc15 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Mar 2020 05:36:07 +0200 Subject: Get rid of old and unused logic --- libbuild2/parser.cxx | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index 8f45125..e219e07 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -2737,17 +2737,8 @@ namespace build2 if (ns.size () != 1 || !ns[0].simple () || ns[0].empty ()) fail (l) << "expected variable name instead of " << ns; - string& n (ns[0].value); - - //@@ OLD - if (n.front () == '.') // Fully qualified name. - n.erase (0, 1); - else - { - //@@ TODO: append namespace if any. - } - - return scope_->var_pool ().insert (move (n), true /* overridable */); + return scope_->var_pool ().insert (move (ns[0].value), + true /* overridable */); } void parser:: @@ -5686,15 +5677,6 @@ namespace build2 { tracer trace ("parser::lookup_variable", &path_); - // Process variable name. @@ OLD - // - if (name.front () == '.') // Fully namespace-qualified name. - name.erase (0, 1); - else - { - //@@ TODO : append namespace if any. - } - const scope* s (nullptr); const target* t (nullptr); const prerequisite* p (nullptr); @@ -5738,6 +5720,9 @@ namespace build2 // Lookup. // + // @@ Why insert instead of find(), like in []-lookup? Also change to + // const string& name. + // const variable& var (scope_->var_pool ().insert (move (name), true)); if (p != nullptr) @@ -5777,16 +5762,6 @@ namespace build2 return (*s)[var]; } - // Undefined/NULL namespace variables are not allowed. - // - // @@ TMP this isn't proving to be particularly useful. - // - // if (!l) - // { - // if (var.name.find ('.') != string::npos) - // fail (loc) << "undefined/null namespace variable " << var; - // } - return lookup (); } -- cgit v1.1