diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-05-03 12:07:02 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-05-03 12:07:02 +0200 |
commit | f5ab412da304e3970a6b5b3290758ed791c31881 (patch) | |
tree | 28ddc870029302d6a26209dba0f73b3ce692744d /bbot/types-parsers.cxx | |
parent | fa5ebd101b792fdf038394f0aaa4a4ab8e28dab6 (diff) |
Pass toolchain name/version to controller
Diffstat (limited to 'bbot/types-parsers.cxx')
-rw-r--r-- | bbot/types-parsers.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bbot/types-parsers.cxx b/bbot/types-parsers.cxx index 1d0a250..af48ff7 100644 --- a/bbot/types-parsers.cxx +++ b/bbot/types-parsers.cxx @@ -47,5 +47,26 @@ namespace bbot xs = true; parse_path (x, s); } + + void parser<standard_version>:: + parse (standard_version& x, bool& xs, scanner& s) + { + xs = true; + const char* o (s.next ()); + + if (!s.more ()) + throw missing_value (o); + + const char* v (s.next ()); + + try + { + x = standard_version (v); + } + catch (const invalid_argument&) + { + throw invalid_value (o, v); //@@ Would be nice to include description. + } + } } } |