formatter: add tree-sitter dependency and commit early draft work on a proper code formatter (#2536)

This commit is contained in:
Tyler Wilding
2023-04-24 22:46:55 -05:00
committed by GitHub
parent 83f43b7153
commit 0ffb912a04
385 changed files with 71427 additions and 28 deletions
+8
View File
@@ -93,4 +93,12 @@ std::vector<std::string> regex_get_capture_groups(const std::string& str,
}
return groups;
}
bool replace(std::string& str, const std::string& from, const std::string& to) {
size_t start_pos = str.find(from);
if (start_pos == std::string::npos)
return false;
str.replace(start_pos, from.length(), to);
return true;
}
} // namespace str_util