X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/8d7447c170dd11c91d0a07768f32a2699177fa54..e06e5ee1f12b9b79b34570e65c1f5e9c12b9b8c3:/Console.cpp diff --git a/Console.cpp b/Console.cpp index 09298a1..d669e67 100644 --- a/Console.cpp +++ b/Console.cpp @@ -213,9 +213,14 @@ static CYExpression *ParseExpression(CYUTF8String code) { if (parser.parse() != 0 || !driver.errors_.empty()) return NULL; - CYExpress *express(dynamic_cast(driver.program_->statements_)); - _assert(express != NULL); - return express->expression_; + 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); + + return NULL; } static int client_;