]> git.saurik.com Git - cycript.git/blobdiff - Output.cpp
Add all supported binding API headers to analysis.
[cycript.git] / Output.cpp
index dc5782a2491af1fc0989e59eeef9cd3456a756e5..987abf61c8c6fc791ab878140c4aa060354daeaa 100644 (file)
@@ -326,7 +326,7 @@ void CYCondition::Output(CYOutput &out, CYFlags flags) const {
     test_->Output(out, Precedence() - 1, CYLeft(flags));
     out << ' ' << '?' << ' ';
     if (true_ != NULL)
-        true_->Output(out, CYAssign::Precedence_, CYNoFlags);
+        true_->Output(out, CYAssign::Precedence_, CYNoColon);
     out << ' ' << ':' << ' ';
     false_->Output(out, CYAssign::Precedence_, CYRight(flags));
 }
@@ -340,10 +340,12 @@ void CYContinue::Output(CYOutput &out, CYFlags flags) const {
 
 void CYClause::Output(CYOutput &out) const {
     out << '\t';
-    if (value_ != NULL)
-        out << "case" << ' ' << *value_;
-    else
+    if (value_ == NULL)
         out << "default";
+    else {
+        out << "case" << ' ';
+        value_->Output(out, CYNoColon);
+    }
     out << ':' << '\n';
     ++out.indent_;
     out << code_;
@@ -450,6 +452,11 @@ void CYExpression::Output(CYOutput &out, int precedence, CYFlags flags) const {
         Output(out, flags);
 }
 
+void CYExtend::Output(CYOutput &out, CYFlags flags) const {
+    lhs_->Output(out, CYLeft(flags));
+    out << ' ' << object_;
+}
+
 void CYExternal::Output(CYOutput &out, CYFlags flags) const {
     out << "extern" << abi_ << typed_;
     out.Terminate();
@@ -677,7 +684,13 @@ void CYTypeConstant::Output(CYOutput &out, CYIdentifier *identifier) const {
 
 void CYTypeFunctionWith::Output(CYOutput &out, CYIdentifier *identifier) const {
     next_->Output(out, Precedence(), identifier);
-    out << '(' << parameters_ << ')';
+    out << '(' << parameters_;
+    if (variadic_) {
+        if (parameters_ != NULL)
+            out << ',' << ' ';
+        out << "...";
+    }
+    out << ')';
 }
 
 void CYTypePointerTo::Output(CYOutput &out, CYIdentifier *identifier) const {
@@ -848,6 +861,14 @@ void CYRegEx::Output(CYOutput &out, CYFlags flags) const {
     out << Value();
 }
 
+void CYResolveMember::Output(CYOutput &out, CYFlags flags) const {
+    object_->Output(out, Precedence(), CYLeft(flags));
+    if (const char *word = property_->Word())
+        out << "::" << word;
+    else
+        out << "::" << '[' << *property_ << ']';
+}
+
 void CYReturn::Output(CYOutput &out, CYFlags flags) const {
     out << "return";
     if (value_ != NULL)
@@ -856,7 +877,7 @@ void CYReturn::Output(CYOutput &out, CYFlags flags) const {
 }
 
 void CYRubyBlock::Output(CYOutput &out, CYFlags flags) const {
-    call_->Output(out, CYLeft(flags));
+    lhs_->Output(out, CYLeft(flags));
     out << ' ';
     proc_->Output(out, CYRight(flags));
 }
@@ -869,6 +890,11 @@ void CYRubyProc::Output(CYOutput &out, CYFlags flags) const {
     out << '\t' << '}';
 }
 
+void CYSubscriptMember::Output(CYOutput &out, CYFlags flags) const {
+    object_->Output(out, Precedence(), CYLeft(flags));
+    out << "." << '[' << *property_ << ']';
+}
+
 void CYStatement::Multiple(CYOutput &out, CYFlags flags) const {
     bool first(true);
     CYForEach (next, this) {
@@ -987,6 +1013,15 @@ void CYSwitch::Output(CYOutput &out, CYFlags flags) const {
     out << '\t' << '}';
 }
 
+void CYSymbol::Output(CYOutput &out, CYFlags flags) const {
+    bool protect((flags & CYNoColon) != 0);
+    if (protect)
+        out << '(';
+    out << ':' << name_;
+    if (protect)
+        out << ')';
+}
+
 void CYThis::Output(CYOutput &out, CYFlags flags) const {
     out << "this";
 }