]> git.saurik.com Git - cycript.git/blobdiff - Output.cpp
Port Objective-C/Replace to C++.
[cycript.git] / Output.cpp
index a3765dad8976de084c6a42319755ce1ab5b9dc75..67c9877a492d7d63ff92e3e20b8bc322f5be5315 100644 (file)
@@ -326,7 +326,7 @@ void CYDeclarations::Output(CYOutput &out, CYFlags flags) const {
 }
 
 void CYDirectMember::Output(CYOutput &out, CYFlags flags) const {
-    object_->Output(out, Precedence(), CYLeft(flags));
+    object_->Output(out, Precedence(), CYLeft(flags) | CYNoInteger);
     if (const char *word = property_->Word())
         out << '.' << word;
     else
@@ -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);
 }
@@ -560,6 +565,13 @@ void CYObject::Output(CYOutput &out, CYFlags flags) const {
         out << ')';
 }
 
+void CYOptionalFunctionParameter::Output(CYOutput &out) const {
+    out << *name_ << '=';
+    initializer_->Output(out, CYPA, CYNoFlags);
+    if (next_ != NULL)
+        out << ',' << ' ' << *next_;
+}
+
 void CYPostfix::Output(CYOutput &out, CYFlags flags) const {
     lhs_->Output(out, Precedence(), CYLeft(flags));
     out << Operator();
@@ -600,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_) {