From c2b4305349ca855c497904282db354de56c74842 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Aug 2018 14:59:07 +0200 Subject: Add support for default extension specification, trailing dot escaping For example: cxx{*}: extension = cxx cxx{foo} # foo.cxx cxx{foo.test} # foo.test (probably what we want...) cxx{foo.test...} # foo.test.cxx (... is this) cxx{foo..} # foo. cxx{foo....} # foo.. cxx{foo.....} # error (must come in escape pair) --- build2/algorithm.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'build2/algorithm.cxx') diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx index 550a491..bfe6943 100644 --- a/build2/algorithm.cxx +++ b/build2/algorithm.cxx @@ -49,8 +49,9 @@ namespace build2 { assert (phase == run_phase::match); - optional ext; - const target_type* tt (s.find_target_type (n, ext, location ())); + auto rp (s.find_target_type (n, location ())); + const target_type* tt (rp.first); + optional& ext (rp.second); if (tt == nullptr) fail << "unknown target type " << n.type << " in name " << n; @@ -77,8 +78,9 @@ namespace build2 assert (phase == run_phase::match || phase == run_phase::execute); name n (cn); - optional ext; - const target_type* tt (s.find_target_type (n, ext, location ())); + auto rp (s.find_target_type (n, location ())); + const target_type* tt (rp.first); + optional& ext (rp.second); // For now we treat an unknown target type as an unknown target. Seems // logical. -- cgit v1.1