X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/a7d8b4130acfb550e437d8cf1f6d3d81cb0cf6ee..a196a97ab164eed3f08ce1fb944c11486e99e320:/Complete.cpp diff --git a/Complete.cpp b/Complete.cpp index 13590bb..c81f90e 100644 --- a/Complete.cpp +++ b/Complete.cpp @@ -22,7 +22,6 @@ #include "cycript.hpp" #include "Driver.hpp" -#include "Cycript.tab.hh" #include "Replace.hpp" #include "String.hpp" @@ -30,9 +29,7 @@ static CYExpression *ParseExpression(CYPool &pool, CYUTF8String code) { std::stringstream stream; stream << '(' << code << ')'; CYDriver driver(pool, stream); - - cy::parser parser(driver); - if (parser.parse() != 0 || !driver.errors_.empty()) + if (driver.Parse() || !driver.errors_.empty()) return NULL; CYOptions options; @@ -59,8 +56,7 @@ _visible char **CYComplete(const char *word, const std::string &line, CYUTF8Stri driver.auto_ = true; - cy::parser parser(driver); - if (parser.parse() != 0 || !driver.errors_.empty()) + if (driver.Parse() || !driver.errors_.empty()) return NULL; if (driver.mode_ == CYDriver::AutoNone) @@ -137,8 +133,12 @@ _visible char **CYComplete(const char *word, const std::string &line, CYUTF8Stri std::string common; bool rest(false); - CYForEach (element, array->elements_) { - CYString *string(dynamic_cast(element->value_)); + for (CYElement *element(array->elements_); element != NULL; ) { + CYElementValue *value(dynamic_cast(element)); + _assert(value != NULL); + element = value->next_; + + CYString *string(dynamic_cast(value->value_)); _assert(string != NULL); std::string completion;