Port Python 2.7 list comprehension fixes by @ReDucTor from #78

This commit is contained in:
Michael Hansen
2019-10-04 16:35:58 -07:00
parent 314f4a1a0d
commit b5696c8398
4 changed files with 40 additions and 2 deletions

View File

@@ -497,14 +497,17 @@ public:
PycRef<ASTNode> iter() const { return m_iter; }
PycRef<ASTNode> index() const { return m_idx; }
PycRef<ASTNode> condition() const { return m_cond; }
bool isComprehension() const { return m_comp; }
void setIndex(PycRef<ASTNode> idx) { m_idx = idx; init(); }
void setCondition(PycRef<ASTNode> cond) { m_cond = cond; }
void setComprehension(bool comp) { m_comp = comp; }
private:
PycRef<ASTNode> m_iter;
PycRef<ASTNode> m_idx;
PycRef<ASTNode> m_cond;
bool m_comp;
};