X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/561e7f1c23ea3804db1625ab806be939b4e9c5d1..56e02e5b879e679302c8d9a20654b8a193791a3a:/ObjectiveC/Replace.cpp diff --git a/ObjectiveC/Replace.cpp b/ObjectiveC/Replace.cpp index a8515a5..96f6663 100644 --- a/ObjectiveC/Replace.cpp +++ b/ObjectiveC/Replace.cpp @@ -166,6 +166,10 @@ CYExpression *CYBox::Replace(CYContext &context) { return $C1($M($V("Instance"), $S("box")), value_); } +CYExpression *CYObjCBlock::Replace(CYContext &context) { + return $N2($V("Functor"), $ CYFunctionExpression(NULL, parameters_->Parameters(context), statements_), parameters_->TypeSignature(context, type_->Replace(context))); +} + CYStatement *CYProtocol::Replace(CYContext &context) const { $T(NULL) return $ CYBlock($$->* next_->Replace(context)->* @@ -218,3 +222,11 @@ CYExpression *CYSendDirect::Replace(CYContext &context) { CYExpression *CYSendSuper::Replace(CYContext &context) { return $ CYSendDirect($V("$cyr"), arguments_); } + +CYFunctionParameter *CYTypedParameter::Parameters(CYContext &context) { $T(NULL) + return $ CYFunctionParameter($ CYDeclaration(typed_->identifier_), next_->Parameters(context)); +} + +CYExpression *CYTypedParameter::TypeSignature(CYContext &context, CYExpression *prefix) { $T(prefix) + return next_->TypeSignature(context, $ CYAdd(prefix, typed_->type_->Replace(context))); +}