-/* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2015 Jay Freeman (saurik)
+/* Cycript - The Truly Universal Scripting Language
+ * Copyright (C) 2009-2016 Jay Freeman (saurik)
*/
/* GNU Affero General Public License, Version 3 {{{ */
}
void CYImplementationField::Output(CYOutput &out) const {
+ out << *typed_;
+ out.Terminate();
+ out << '\n';
}
void CYInstanceLiteral::Output(CYOutput &out, CYFlags flags) const {
out << (instance_ ? '-' : '+');
CYForEach (parameter, parameters_)
- if (parameter->tag_ != NULL) {
- out << ' ' << *parameter->tag_;
+ if (parameter->name_ != NULL) {
+ out << ' ' << *parameter->name_;
if (parameter->type_ != NULL)
out << ':' << *parameter->type_->identifier_;
}
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 {
}
void CYSelector::Output(CYOutput &out, CYFlags flags) const {
- out << "@selector" << '(' << name_ << ')';
+ out << "@selector" << '(' << parts_ << ')';
}
void CYSelectorPart::Output(CYOutput &out) const {