X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/ee6c04ef0082bcd8ca62240dc8278f22d8372cf1..4e3c905634abeaeea78747ce2be0adce06cc777a:/Library.cpp diff --git a/Library.cpp b/Library.cpp index 5c5c97d..f5eb1c3 100644 --- a/Library.cpp +++ b/Library.cpp @@ -19,14 +19,8 @@ **/ /* }}} */ -#include - #include "cycript.hpp" -#include "Pooling.hpp" - -#include - #include #include #include @@ -34,15 +28,17 @@ #include #include -#include "Error.hpp" -#include "Execute.hpp" -#include "Parser.hpp" -#include "String.hpp" +#include -#include "Cycript.tab.hh" -#include "Driver.hpp" +#include #include "ConvertUTF.h" +#include "Driver.hpp" +#include "Error.hpp" +#include "Execute.hpp" +#include "Pooling.hpp" +#include "String.hpp" +#include "Syntax.hpp" template <> ::pthread_key_t CYLocal::key_ = Key_(); @@ -219,19 +215,17 @@ double CYCastDouble(const char *value) { CYUTF8String CYPoolCode(CYPool &pool, std::istream &stream) { CYLocalPool local; - CYDriver driver(stream); - - cy::parser parser(driver); - _assert(parser.parse() == 0); + CYDriver driver(local, stream); + _assert(!driver.Parse()); _assert(driver.errors_.empty()); CYOptions options; CYContext context(options); - driver.program_->Replace(context); + driver.script_->Replace(context); std::stringbuf str; CYOutput out(str, options); - out << *driver.program_; + out << *driver.script_; return $pool.strdup(str.str().c_str()); } @@ -240,7 +234,7 @@ CYPool &CYGetGlobalPool() { return pool; } -void CYThrow(const char *format, ...) { +_visible void CYThrow(const char *format, ...) { va_list args; va_start(args, format); throw CYPoolError(format, args);