Ñò
$8Zc           @   s•   d  Z  d d k Z h
 d d 6d d 6d d 6d	 d
 6d d 6d d 6d d 6d d 6d d 6d d 6Z d „  Z d „  Z d „  Z e d j o e ƒ  n d S(   s<   Safely evaluate Python string literals without using eval().iÿÿÿÿNs   t   as   t   bs   t   fs   
t   ns   t   rs   	t   ts   t   vt   't   "s   \c         C   s  |  i  d d ƒ \ } } | i d ƒ p t ‚ t i | ƒ } | d  j	 o | S| i d ƒ on | d } t | ƒ d j  o t d | ƒ ‚ n y t | d ƒ } Wqt j
 o t d | ƒ ‚ qXn: y t | d ƒ } Wn# t j
 o t d	 | ƒ ‚ n Xt	 | ƒ S(
   Ni    i   s   \t   xi   s!   invalid hex string escape ('\%s')i   i   s#   invalid octal string escape ('\%s')(
   t   groupt
   startswitht   AssertionErrort   simple_escapest   gett   Nonet   lent
   ValueErrort   intt   chr(   t   mt   allt   tailt   esct   hexest   i(    (    s,   /usr/lib/python2.6/lib2to3/pgen2/literals.pyt   escape   s$    
c         C   sÝ   |  i  d ƒ p$ |  i  d ƒ p t t |  d  ƒ ‚ |  d } |  d  | d j o | d } n |  i | ƒ p t t |  t | ƒ ƒ ‚ t |  ƒ d t | ƒ j p t ‚ |  t | ƒ t | ƒ !}  t i d t |  ƒ S(   NR   R   i   i    i   i   s)   \\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3})(   R   R   t   reprt   endswithR   t   ret   subR   (   t   st   q(    (    s,   /usr/lib/python2.6/lib2to3/pgen2/literals.pyt
   evalString(   s    4
+$c          C   sa   xZ t  d ƒ D]L }  t |  ƒ } t | ƒ } t | ƒ } | | j o |  G| G| G| GHq q Wd  S(   Ni   (   t   rangeR   R   R!   (   R   t   cR   t   e(    (    s,   /usr/lib/python2.6/lib2to3/pgen2/literals.pyt   test2   s     t   __main__(   t   __doc__R   R   R   R!   R%   t   __name__(    (    (    s,   /usr/lib/python2.6/lib2to3/pgen2/literals.pyt   <module>   s    

		
		