ó
xFWgc           @   sW   d  Z  d d l m Z d d l m Z i d d 6d d 6Z d e j f d	 „  ƒ  YZ d
 S(   s¢   Fixer for unicode.

* Changes unicode to str and unichr to chr.

* If "...\u..." is not unicode literal change it into "...\\u...".

* Change u"..." into "...".

i   (   t   token(   t
   fixer_baseu   chru   unichru   stru   unicodet
   FixUnicodec           B   s&   e  Z e Z d  Z d „  Z d „  Z RS(   s   STRING | 'unicode' | 'unichr'c         C   s/   t  t |  ƒ j | | ƒ d | j k |  _ d  S(   Nt   unicode_literals(   t   superR   t
   start_treet   future_featuresR   (   t   selft   treet   filename(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_unicode.pyR      s    c         C   s  | j  t j k r2 | j ƒ  } t | j | _ | S| j  t j k r| j } |  j r¹ | d d k r¹ d | k r¹ d j g  | j	 d ƒ D]$ } | j
 d d ƒ j
 d d ƒ ^ q‰ ƒ } n  | d d	 k rÖ | d
 } n  | | j k ré | S| j ƒ  } | | _ | Sd  S(   Ni    u   '"u   \u   \\u   \uu   \\uu   \Uu   \\Uu   uUi   (   t   typeR    t   NAMEt   clonet   _mappingt   valuet   STRINGR   t   joint   splitt   replace(   R   t   nodet   resultst   newt   valt   v(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_unicode.pyt	   transform   s"    	&=	(   t   __name__t
   __module__t   Truet   BM_compatiblet   PATTERNR   R   (    (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_unicode.pyR      s   	N(   t   __doc__t   pgen2R    t    R   R   t   BaseFixR   (    (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_unicode.pyt   <module>	   s   