def n_list_comp_pypy27(self, node):
        """List comprehensions in PYPY."""
        p = self.prec
        self.prec = 27
        if node[-1].kind == 'list_iter':
            n = node[-1]
        elif self.is_pypy and node[-1] == 'JUMP_BACK':
            n = node[-2]
        list_expr = node[1]

        if len(node) >= 3:
            store = node[3]
        elif self.is_pypy and n[0] == 'list_for':
            store = n[0][2]

        assert n == 'list_iter'
        assert store == 'store'

        # Find the list comprehension body. It is the inner-most
        # node.
        # FIXME: DRY with other use
        while n == 'list_iter':
            n = n[0] # iterate one nesting deeper
            if   n == 'list_for':	n = n[3]
            elif n == 'list_if':	n = n[2]
            elif n == 'list_if_not': n = n[2]
        assert n == 'lc_body'
        self.write( '[ ')

        expr = n[0]
        if self.is_pypy and node[-1] == 'JUMP_BACK':
            list_iter = node[-2]
        else:
            list_iter = node[-1]

        assert expr == 'expr'
        assert list_iter == 'list_iter'

        # FIXME: use source line numbers for directing line breaks

        self.preorder(expr)
        self.preorder(list_expr)
        self.write( ' ]')
        self.prec = p
        self.prune()
def n_list_comp_pypy27 ( self , node ) : p = self . prec self . prec = 27 if node [ - 1 ] . kind == 'list_iter' : n = node [ - 1 ] elif self . is_pypy and node [ - 1 ] == 'JUMP_BACK' : n = node [ - 2 ] list_expr = node [ 1 ] if len ( node ) >= 3 : store = node [ 3 ] elif self . is_pypy and n [ 0 ] == 'list_for' : store = n [ 0 ] [ 2 ] assert n == 'list_iter' assert store == 'store' while n == 'list_iter' : n = n [ 0 ] if n == 'list_for' : n = n [ 3 ] elif n == 'list_if' : n = n [ 2 ] elif n == 'list_if_not' : n = n [ 2 ] assert n == 'lc_body' self . write ( '[ ' ) expr = n [ 0 ] if self . is_pypy and node [ - 1 ] == 'JUMP_BACK' : list_iter = node [ - 2 ] else : list_iter = node [ - 1 ] assert expr == 'expr' assert list_iter == 'list_iter' self . preorder ( expr ) self . preorder ( list_expr ) self . write ( ' ]' ) self . prec = p self . prune ( )
List comprehensions in PYPY.