X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/2aa77fd825c02cabbe13f9ccdc486012f65e4707..f37e350174fca2296b6052746d6e0a9796ad67cb:/Library.mm diff --git a/Library.mm b/Library.mm index 08170ea..3357080 100644 --- a/Library.mm +++ b/Library.mm @@ -67,7 +67,7 @@ #include "Parser.hpp" #include "Cycript.tab.hh" -#include +#include #undef _assert #undef _trace @@ -1280,10 +1280,6 @@ NSString *NSCFType$cy$toJSON(id self, SEL sel, NSString *key) { @end -CYRange DigitRange_ (0x3ff000000000000LLU, 0x000000000000000LLU); // 0-9 -CYRange WordStartRange_(0x000001000000000LLU, 0x7fffffe87fffffeLLU); // A-Za-z_$ -CYRange WordEndRange_ (0x3ff001000000000LLU, 0x7fffffe87fffffeLLU); // A-Za-z_$0-9 - #define CYTry \ @try #define CYCatch \ @@ -3317,41 +3313,6 @@ static JSStaticFunction Type_staticFunctions[4] = { {NULL, NULL, 0} }; -CYDriver::CYDriver(const std::string &filename) : - state_(CYClear), - data_(NULL), - size_(0), - file_(NULL), - strict_(false), - filename_(filename), - program_(NULL) -{ - ScannerInit(); -} - -CYDriver::~CYDriver() { - ScannerDestroy(); -} - -void CYDriver::Warning(const cy::location &location, const char *message) { - if (!strict_) - return; - - CYDriver::Error error; - error.warning_ = true; - error.location_ = location; - error.message_ = message; - errors_.push_back(error); -} - -void cy::parser::error(const cy::parser::location_type &location, const std::string &message) { - CYDriver::Error error; - error.warning_ = false; - error.location_ = location; - error.message_ = message; - driver.errors_.push_back(error); -} - void CYSetArgs(int argc, const char *argv[]) { JSContextRef context(CYGetJSContext()); JSValueRef args[argc]; @@ -3466,6 +3427,8 @@ struct CYClient : json = NULL; size = _not(size_t); } else { + CYContext context(driver.pool_); + driver.program_->Replace(context); std::ostringstream str; CYOutput out(str); out << *driver.program_;