/* 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/>.
**/
/* }}} */
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 {
}
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)
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)
}
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)