aboutsummaryrefslogtreecommitdiff
path: root/libbbot
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-12-20 18:55:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-12-20 18:55:59 +0300
commitfb940889f0be56492bde5d008ed48ff58f172948 (patch)
treefabb90bd129344afe276812f349d274ed60c2891 /libbbot
parentf18f62930fd919b5705c452ce5b8a02e2f9e1112 (diff)
Adapt to requirement alternatives parsing API change
Diffstat (limited to 'libbbot')
-rw-r--r--libbbot/manifest.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/libbbot/manifest.cxx b/libbbot/manifest.cxx
index c604810..3f07091 100644
--- a/libbbot/manifest.cxx
+++ b/libbbot/manifest.cxx
@@ -530,6 +530,11 @@ namespace bbot
optional<name_value> repo_url;
optional<repository_type> repo_type;
+ // We will also cache the requires values to parse them later, after the
+ // package name is parsed.
+ //
+ vector<name_value> reqs;
+
for (nv = p.next (); !nv.empty (); nv = p.next ())
{
string& n (nv.name);
@@ -602,14 +607,7 @@ namespace bbot
}
else if (n == "requires")
{
- try
- {
- requirements.push_back (requirement_alternatives (v));
- }
- catch (const invalid_argument& e)
- {
- bad_value (e.what ());
- }
+ reqs.push_back (move (nv));
}
else if (n == "tests" || n == "examples" || n == "benchmarks")
{
@@ -754,6 +752,18 @@ namespace bbot
nv = move (*repo_url); // Restore as bad_value() uses its line/column.
bad_value (string ("invalid task repository URL: ") + e.what ());
}
+
+ // Parse the requirements.
+ //
+ for (const name_value& r: reqs)
+ {
+ requirements.push_back (
+ requirement_alternatives (r.value,
+ name,
+ p.name (),
+ r.value_line,
+ r.value_column));
+ }
}
void task_manifest::