mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 15:02:01 -04:00
formatter: add tree-sitter dependency and commit early draft work on a proper code formatter (#2536)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user