Tweak format for example grammars

This commit is contained in:
Max Brunsfeld 2014-03-28 13:51:32 -07:00
parent 324f55f1ce
commit 13c4e6e648
23 changed files with 1616 additions and 1537 deletions

View file

@ -2,7 +2,7 @@
namespace tree_sitter {
using std::string;
namespace util {
void str_replace(string *input, const string &search, const string &replace) {
size_t pos = 0;
@ -14,7 +14,7 @@ namespace tree_sitter {
pos += replace.length();
}
}
string escape_string(string input) {
str_replace(&input, "\"", "\\\"");
str_replace(&input, "\n", "\\n");