From be14801929cf2a6caced87df034ae12a85f42aa6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 30 Nov 2016 17:32:43 +0200 Subject: Add support for typed/untyped concatenated expansion --- build2/function | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'build2/function') diff --git a/build2/function b/build2/function index 6397720..f824f9c 100644 --- a/build2/function +++ b/build2/function @@ -145,7 +145,23 @@ namespace build2 erase (iterator i) {map_.erase (i);} value - call (const string& name, vector_view args, const location&) const; + call (const string& name, vector_view args, const location& l) const + { + return call (name, args, l, true).first; + } + + // As above but do not fail if no match was found (but still do if the + // match is ambiguous). Instead return an indication of whether the call + // was made. Used to issue custom diagnostics when calling internal + // functions. + // + pair + try_call (const string& name, + vector_view args, + const location& l) const + { + return call (name, args, l, false); + } iterator begin () {return map_.begin ();} @@ -160,6 +176,9 @@ namespace build2 end () const {return map_.end ();} private: + pair + call (const string&, vector_view, const location&, bool fail) const; + map_type map_; }; -- cgit v1.1