//usr/lib64/lib64//lib64//python2.7/ó
ÛœSec @ s d Z d d l m Z d d l m Z d d l m Z d d l m Z m
Z
m Z d Z d e j
f d „ ƒ YZ d „ Z d
„ Z d „ Z d S(
s. Fixer for it.next() -> next(it), per PEP 3114.i ( t token( t python_symbols( t
fixer_base( t Namet Callt find_bindings; Calls to builtin next() possibly shadowed by global bindingt FixNextc B s, e Z e Z d Z d Z d „ Z d „ Z RS( s¾
power< base=any+ trailer< '.' attr='next' > trailer< '(' ')' > >
|
power< head=any+ trailer< '.' attr='next' > not trailer< '(' ')' > >
|
classdef< 'class' any+ ':'
suite< any*
funcdef< 'def'
name='next'
parameters< '(' NAME ')' > any+ >
any* > >
|
global=global_stmt< 'global' any* 'next' any* >
t prec C sW t t | ƒ j | | ƒ t d | ƒ } | rJ | j | t ƒ t | _ n t | _ d S( Nu next( t superR t
start_treeR t warningt bind_warningt Truet
shadowed_nextt False( t selft treet filenamet n( ( s. /usr/lib64/python2.7/lib2to3/fixes/fix_next.pyR $ s c C sƒ | j d ƒ } | j d ƒ } | j d ƒ } | r¯ | j r[ | j t d d | j ƒƒ qg | D] } | j ƒ ^ qb } d | d _ | j t t d d | j ƒ| ƒ ƒ nÐ | rÚ t d d | j ƒ} | j | ƒ n¥ | rWt | ƒ rA| d } d
j g | D] } t | ƒ ^ qƒ j
ƒ d k r=| j | t ƒ n d S| j t d ƒ ƒ n( d | k r| j | t ƒ t
| _ n d S(
Nt baset attrt nameu __next__t prefixu i u nextt headt u __builtin__t global( t getR
t replaceR R t cloneR t is_assign_targett joint strt stripR
R R ( R t nodet resultsR R R R R ( ( s. /usr/lib64/python2.7/lib2to3/fixes/fix_next.pyt transform. s,
(
4( t __name__t
__module__R t
BM_compatiblet PATTERNt orderR R# ( ( ( s. /usr/lib64/python2.7/lib2to3/fixes/fix_next.pyR s
c C s] t | ƒ } | d k r t Sx: | j D]/ } | j t j k rB t St | | ƒ r&