]> git.saurik.com Git - cycript.git/blobdiff - Output.cpp
Port Objective-C/Replace to C++.
[cycript.git] / Output.cpp
index 989781ab575380ceff675b6897656c399e9c01cb..67c9877a492d7d63ff92e3e20b8bc322f5be5315 100644 (file)
@@ -521,7 +521,10 @@ void CYLet::Output(CYOutput &out, CYFlags flags) const {
     out << "let" << ' ' << '(' << *declarations_ << ')' << ' ' << code_;
 }
 
-void CYNew::Output(CYOutput &out, CYFlags flags) const {
+namespace cy {
+namespace Syntax {
+
+void New::Output(CYOutput &out, CYFlags flags) const {
     out << "new" << ' ';
     CYFlags jacks(CYNoCall | CYCenter(flags));
     constructor_->Output(out, Precedence(), jacks);
@@ -529,6 +532,8 @@ void CYNew::Output(CYOutput &out, CYFlags flags) const {
         out << '(' << *arguments_ << ')';
 }
 
+} }
+
 void CYNull::Output(CYOutput &out, CYFlags flags) const {
     CYWord::Output(out);
 }
@@ -561,7 +566,7 @@ void CYObject::Output(CYOutput &out, CYFlags flags) const {
 }
 
 void CYOptionalFunctionParameter::Output(CYOutput &out) const {
-    out << *name_ << ' ' << '=' << ' ';
+    out << *name_ << '=';
     initializer_->Output(out, CYPA, CYNoFlags);
     if (next_ != NULL)
         out << ',' << ' ' << *next_;
@@ -607,6 +612,17 @@ void CYReturn::Output(CYOutput &out, CYFlags flags) const {
     out << ';';
 }
 
+void CYRubyBlock::Output(CYOutput &out, CYFlags flags) const {
+    call_->Output(out, CYLeft(flags));
+    out << ' ';
+    proc_->Output(out, CYRight(flags));
+}
+
+void CYRubyProc::Output(CYOutput &out, CYFlags flags) const {
+    // XXX: this is not outputting the parameters
+    out << code_;
+}
+
 void CYStatement::Multiple(CYOutput &out, CYFlags flags) const {
     bool first(true);
     for (const CYStatement *next(this); next != NULL; next = next->next_) {