Add parents (de)serialization in pip_cmg
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
|
||||
bool writeClassStreamMembersOut(Runtime & rt, const PICodeParser::Entity * e, int & cnt, bool simple, PIString var_prefix) {
|
||||
if (var_prefix.isNotEmpty() && !var_prefix.endsWith('.')) var_prefix += ".";
|
||||
for (const PICodeParser::Entity * p: e->parents) {
|
||||
if (p->is_anonymous) continue;
|
||||
if (!writeClassStreamMembersOut(rt, p, cnt, simple, var_prefix)) return false;
|
||||
}
|
||||
PIVector<PICodeParser::Member> ml;
|
||||
for (const PICodeParser::Member & m: e->members) {
|
||||
if (m.is_type_ptr || (m.visibility != PICodeParser::Public)) continue;
|
||||
@@ -83,6 +87,10 @@ bool writeClassStreamMembersOut(Runtime & rt, const PICodeParser::Entity * e, in
|
||||
|
||||
bool writeClassStreamMembersIn(Runtime & rt, const PICodeParser::Entity * e, int & cnt, bool simple, PIString var_prefix) {
|
||||
if (var_prefix.isNotEmpty() && !var_prefix.endsWith('.')) var_prefix += ".";
|
||||
for (const PICodeParser::Entity * p: e->parents) {
|
||||
if (p->is_anonymous) continue;
|
||||
if (!writeClassStreamMembersIn(rt, p, cnt, simple, var_prefix)) return false;
|
||||
}
|
||||
PIVector<PICodeParser::Member> ml;
|
||||
for (const PICodeParser::Member & m: e->members) {
|
||||
if (m.is_type_ptr || (m.visibility != PICodeParser::Public)) continue;
|
||||
@@ -166,6 +174,10 @@ bool needClassStream(const PICodeParser::Entity * e) {
|
||||
if (m.meta.value("id") == "-") continue;
|
||||
return true;
|
||||
}
|
||||
for (const PICodeParser::Entity * p: e->parents) {
|
||||
if (p->is_anonymous) continue;
|
||||
if (needClassStream(p)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user