X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/3e6377dbb8b69d8d6d0e3e28fe5e02fd7aabe5f8..8f41509fd52c574f447fe0e40555530de3fda431:/Console.cpp diff --git a/Console.cpp b/Console.cpp index 7205529..9d3d65a 100644 --- a/Console.cpp +++ b/Console.cpp @@ -227,11 +227,14 @@ static CYExpression *ParseExpression(CYUTF8String code) { CYOptions options; CYContext context(options); - // XXX: this could be replaced with a CYStatement::Primitive() - if (CYExpress *express = dynamic_cast(driver.program_->statements_)) - return express->expression_->Primitive(context); + CYStatement *statement(driver.program_->statements_); + _assert(statement != NULL); + _assert(statement->next_ == NULL); - return NULL; + CYExpress *express(dynamic_cast(driver.program_->statements_)); + _assert(express != NULL); + + return express->expression_; } static int client_; @@ -316,8 +319,7 @@ static char **Complete(const char *word, int start, int end) { if (result == NULL) return NULL; - CYArray *array(dynamic_cast(result)); - + CYArray *array(dynamic_cast(result->Primitive(context))); if (array == NULL) { *out_ << '\n'; Output(false, json, out_);