Ñò
$8Zc           @   so   d  Z  d d k l Z d d k l Z d d k l Z d d k l Z l Z l	 Z	 d e i
 f d „  ƒ  YZ d S(	   sI   Fixer for apply().

This converts apply(func, v, k) into (func)(*v, **k).i   (   t   pytree(   t   token(   t
   fixer_base(   t   Callt   Commat   parenthesizet   FixApplyc           B   s   e  Z d  Z d „  Z RS(   s.  
    power< 'apply'
        trailer<
            '('
            arglist<
                (not argument<NAME '=' any>) func=any ','
                (not argument<NAME '=' any>) args=any [','
                (not argument<NAME '=' any>) kwds=any] [',']
            >
            ')'
        >
    >
    c   	      C   s`  |  i  } | p t ‚ | d } | d } | i d ƒ } | i } | i ƒ  } | i t i | i f j o= | i | i	 j p | i
 d i t i j o t | ƒ } n d | _ | i ƒ  } d | _ | d  j	 o | i ƒ  } d | _ n t i t i d ƒ | g } | d  j	 o9 | i t ƒ  t i t i d ƒ | g ƒ d | d _ n t | | d	 | ƒS(
   Nt   funct   argst   kwdsiþÿÿÿt    u   *u   **u    t   prefix(   t   symst   AssertionErrort   getR   t   clonet   typeR   t   NAMEt   atomt   powert   childrent
   DOUBLESTARR   t   NoneR    t   Leaft   STARt   extendR   R   (	   t   selft   nodet   resultsR   R   R   R	   R   t	   l_newargs(    (    s-   /usr/lib/python2.6/lib2to3/fixes/fix_apply.pyt	   transform   s0    	

			
(   t   __name__t
   __module__t   PATTERNR   (    (    (    s-   /usr/lib/python2.6/lib2to3/fixes/fix_apply.pyR      s   N(   t   __doc__R
   R    t   pgen2R   R   t
   fixer_utilR   R   R   t   BaseFixR   (    (    (    s-   /usr/lib/python2.6/lib2to3/fixes/fix_apply.pyt   <module>   s
   