]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Replace.cpp
Bridge NSBlock as a callable JavaScript function.
[cycript.git] / ObjectiveC / Replace.cpp
index 35389b9086b84f4832c6c0f68c415742b4e06e54..748fc6fcbe116076184f41a5f57357081da24d9d 100644 (file)
@@ -104,6 +104,10 @@ CYSelectorPart *CYMessageParameter::SelectorPart(CYContext &context) const { $T(
     return tag_ == NULL ? next : $ CYSelectorPart(tag_, name_ != NULL, next);
 }
 
+CYExpression *CYBox::Replace(CYContext &context) {
+    return $C1($M($V("Instance"), $S("box")), value_);
+}
+
 CYStatement *CYProtocol::Replace(CYContext &context) const { $T(NULL)
     return $ CYBlock($$->*
         next_->Replace(context)->*
@@ -119,7 +123,7 @@ CYExpression *CYSelector::Replace(CYContext &context) {
 
 CYString *CYSelectorPart::Replace(CYContext &context) {
     std::ostringstream str;
-    for (const CYSelectorPart *part(this); part != NULL; part = part->next_) {
+    CYForEach (part, this) {
         if (part->name_ != NULL)
             str << part->name_->Word();
         if (part->value_)
@@ -154,5 +158,5 @@ CYExpression *CYSendDirect::Replace(CYContext &context) {
 }
 
 CYExpression *CYSendSuper::Replace(CYContext &context) {
-    return $ CYSendDirect($V("cyr"), arguments_);
+    return $ CYSendDirect($V("$cyr"), arguments_);
 }