Internals: Rework self pointers (#4396)

This commit is contained in:
Krzysztof Bieganski
2023-09-08 07:34:35 -04:00
committed by GitHub
parent 9882ab6c67
commit fb1fc46b06
13 changed files with 120 additions and 55 deletions
+12
View File
@@ -63,6 +63,18 @@ const VNTypeInfo VNType::typeInfoTable[] = {
std::ostream& operator<<(std::ostream& os, VNType rhs);
//######################################################################
// VSelfPointerText
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::protect(bool useSelfForThis, bool protect) const {
const string& sp
= useSelfForThis ? VString::replaceWord(asString(), "this", "vlSelf") : asString();
return VIdProtect::protectWordsIf(sp, protect);
}
//######################################################################
// AstNode