mirror of
https://github.com/open-goal/jak-project
synced 2026-07-07 06:05:15 -04:00
[decompiler] Working toward bsp (#717)
* clean up * before int to float stuff * before trying to eliminate the separate read and write maps * partial fix for register issues * add missing include
This commit is contained in:
@@ -304,4 +304,30 @@ bool Arguments::only_contains_named(const std::unordered_set<std::string>& names
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace {
|
||||
std::string escape_string(const std::string& in) {
|
||||
std::string result;
|
||||
result.reserve(in.size());
|
||||
|
||||
for (char c : in) {
|
||||
if (c == '"') {
|
||||
result.push_back('\\');
|
||||
result.push_back('"');
|
||||
} else {
|
||||
result.push_back(c);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
std::string StringObject::print() const {
|
||||
return "\"" + escape_string(data) + "\"";
|
||||
}
|
||||
|
||||
std::string StringObject::inspect() const {
|
||||
return "[string] \"" + escape_string(data) + "\"\n";
|
||||
}
|
||||
|
||||
} // namespace goos
|
||||
|
||||
Reference in New Issue
Block a user