format: redesign how grouping behaves so it's more sensible

This commit is contained in:
Andrzej Rybczak
2015-02-11 16:28:21 +01:00
parent b874173c57
commit 809ffada40
4 changed files with 103 additions and 57 deletions

View File

@@ -125,14 +125,14 @@ Format::AST<char> columns_to_format(const std::vector<Column> &columns)
auto column = columns.begin();
while (true)
{
Format::Any<char> any;
Format::FirstOf<char> first_of;
for (const auto &type : column->type)
{
auto f = charToGetFunction(type);
assert(f != nullptr);
any.base().push_back(f);
first_of.base().push_back(f);
}
result.push_back(std::move(any));
result.push_back(std::move(first_of));
if (++column != columns.end())
result.push_back(" ");