aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-02 15:06:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-02 15:06:55 +0200
commit65dca85d0acc1ae69518e85b52a2877e38dc8c6d (patch)
tree7e2f1c227d5114d30b8c84e2d9f6af826a36066a /build/algorithm.cxx
parent48f8883de7b8fa348423b3baf262de08c98eba18 (diff)
Implement translation of meta/operations to natural language
Diffstat (limited to 'build/algorithm.cxx')
-rw-r--r--build/algorithm.cxx30
1 files changed, 16 insertions, 14 deletions
diff --git a/build/algorithm.cxx b/build/algorithm.cxx
index 91ece49..d649210 100644
--- a/build/algorithm.cxx
+++ b/build/algorithm.cxx
@@ -73,11 +73,12 @@ namespace build
{
auto g (
make_exception_guard (
- [](target& t, const string& n)
+ [](action a, target& t, const string& n)
{
- info << "while matching rule " << n << " for target " << t;
+ info << "while matching rule " << n << " to "
+ << diag_do (a, t);
},
- t, n));
+ a, t, n));
m = ru.match (a, t, hint);
}
@@ -99,12 +100,12 @@ namespace build
{
auto g (
make_exception_guard (
- [](target& t, const string& n1)
+ [](action a, target& t, const string& n1)
{
- info << "while matching rule " << n1 << " for target "
- << t;
+ info << "while matching rule " << n1 << " to "
+ << diag_do (a, t);
},
- t, n1));
+ a, t, n1));
m1 = ru1.match (a, t, hint);
}
@@ -113,7 +114,7 @@ namespace build
{
if (!ambig)
{
- dr << fail << "multiple rules matching target " << t
+ dr << fail << "multiple rules matching " << diag_doing (a, t)
<< info << "rule " << n << " matches";
ambig = true;
}
@@ -126,11 +127,12 @@ namespace build
{
auto g (
make_exception_guard (
- [](target& t, const string& n)
+ [](action a, target& t, const string& n)
{
- info << "while applying rule " << n << " for target " << t;
+ info << "while applying rule " << n << " to "
+ << diag_do (a, t);
},
- t, n));
+ a, t, n));
t.recipe (a, ru.apply (a, t, m));
break;
@@ -142,7 +144,7 @@ namespace build
}
if (!t.recipe (a))
- fail << "no rule to update target " << t;
+ fail << "no rule to " << diag_do (a, t);
}
void
@@ -215,8 +217,8 @@ namespace build
auto g (
make_exception_guard (
- [](target& t){info << "while updating target " << t;},
- t));
+ [](action a, target& t){info << "while " << diag_doing (a, t);},
+ a, t));
ts = t.recipe (a) (a, t);
assert (ts != target_state::unknown && ts != target_state::failed);