]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Output.mm
Upgrade copyright notice (2013, mk, sh, GPLv3).
[cycript.git] / ObjectiveC / Output.mm
index 91696cbba288da01b2917eeabc8548872aa95e85..33f7ee795c78b5cb7740135b3d92fc2a559cacec 100644 (file)
@@ -1,20 +1,20 @@
 /* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2010  Jay Freeman (saurik)
+ * Copyright (C) 2009-2013  Jay Freeman (saurik)
 */
 
-/* GNU Lesser General Public License, Version 3 {{{ */
+/* GNU General Public License, Version 3 {{{ */
 /*
- * Cycript is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or (at your
- * option) any later version.
+ * Cycript is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
  *
- * Cycript is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
+ * Cycript is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public License
+ * You should have received a copy of the GNU General Public License
  * along with Cycript.  If not, see <http://www.gnu.org/licenses/>.
 **/
 /* }}} */
@@ -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)