Display whether an assignment is to a local or global variable

This commit is contained in:
Deukhoofd 2019-09-07 12:48:17 +02:00
parent dd98a34b63
commit 5c63b15ab7
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 7 additions and 1 deletions

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);
}
};