Internals: Cleanup some vlSelf code. No functional change intended.

This commit is contained in:
Wilson Snyder
2025-04-26 09:51:02 -04:00
parent abc46db3c0
commit e7adae6f81
4 changed files with 14 additions and 11 deletions
+5 -3
View File
@@ -64,10 +64,12 @@ std::ostream& operator<<(std::ostream& os, VNType rhs);
const std::shared_ptr<const string> VSelfPointerText::s_emptyp = std::make_shared<string>("");
const std::shared_ptr<const string> VSelfPointerText::s_thisp = std::make_shared<string>("this");
string VSelfPointerText::replaceThis(bool useSelfForThis, const string& text) {
return useSelfForThis ? VString::replaceWord(text, "this", "vlSelf") : text;
}
string VSelfPointerText::protect(bool useSelfForThis, bool protect) const {
const string& sp
= useSelfForThis ? VString::replaceWord(asString(), "this", "vlSelf") : asString();
return VIdProtect::protectWordsIf(sp, protect);
return VIdProtect::protectWordsIf(replaceThis(useSelfForThis, asString()), protect);
}
//######################################################################