diff options
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); + } + } } } |