]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Output.mm
Use explicit typed value for CYCatch error return.
[cycript.git] / ObjectiveC / Output.mm
index 91696cbba288da01b2917eeabc8548872aa95e85..a2d765cbebc03164eacb03175fe22f46246b6388 100644 (file)
@@ -1,5 +1,5 @@
 /* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2010  Jay Freeman (saurik)
+ * Copyright (C) 2009-2012  Jay Freeman (saurik)
 */
 
 /* GNU Lesser General Public License, Version 3 {{{ */
@@ -75,6 +75,12 @@ void CYClassStatement::Output(CYOutput &out, CYFlags flags) const {
     CYClass::Output(out, flags);
 }
 
+void CYEncodedType::Output(CYOutput &out, CYFlags flags) const {
+    out << "@encode(";
+    // XXX: this is seriously wrong
+    out << ")";
+}
+
 void CYField::Output(CYOutput &out) const {
 }
 
@@ -85,7 +91,7 @@ void CYImport::Output(CYOutput &out, CYFlags flags) const {
 void CYMessage::Output(CYOutput &out, bool replace) const {
     out << (instance_ ? '-' : '+');
 
-    for (CYMessageParameter *parameter(parameters_); parameter != NULL; parameter = parameter->next_)
+    CYForEach (parameter, parameters_)
         if (parameter->tag_ != NULL) {
             out << ' ' << *parameter->tag_;
             if (parameter->name_ != NULL)
@@ -95,6 +101,19 @@ void CYMessage::Output(CYOutput &out, bool replace) const {
     out << code_;
 }
 
+void CYBox::Output(CYOutput &out, CYFlags flags) const {
+    out << '@';
+    value_->Output(out, Precedence(), CYRight(flags));
+}
+
+void CYObjCBlock::Output(CYOutput &out, CYFlags flags) const {
+    // XXX: this is seriously wrong
+    out << "^(";
+    out << ")";
+    out << "{";
+    out << "}";
+}
+
 void CYProtocol::Output(CYOutput &out) const {
     name_->Output(out, CYAssign::Precedence_, CYNoFlags);
     if (next_ != NULL)
@@ -113,7 +132,7 @@ void CYSelectorPart::Output(CYOutput &out) const {
 }
 
 void CYSend::Output(CYOutput &out, CYFlags flags) const {
-    for (CYArgument *argument(arguments_); argument != NULL; argument = argument->next_)
+    CYForEach (argument, arguments_)
         if (argument->name_ != NULL) {
             out << ' ' << *argument->name_;
             if (argument->value_ != NULL)