Display whether an assignment is to a local or global variable

This commit is contained in:
2019-09-07 12:48:17 +02:00
parent dd98a34b63
commit 5c63b15ab7

View File

@@ -179,7 +179,13 @@ namespace Porygon::Binder {
void GetTreeString(std::stringstream& stream, size_t indents) const override{
DrawIndents(stream, indents);
stream << "Assignment -> " << _key->GetIdentifier()->GetDebugString() << endl;
stream << "Assignment -> ";
if (_key->GetScopeId() == 0){
stream << "global ";
} else{
stream << "local ";
}
stream << _key->GetIdentifier()->GetDebugString() << endl;
_expression->GetTreeString(stream, indents + 1);
}
};