X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/09fc3efbc1e9a22b345b6e542737fc682a1f4332..db2cc900d3756ae83a1ce9ecf3e6d9733fc747d3:/ObjectiveC/Output.cpp diff --git a/ObjectiveC/Output.cpp b/ObjectiveC/Output.cpp index a1101ec..37f86b1 100644 --- a/ObjectiveC/Output.cpp +++ b/ObjectiveC/Output.cpp @@ -49,6 +49,9 @@ void CYImplementation::Output(CYOutput &out, CYFlags flags) const { } void CYImplementationField::Output(CYOutput &out) const { + out << *typed_; + out.Terminate(); + out << '\n'; } void CYInstanceLiteral::Output(CYOutput &out, CYFlags flags) const { @@ -74,12 +77,31 @@ void CYBox::Output(CYOutput &out, CYFlags flags) const { value_->Output(out, Precedence(), CYRight(flags)); } +void CYObjCArray::Output(CYOutput &out, CYFlags flags) const { + out << '@' << '[' << elements_ << ']'; +} + +void CYObjCDictionary::Output(CYOutput &out, CYFlags flags) const { + out << '@' << '{' << '}'; +} + void CYObjCBlock::Output(CYOutput &out, CYFlags flags) const { - // XXX: this is seriously wrong - out << "^("; - out << ")"; - out << "{"; - out << "}"; + out << '^' << ' ' << *typed_ << ' ' << '('; + + bool comma(false); + CYForEach (parameter, parameters_) { + if (comma) + out << ',' << ' '; + else + comma = true; + out << *parameter->typed_; + } + + out << ')' << ' ' << '{' << '\n'; + ++out.indent_; + out << code_; + --out.indent_; + out << '\n' << '}'; } void CYProtocol::Output(CYOutput &out) const {