X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/dc68b74c75a69f269748d1c28bbfa8b20b6d9e9f..9e562cfcfa97bb3140f16dd485e9c67d841a3132:/Output.cpp diff --git a/Output.cpp b/Output.cpp index fdbc733..f15b90d 100644 --- a/Output.cpp +++ b/Output.cpp @@ -79,6 +79,11 @@ void CYAssignment::Output(std::ostream &out, CYFlags flags) const { rhs_->Output(out, Precedence(), CYRight(flags)); } +void CYBlock::Output(std::ostream &out) const { + for (CYSource *statement(statements_); statement != NULL; statement = statement->next_) + statement->Output(out); +} + void CYBoolean::Output(std::ostream &out, CYFlags flags) const { if ((flags & CYNoLeader) != 0) out << ' '; @@ -529,11 +534,11 @@ void CYSend::Output(std::ostream &out, CYFlags flags) const { void CYSource::Show(std::ostream &out) const { for (const CYSource *next(this); next != NULL; next = next->next_) - next->Output(out); + next->Output_(out); } void CYSource::Output(std::ostream &out, bool block) const { - if (!block && next_ == NULL) + if (!block && !IsBlock()) Output(out); else { out << '{'; @@ -542,6 +547,16 @@ void CYSource::Output(std::ostream &out, bool block) const { } } +void CYSource::Output_(std::ostream &out) const { + Output(out); +} + +void CYStatement::Output_(std::ostream &out) const { + for (CYLabel *label(labels_); label != NULL; label = label->next_) + out << *label->name_ << ':'; + Output(out); +} + void CYString::Output(std::ostream &out, CYFlags flags) const { unsigned quot(0), apos(0); for (const char *value(value_), *end(value_ + size_); value != end; ++value)