summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-10-06 19:32:25 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-10-06 19:32:25 +0100
commit008ba2cbab928b5f4ea50b450a683c1f570eee14 (patch)
tree307e61f3142378d144da526d9b14e83be5dcb62a /src
parent17d591b61cc89d9343ad024fdbe76da96f7675c6 (diff)
Use ',' instead of '|' as tuple option fields separators
Diffstat (limited to 'src')
-rw-r--r--src/option_types.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/option_types.hh b/src/option_types.hh
index e68ddc30..7b0ebbf1 100644
--- a/src/option_types.hh
+++ b/src/option_types.hh
@@ -99,7 +99,7 @@ bool option_add(std::unordered_set<T>& opt, const std::unordered_set<T>& set)
return not set.empty();
}
-constexpr Codepoint tuple_separator = '|';
+constexpr Codepoint tuple_separator = ',';
template<size_t I, typename... Types>
struct TupleOptionDetail
@@ -175,9 +175,9 @@ bool option_add(T&, const T&)
template<typename EffectiveType, typename LineType, typename ColumnType>
inline void option_from_string(const String& str, LineAndColumn<EffectiveType, LineType, ColumnType>& opt)
{
- auto vals = split(str, '|');
+ auto vals = split(str, tuple_separator);
if (vals.size() != 2)
- throw runtime_error("expected <line>|<column>");
+ throw runtime_error("expected <line>"_str + tuple_separator + "<column>");
opt.line = str_to_int(vals[0]);
opt.column = str_to_int(vals[1]);
}
@@ -185,7 +185,7 @@ inline void option_from_string(const String& str, LineAndColumn<EffectiveType, L
template<typename EffectiveType, typename LineType, typename ColumnType>
inline String option_to_string(const LineAndColumn<EffectiveType, LineType, ColumnType>& opt)
{
- return to_string(opt.line) + '|' + to_string(opt.column);
+ return to_string(opt.line) + tuple_separator + to_string(opt.column);
}
enum YesNoAsk