Adjust to reduce duplication
This commit is contained in:
@@ -1784,13 +1784,15 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
||||
* If it's a comprehension, the only POP_TOP should be
|
||||
* a call to append the iter to the list.
|
||||
*/
|
||||
if (value.type() == ASTNode::NODE_CALL && !value.cast<ASTCall>()->pparams().empty() ) {
|
||||
PycRef<ASTNode> res = value.cast<ASTCall>()->pparams().front();
|
||||
|
||||
if (value.type() == ASTNode::NODE_CALL) {
|
||||
auto& pparams = value.cast<ASTCall>()->pparams();
|
||||
if (!pparams.empty()) {
|
||||
PycRef<ASTNode> res = pparams.front();
|
||||
stack.push(new ASTComprehension(res));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Pyc::PRINT_ITEM:
|
||||
{
|
||||
|
Reference in New Issue
Block a user