Skip to content

Commit

Permalink
Merge pull request #796 from Heathtech/master
Browse files Browse the repository at this point in the history
Resolves #772 to allow access to inherited vars
  • Loading branch information
JoshDreamland committed Aug 10, 2014
2 parents 488ee7d + 221c8f2 commit 74e178d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CompilerSource/compiler/components/write_object_access.cpp
Expand Up @@ -114,12 +114,20 @@ int lang_CPP::compile_writeObjAccess(map<int,parsed_object*> &parsed_objects, pa

for (po_i it = parsed_objects.begin(); it != parsed_objects.end(); it++)
{
map<string,dectrip>::iterator x = it->second->locals.find(pmember);
if (x != it->second->locals.end())
po_i parent = it;
while(parent != parsed_objects.end())
{
string tot = x->second.type != "" ? x->second.type : "var";
if (tot == dait->second.type and x->second.prefix == dait->second.prefix and x->second.suffix == dait->second.suffix)
wto << " case " << it->second->name << ": return ((OBJ_" << it->second->name << "*)inst)->" << pmember << ";" << endl;
map<string,dectrip>::iterator x = parent->second->locals.find(pmember);
if (x != parent->second->locals.end())
{
string tot = x->second.type != "" ? x->second.type : "var";
if (tot == dait->second.type and x->second.prefix == dait->second.prefix and x->second.suffix == dait->second.suffix)
{
wto << " case " << it->second->name << ": return ((OBJ_" << it->second->name << "*)inst)->" << pmember << ";" << endl;
break;
}
}
parent = parsed_objects.find(parent->second->parent);
}
}

Expand Down

0 comments on commit 74e178d

Please sign in to comment.