diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-03-16 20:21:59 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-03-26 20:00:31 +0300 |
commit | 2af2c4f092aa7efffe839ec615c06d22cf43cc3b (patch) | |
tree | e84676dbf273602fdf1f3541171df9dad7060daf /bbot/types-parsers.cxx | |
parent | 392c6003321047421467e07eac31e12875377ead (diff) |
Add support for interactive builds
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 7e82914..c4eff70 100644 --- a/bbot/types-parsers.cxx +++ b/bbot/types-parsers.cxx @@ -67,5 +67,26 @@ namespace bbot throw invalid_value (o, v, e.what ()); } } + + void parser<interactive_mode>:: + parse (interactive_mode& 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 = to_interactive_mode (v); + } + catch (const invalid_argument&) + { + throw invalid_value (o, v); + } + } } } |