X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/3f9ae37cb15f239389eeba110b3a7da0280a8381..8a81192b83961beebb4698b63e122e754ef40ada:/ObjectiveC/Replace.cpp?ds=sidebyside diff --git a/ObjectiveC/Replace.cpp b/ObjectiveC/Replace.cpp index 1f6c118..7c47eea 100644 --- a/ObjectiveC/Replace.cpp +++ b/ObjectiveC/Replace.cpp @@ -1,20 +1,20 @@ /* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2012 Jay Freeman (saurik) + * Copyright (C) 2009-2013 Jay Freeman (saurik) */ -/* GNU Lesser General Public License, Version 3 {{{ */ +/* GNU General Public License, Version 3 {{{ */ /* - * Cycript is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or (at your - * option) any later version. + * Cycript is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. * - * Cycript is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. + * Cycript is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License + * You should have received a copy of the GNU General Public License * along with Cycript. If not, see . **/ /* }}} */ @@ -78,22 +78,6 @@ CYStatement *CYClassStatement::Replace(CYContext &context) { return $E(Replace_(context)); } -CYExpression *CYTypeArrayOf::Replace(CYContext &context) { - return $ CYCall($ CYDirectMember(next_->Replace(context), $ CYString("arrayOf")), $ CYArgument($ CYNumber(size_))); -} - -CYExpression *CYTypeConstant::Replace(CYContext &context) { - return $ CYCall($ CYDirectMember(next_->Replace(context), $ CYString("constant"))); -} - -CYExpression *CYTypePointerTo::Replace(CYContext &context) { - return $ CYCall($ CYDirectMember(next_->Replace(context), $ CYString("pointerTo"))); -} - -CYExpression *CYTypeVariable::Replace(CYContext &context) { - return expression_; -} - CYExpression *CYEncodedType::Replace(CYContext &context) { return type_->Replace(context); } @@ -191,7 +175,7 @@ CYString *CYSelectorPart::Replace(CYContext &context) { if (part->value_) str << ':'; } - return $S(apr_pstrdup($pool, str.str().c_str())); + return $S($pool.strdup(str.str().c_str())); } CYExpression *CYSendDirect::Replace(CYContext &context) { @@ -222,11 +206,3 @@ 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))); -}