Remove trailing whitespace from generated c code

This commit is contained in:
Max Brunsfeld 2014-03-29 19:00:31 -07:00
parent 7c502e5b58
commit 8e1b78ca8e
6 changed files with 5831 additions and 6085 deletions

View file

@ -237,11 +237,11 @@ namespace tree_sitter {
return join({
"PARSE_TABLE = {",
indent(join(map_to_string<ParseState>(parse_table.states, [&](ParseState state) {
string result = "[" + to_string(state_id++) + "] = {";
string result = "[" + to_string(state_id++) + "] = {\n";
for (auto &pair : state.actions)
result += indent("\n[" + symbol_id(pair.first) + "] = " + code_for_parse_action(pair.second) + ",");
return result + "\n},";
}), "\n\n")),
result += indent("[" + symbol_id(pair.first) + "] = " + code_for_parse_action(pair.second) + ",") + "\n";
return result + "},\n";
}), "\n")),
"};"
});
}