diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-16 16:05:05 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-16 16:28:12 +0300 |
commit | 320e849d17597aef40b9e3e62f79319f13f97e45 (patch) | |
tree | 9d6e4254c5461bfd3547aa4aa2d21057f77ee1b9 /build2/parser.cxx | |
parent | 5d54628076bd7fc97e90c81b6d0df0fef4ceae20 (diff) |
Fix uncaught invalid_path exception
Diffstat (limited to 'build2/parser.cxx')
-rw-r--r-- | build2/parser.cxx | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx index 96465f6..bbce5e5 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -150,7 +150,7 @@ namespace build2 const location& loc) { optional<string> e; - const target_type* ti (p.scope_->find_target_type (n, e)); + const target_type* ti (p.scope_->find_target_type (n, e, loc)); if (ti == nullptr) p.fail (loc) << "unknown target type " << n.type; @@ -735,7 +735,7 @@ namespace build2 for (auto& pn: pns) { optional<string> e; - const target_type* ti (scope_->find_target_type (pn, e)); + const target_type* ti (scope_->find_target_type (pn, e, ploc)); if (ti == nullptr) fail (ploc) << "unknown target type " << pn.type; @@ -3104,19 +3104,27 @@ namespace build2 << " pattern"; } - if (s == '+') + try { - if (p) - include_pattern (move (v), a); + if (s == '+') + { + if (p) + include_pattern (move (v), a); + else + include_match (move (v), a); + } else - include_match (move (v), a); + { + if (p) + exclude_pattern (move (v)); + else + exclude_match (v); + } } - else + catch (const invalid_path& e) { - if (p) - exclude_pattern (move (v)); - else - exclude_match (v); + fail (l) << "invalid path '" << e.path << "' in " << what + << " pattern"; } } |