]> git.saurik.com Git - cycript.git/blobdiff - Replace.cpp
Replace the svnversion mechanism with git describe.
[cycript.git] / Replace.cpp
index 8023bdb112bb9c784f891bc58c2cf1b5b8e2b7f5..e6b761f6bdd17b34e8d3744f13bc9953f7c6ec0f 100644 (file)
@@ -453,10 +453,7 @@ namespace cy {
 namespace Syntax {
 
 CYExpression *New::AddArgument(CYContext &context, CYExpression *value) {
-    CYArgument **argument(&arguments_);
-    while (*argument != NULL)
-        argument = &(*argument)->next_;
-    *argument = $ CYArgument(value);
+    CYSetLast(arguments_, $ CYArgument(value));
     return this;
 }
 
@@ -549,8 +546,8 @@ void CYProgram::Replace(CYContext &context) {
     IdentifierUsages usages;
 
     if (offset < context.rename_.size())
-        for (CYIdentifier *i(context.rename_[offset].identifier_); i != NULL; i = i->next_)
-             usages.insert(i);
+        CYForEach (i, context.rename_[offset].identifier_)
+            usages.insert(i);
 
     // XXX: totalling the probable occurrences and sorting by them would improve the result
     for (CYIdentifierUsageVector::const_iterator i(context.rename_.begin()); i != context.rename_.end(); ++i, ++offset) {
@@ -582,7 +579,7 @@ void CYProgram::Replace(CYContext &context) {
             // XXX: at some point, this could become a keyword
         }
 
-        for (CYIdentifier *identifier(i->identifier_); identifier != NULL; identifier = identifier->next_)
+        CYForEach (identifier, i->identifier_)
             identifier->Set(name);
     }
 }
@@ -624,6 +621,9 @@ CYScope::CYScope(CYScopeType type, CYContext &context, CYStatement *&statements)
     context_.scope_ = this;
 }
 
+CYScope::~CYScope() {
+}
+
 void CYScope::Close() {
     context_.scope_ = parent_;
     Scope(context_, statements_);