From 2c81c6df02e9a20c96234524b0a1db7801d542ec Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 19 Nov 2009 06:07:44 +0000 Subject: [PATCH 1/1] Fixed the stupid variable renaming issue at the top level. --- Darwin.mk | 1 - Parser.hpp | 6 ++---- Replace.cpp | 6 +++--- todo.txt | 1 + 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Darwin.mk b/Darwin.mk index 86c7c8a..d55abb2 100644 --- a/Darwin.mk +++ b/Darwin.mk @@ -1,7 +1,6 @@ # XXX: objective-c exists on non-Darwin dll := dylib -flags += -DCY_EXECUTE link += -lobjc -framework CoreFoundation console += -framework Foundation library += -install_name /usr/lib/libcycript.$(dll) diff --git a/Parser.hpp b/Parser.hpp index 9ff1d38..a963d7b 100644 --- a/Parser.hpp +++ b/Parser.hpp @@ -356,9 +356,7 @@ struct CYProgram : virtual void Output(CYOutput &out) const; }; -struct CYContext : - CYScope -{ +struct CYContext { apr_pool_t *pool_; CYOptions &options_; CYScope *scope_; @@ -367,7 +365,7 @@ struct CYContext : CYContext(apr_pool_t *pool, CYOptions &options) : pool_(pool), options_(options), - scope_(this) + scope_(NULL) { } diff --git a/Replace.cpp b/Replace.cpp index 8938704..c06c2a5 100644 --- a/Replace.cpp +++ b/Replace.cpp @@ -480,11 +480,8 @@ void CYProgram::Replace(CYContext &context) { CYScope scope; scope.parent_ = context.scope_; context.scope_ = &scope; - statements_ = statements_->ReplaceAll(context); - context.scope_ = scope.parent_; - scope.Scope(context, statements_); size_t offset(0); @@ -597,6 +594,9 @@ namespace { } void CYScope::Scope(CYContext &context, CYStatement *&statements) { + if (parent_ == NULL) + return; + CYDeclarations *last(NULL), *curr(NULL); IdentifierOffsets offsets; diff --git a/todo.txt b/todo.txt index 343ed26..b7480c1 100644 --- a/todo.txt +++ b/todo.txt @@ -25,3 +25,4 @@ NSArray's .toString() and .toLocaleString() fail hard, as Array.prototype.to*Str (4).toString() is legal, but I'm stripping the ()'s somehow in the serializer applyOnMainThread, when done at console, loops the cyonifier special work needs to be done to correctly handle the "arguments" symbol: Declare("arguments", ...Special) +at the Program level I seem to be eating away all of the var statements -- 2.45.2