Add .clang-format and apply it

This commit is contained in:
2021-12-02 07:18:16 +00:00
parent e58dede1b6
commit cd5e2538df
103 changed files with 2714 additions and 2132 deletions

View File

@@ -28,7 +28,8 @@ static const InfoMap the_real_aunt_sue({{"children", {3, Equality}},
{"cars", {2, Equality}},
{"perfumes", {1, Equality}}});
bool matches_sue(std::string const &s) {
bool matches_sue(std::string const& s)
{
assert(s.substr(0, 4) == "Sue ");
std::size_t pos = 4;
std::size_t len = 0;
@@ -40,7 +41,8 @@ bool matches_sue(std::string const &s) {
while (pos < s.size()) {
if (s[pos] == ' ' || s[pos] == ',') {
++pos;
} else {
}
else {
auto colon = s.find(':', pos);
assert(colon != std::string::npos);
std::string name = s.substr(pos, colon - pos);
@@ -63,7 +65,8 @@ bool matches_sue(std::string const &s) {
return true;
}
int main(int argc, char **argv) {
int main(int argc, char** argv)
{
std::string line;
while (std::getline(std::cin, line)) {
if (matches_sue(line)) {