
]c           @   s   d  d l  m Z m Z d  d l Z d  d l Z d  d l Td e j f d     YZ d e j f d     YZ d   Z e	 d	 k r e   n  d S(
   i(   t   run_unittestt   check_syntax_errorN(   t   *t
   TokenTestsc           B   s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C   s6   d } |  j  | d d  d } |  j  | d d  d  S(   Ni   i   s   backslash for line continuationi    s   backslash ending commenti   (   t   assertEquals(   t   selft   x(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testBackslash   s
     c         C   s~  |  j  d d  |  j  d d  |  j  d d  |  j t t d  d d l m } | d k r |  j  d d  |  j d	 d
 k  |  j d	 d
 k  x d D]; } y t |  } Wq t k
 r |  j d |  q Xq Wn | d k ri|  j  d d  |  j d d
 k  |  j d d
 k  xW d D]; } y t |  } Wq't k
 ra|  j d |  q'Xq'Wn |  j d |  d  S(   Ni   it   0xi(   t   maxinti  i   i   I    i    t
   2147483648t   040000000000t   0x100000000s(   OverflowError on huge integer literal %rII      I       l    t   9223372036854775808t   02000000000000000000000t   0x10000000000000000s   Weird maxint value %ri   (   R
   R   R   I       (   R   R   R   (	   R   t   assertRaisest   SyntaxErrort   evalt   sysR	   t   assert_t   OverflowErrort   fail(   R   R	   t   sR   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testPlainIntegers   s2    
c         C   s4   d } d } d } d } d } d } d } d } d  S(   Nl    l    l   ? l   
~l!]c (    (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testLongIntegers;   s    c         C   sF   d } d } d } d } d } d } d } d } d } d } d } d  S(   NgQ	@g     s@gjt?g  Bgt =g  WHBg     F@(    (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt
   testFloatsE   s    c         C   s{  d } d } |  j  t |  d k o- | | k  d } d } |  j  t |  d k op | | k op t |  d k  d } d } |  j  t |  d k o | | k o t |  d k  d } d } |  j  t |  d	 k o | | k  d
 } d
 } |  j  t |  d	 k o| | k  d } d } |  j | |  d } |  j | |  d } |  j | |  d } |  j | |  d  S(   Nt    i    s   'i   i'   t   "i"   s   doesn't "shrink" does iti   s   does "shrink" doesn't its2   
The "quick"
brown fox
jumps over
the 'lazy' dog.
(   R   t   lent   ordR   (   R   R   t   y(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testStringLiteralsS   s0      %  7  7%%(   t   __name__t
   __module__R   R   R   R   R    (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR      s
   	
		
	t   GrammarTestsc           B   s^  e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d    Z" d!   Z# d"   Z$ d#   Z% d$   Z& d%   Z' RS(&   c         C   s   t  d  } d  S(   Ns	   1, 0 or 1(   R   (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testEvalInput   s    c         C   s  d   } |   | d=   | d> i    d   } d   } d   } d   } |  j  | j j d?  |  j  | j j d@  t j j d	  r |  j  | j j dA  |  j  | j j dB  n, |  j  | j j dC  |  j  | j j dD  d   } d   } d   } d   }	 d   }
 d   } |   | d  | d  | d d  | d d  | d d dE f  |   | d  | d  | d d  | d d d d d d d d d  d! 
 |	 d  |	 d  |	 d d  |	 d d d  |	 d d d d d d d d d  d! 
 |
 d d  |
 d d d  |
 d d d d  |
 d d d d d d d d d  d! 
 | d dF  | d dG d  | d dH d d d d d d  d! 	 t j j d	  r|  j  | j j dI  n |  j  | j j dJ  |  j  | d dK d  d d d dL f  d d'  } |   | d  | dM   | i d d" 6  d d(  } | d  | d d  | d i d d% 6 d d)  } | d d  | d d d  | dN   | d dO  | d d dP  | d d i d d& 6 d d d*  } |   | d  | d d  | dQ   | d dR  | d i d d% 6 | i d d" 6d d% 6  d d d+  } | d  | d d  | d d d  d d d,  } | d d  | d d d  | d d d d  d d-  } |   | d  | d d  | dS   | dT   | i d d" 6  d d.  } | d  | d d  | d d d  d d/  } | d d  | d d d  | d d d d  | dU   | d d i d d& 6 d d d0  } |   | d  | d d  | d d d  | d dV  | i d d" 6d d% 6  d d d1  } | d  | d d  | d d d  | d d d d  | dW   | d d dX  | d dY i d d& 6 d d d2  } | d d  | d d d  | d d d d  | d d d d d  | dZ   | d d d[  | d d\ i d d3 6 d4   } | d  d5   } | d]  d6   } |  j  | d d7 d d8 d d d g d^ i d d7 6d d8 6f  |  j t t d9  |  j t t d:  t	 |  d;  t	 |  d<  d  S(_   Nc           S   s   d  S(   N(    (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   f1   R   c         S   s   d  S(   N(    (   t   one_argument(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   f2   R   c         S   s   d  S(   N(    (   t   twot	   arguments(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   f3   R   c         S   s   | \ } \ } } d  S(   N(    (   R(   t   .1t   compoundt   argumentt   list(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   f4   s     c         S   s   |  \ } } d  S(   N(    (   t   .0R(   R,   t   first(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   f5   s    	 R&   R(   R)   t   javas   (compound, (argument, list))R,   R-   R.   s   (compound, first)R1   s   .1s   .0c         S   s   d  S(   N(    (   t   one_arg(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   a1   R   c         S   s   d  S(   N(    (   R(   t   args(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   a2   R   c          W   s   d  S(   N(    (   t   rest(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   v0   R   c         W   s   d  S(   N(    (   t   aR8   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   v1   R   c         W   s   d  S(   N(    (   R:   t   bR8   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   v2   R   c         W   s   | \ } } |  | | | f S(   N(    (   R:   R+   R8   R<   t   c(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   v3   s    	 i   i   i   i   i   i   i   i   i	   i    R:   s   (b, c)R8   R<   R>   c         S   s   d  S(   N(    (   R:   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d01   R   c         S   s   d  S(   N(    (   R:   R<   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d11   R   c         S   s   d  S(   N(    (   R:   R<   R>   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d21   R   c         S   s   d  S(   N(    (   R:   R<   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d02   R   c         S   s   d  S(   N(    (   R:   R<   R>   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d12   R   c         S   s   d  S(   N(    (   R:   R<   R>   t   d(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d22   R   c         W   s   d  S(   N(    (   R:   R8   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d01v   R   c         W   s   d  S(   N(    (   R:   R<   R8   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d11v   R   c         W   s   d  S(   N(    (   R:   R<   R>   R8   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d21v   R   c         W   s   d  S(   N(    (   R:   R<   R8   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d02v  R   c         W   s   d  S(   N(    (   R:   R<   R>   R8   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d12v  R   c         W   s   d  S(   N(    (   R:   R<   R>   RE   R8   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d22v  R   RE   c         S   s   d  S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d31v  R   c         S   s   |  \ } d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   d32v  s     c          _   s
   |  | f S(   N(    (   R6   t   kwargs(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   f  s    R   R   s   f(1, *(2,3), 4)s   f(1, x=2, *(3,4), x=5)s
   f(*g(1=2))s   f(**g(1=2))(    (    (   R&   (   R(   R)   (   R(   s   (compound, (argument, list))R,   R-   R.   (   s   (compound, first)R(   R,   R1   (   R(   s   .1R,   R-   R.   (   s   .0R(   R,   R1   (   i   i   (   i   i   (   i   i   (   i   i   (   R:   s   (b, c)R8   R<   R>   (   R:   s   .1R8   R<   R>   (   i   i   (   i   (   i   (   i   i   i   (   i   i   (   i   (   i   i   (   i   (   i   i   i   i   (   i   (   i   i   i   i   (   i   i   i   (   i   i   i   i   (   i   i   i   (   i   (   i   i   i   i   (   i   i   i   (   i   i   (   i   (   i   i   i   (
   R   t	   func_codet   co_varnamesR   t   platformt
   startswithR   R   R   R   (   R   R%   R'   R*   R/   R2   R5   R7   R9   R;   R=   R?   R@   RA   RB   RC   RD   RF   RG   RH   RI   RJ   RK   RL   RM   RN   RP   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testFuncdef   s   
	
				 
						



%

%%"(















	
	
	'c         C   s   d   } |  j  |   d  d   } d   } |  j  |   d d d g  d d  d  d  } |  j  |   d  d	 d
  } |  j  | d d	  d  |  j  | d d	 d  d  t |  d  t |  d  d  S(   Nc           S   s   d S(   Ni    (    (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   <lambda>+  R   i    c           S   s   t  t S(   N(   R:   RE   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   -  R   c          S   s&   g  d d d g D] }  d |  k  ^ q S(   Nii   l    i   (    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   .  R   i   c         S   s   |  S(   N(    (   t   z(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   0  R   c         S   s   |    S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   0  R   c         S   s   |    S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   0  R   i   c         S   s   |  | | S(   N(    (   R   R   RW   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   2  R   i   i   i   s   lambda x: x = 2s   lambda (None,): None(   R   R   (   R   t   l1t   l2t   l3t   l4t   l5(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testLambdef)  s    			c         C   s   d } ~ d   } |   d  S(   Ni   c          S   s   d }  ~  d  S(   Ni   (    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   foo>  s     (    (   R   R   R^   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testSimpleStmt;  s     	c   	      C   sx   d d } d } d	 } } } d
 \ } } } d d d f } \ } } } \ } } } } t  |  d  t  |  d  d  S(   Ni   i   i   i   s	   x + 1 = 1s   a + 1 = b + 2(   i   i   i   (   i   i   i   (   i   i   i   (   i   i   i   (   i   i   (   R   (	   R   R   R   RW   t   abcR:   R<   R>   t   xyz(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testExprStmtF  s    -c            s  d d  l  } t j } | j    t _ d Gd Gd GHd Gd Gd GHd pG d Gd pQ d Gd p[ d GHt j d Id Id IJt j d Id Id It j Jt j d p d Id p d It j d p d IJd d d     Y      } | d Id Id IJ| d Id Id I| J| d p!d Id p-d I| d p=d IJ   f d   } t j d	   |   d  d
   |   |  j t j j   d  | t _ t |  d  t |  d  d  S(   Nii   i   i   i    t   Gulpc           B   s   e  Z d    Z RS(   c         S   s   d  S(   N(    (   R   t   msg(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   writek  R   (   R!   R"   Re   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRc   j  s   c             s>   t  j }      t  _ z          Wd  |  t  _ Xd  S(   N(   R   t   stdout(   t	   oldstdout(   Rc   t   tellme(    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   driveru  s    	c         S   s   |  d IJd  S(   Ns   hello world(    (   t   file(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRh     s    c         S   s   |  d IJd  S(   Ns   goodbye universe(    (   Rj   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRh     s    s0   1 2 3
1 2 3
1 1 1
1 2 3
1 2 3
1 1 1
hello world
s   print ,s   print >> x,(    (   t   StringIOR   Rf   t   Nonet   assertEqualt   getvalueR   (   R   Rk   t   save_stdoutt   gulpRi   (    (   Rc   Rh   s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testPrintStmtS  s<    		
	c         C   s@   d d d g } | \ } } } | | | f } ~ ~ ~ ~ ~ d  S(   Ni   i   i   (    (   R   R`   R   R   RW   Ra   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testDelStmt  s
    c         C   s   d  S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testPassStmt  s    c         C   s   x Pq Wd  S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testBreakStmt  s     c         C   s   d } x | r d } q	 q	 Wd } x- | sQ d } y w% d } Wq% d } q% Xq% W| d k rn |  j  |  n  d } x! | s d } z ww Wd  d } Xqw W| d k r |  j  |  n  d  S(   Ni   i    R   t   oks&   continue failed to continue inside trys'   continue inside try called except blocks   finally block not called(   R   (   R   t   iRd   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testContinueStmt  s,    	  	
	c            s    d d   f d  } |   d  S(   Ni   i    c            s   d } xR | rZ | d 7} y1 |  r< | d k r< |  d 8}  Pn  | d 8} w	 Wq	   q	 Xq	 W| d k ss | d k r   j  d  n  d  S(   Ni   i   s1   continue then break in try/except in loop broken!(   R   (   t   extra_burning_oilt   countt	   big_hippo(   R   (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt
   test_inner  s    	


(    (   R   R{   (    (   R   s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   test_break_continue_loop  s    
c         C   s3   d   } d   } |   |   } t  |  d  d  S(   Nc           S   s   d  S(   N(    (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   g1  R   c           S   s   d S(   Ni   (    (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   g2  R   s   class foo:return 1(   R   (   R   R}   R~   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt
   testReturn  s
    			c         C   s   t  |  d  d  S(   Ns   class foo:yield 1(   R   (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt	   testYield  s    c         C   sC   y t  d  Wn t  k
 r  n Xy
 t  Wn t k
 r> n Xd  S(   Ns   just testing(   t   RuntimeErrort   KeyboardInterrupt(   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt	   testRaise  s       
 c         C   s   d d  l  } d d  l } d d  l  } d d l m } d d l m } d d l  m } m } d d l  m } m } d d l  m } m } d  S(   Ni(   t   time(   t   patht   argv(   R   R   R   R   (   R   R   R   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt
   testImport  s    c         C   s   d  S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt
   testGlobal   s    c         B   s{  d  } ~ d d  U| d k r- |  j d  n  ~ d d  U| d k rT |  j d  n  d  } ~ d d  l } e | d  r d d  Un  i  } d	 | U| j d
  r | d
 =n  | i d d 6k r |  j d  n  i  } i  } d d  l } | j d d d d d | | U| j d
  r| d
 =n  | j d
  r7| d
 =n  | | f i d d 6i d d 6f k rw|  j d | | f  n  d  S(   Ns   z=1+1
i   s   exec 'z=1+1'\ns   z=1+1s   exec 'z=1+1'it   UnicodeTypes   if 1:
            exec u'z=1+1\n'
            if z != 2: self.fail('exec u\'z=1+1\'\\n')
            del z
            exec u'z=1+1'
            if z != 2: self.fail('exec u\'z=1+1\'')s   z = 1t   __builtins__i   RW   s   exec 'z = 1' in gt   ignores   global statementt   modules   <string>s   global a; a = 1; b = 2R:   R<   s   exec ... in g (%s), l (%s)(   Rl   R   t   typest   hasattrt   has_keyt   warningst   filterwarnings(   R   RW   R   t   gt   lR   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testExec  s>       
 
 
 
&c         C   s   d s t   d s t  d   d   s- t   d sB t  d     y d sW t  d   Wn* t  k
 r } |  j | j d d  n X|  j d  d  S(   Ni   c         S   s   |  S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   ,  R   c         S   s   |  d S(   Ni   (    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   -  R   i    Rd   s%   AssertionError not raised by assert 0(   t   AssertionErrorR   R6   R   (   R   t   e(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt
   testAssert(  s    c         C   s   d  S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testIf9  s    c         C   s    d } d } |  j  | d  d  S(   Ni    i   (   R   (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt	   testWhileF  s    c         C   s   x d
 D] } q Wx d D] \ } } } q Wd d d     Y} d } x | d  D] } | | } qQ W| d k r |  j  d	  n  g  } x' d d d g D] \ } | j |  q W|  j | d d d g  d  S(   Ni   i   i   t   Squaresc           B   s#   e  Z d    Z d   Z d   Z RS(   c         S   s   | |  _  g  |  _ d  S(   N(   t   maxt   sofar(   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   __init__[  s    	c         S   s   t  |  j  S(   N(   R   R   (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   __len__^  R   c         S   ss   d | k o |  j  k  n s( t  n  t |  j  } x. | | k rg |  j j | |  | d } q: W|  j | S(   Ni    i   (   R   t
   IndexErrorR   R   t   append(   R   Rv   t   n(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   __getitem___  s     	(   R!   R"   R   R   R   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR   Z  s   		i    i
   i  s   for over growing sequence(   i   i   i   (    (    (   i   (   i   (   i   (   R   R   Rm   (   R   Rv   t   jt   kR   R   R   t   result(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testForU  s       c         C   s   y d d Wn t  k
 r n Xy d d Wn; t k
 r? n+ t k
 rQ } n t k
 rc } n n Xy d d Wn t t t  f k
 r n Xy d d Wn t t t  f k
 r } n Xz Wd  Xd  S(   Ni   i    (   t   ZeroDivisionErrort   EOFErrort	   TypeErrorR   (   R   Rd   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testTryp  s2              c         C   s   d  S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt	   testSuite  s    c         C   sz   d s	 n  d r d r n  d s' d r' n  d s2 n  d rH d rH d rH n  d rT d sv d rf d rf d sv d rv d rv n  d  S(   Ni   (    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testTest  s         + c         C   s7  d d k } d d k r n  d d k r* n  d d k r9 n  d d k  rH n  d d k rW n  d d k rf n  d d k ru n  d d k r n  d d k	 r n  d d k r n  d d k r n  d d k  o+d k o+d k o+d k o+d k o+d k o+d k o+d k o+d k o+d k o+d k	 n r3n  d  S(   Ni   (    (    (    (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testComparison  s2                c         C   s   d } d } d } d  S(   Ni   i   i    i   (    (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testBinaryMaskOps  s    c         C   s   d } d } d } d  S(   Ni   i   i    i   i   (    (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testShiftOps  s    c         C   s   d } d } d } d } d  S(	   Ni   i   i    ii    i   i    i   (    (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testAdditiveOps  s    c         C   s,   d } d d } d } d d d d } d  S(   Ni   i   i    (    (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testMultiplicativeOps  s    
c         C   s7   d 
} d } d } d d Ad B} d d d	 d } d  S(   Ni   iiii   i   iii   i   ii(    (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testUnaryOps  s
    c   	      C   s  d d  l  } d d  l } | j d } | j   } | j d j   } d } | d } | d } | d d !} | d  } | d } | } | d } | d  } | d d !} i  } d	 | d	 <d
 | d <d | d <d | d <t |  } | j   |  j t |  d  d  S(   Nii    R   t   01234i   iiii   i   i   i   s   [1, (1,), (1, 2), (1, 2, 3)](   i   (   i   i   (   i   i   i   (   R   R   R   t   modulesR.   t   sortR   t   str(	   R   R   R   R>   R   R:   R   RE   t   L(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testSelectors  s,    










c         C   sI  d } d p d p d } d p' d p' d d d f } g  } d g } d pQ d pQ d g } d pf d pf d d d g } g  } i  } i d d 6} i d d 6} i d p d d p d 6} i d d 6d d 6} i d d 6d d 6} i d d 6d d 6d d 6d d 6d	 d
 6d d 6} | } d pd pd } |  j  d d  | } d } d } d  S(   Ni   i   i   t   oneR(   t   threei   t   fouri   t   fivei   t   sixs   (1, 2)R   i{   (   i   i   s   (1, 2)(   Rm   (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt	   testAtoms  s*    	0c   	      C   s   d d d     Y} d d d     Y} d | f d     Y} d | f d     Y} d	 | | | f d
     Y} d d d     Y} d   } | d d d     Y } |  j  | j t  d  S(   Nt   Bc           B   s   e  Z RS(    (   R!   R"   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR     s    t   B2c           B   s   e  Z RS(    (   R!   R"   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR     s    t   C1c           B   s   e  Z RS(    (   R!   R"   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR     s    t   C2c           B   s   e  Z RS(    (   R!   R"   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR     s    t   Dc           B   s   e  Z RS(    (   R!   R"   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR     s    t   Cc           B   s#   e  Z d    Z d   Z d   Z RS(   c         S   s   d  S(   N(    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   meth1  R   c         S   s   d  S(   N(    (   R   t   arg(    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   meth2  R   c         S   s   d  S(   N(    (   R   R5   R7   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   meth3  R   (   R!   R"   R   R   R   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR     s   		c         S   s   t  |  _ |  S(   N(   t   Truet	   decorated(   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   class_decorator  s    	t   Gc           B   s   e  Z RS(    (   R!   R"   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR   !  s   (    (    (    (    (   Rm   R   R   (	   R   R   R   R   R   R   R   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testClassdef  s    	c            s"  d d d d d g } d d d g } d	 d
 d g }   j  g  | D] } | j   ^ q@ d d d g    j  g  | D] } d | ^ qr d d d d d g    j  g  | D] } | d k r | ^ q d d d g    j  g  | D] } | D] } | | f ^ q q d$ d% d& d' d( d) d* d+ d, d- d. d/ d0 d1 d2 g    j  g  | D]> } g  | D] } d | k rP| ^ qPD] } | | f ^ qlqCd3 d4 d5 d6 d7 d8 d9 d: d; d< g
    j  g  t d  D] } d   |  ^ qd g d d g d d d g d d d d g d d d d d g g  d   }	   j  |	 |  t t t g    f d   }
 |
   t   d  t   d  d= d> d? g } d@ dA dB g } dC dD dE dF g } g  | D]V \ } } | D]C \ } } | D]0 \ } } | | k r| | k r| | f ^ qqq}   j  | dG dH dI dJ g  d  S(K   Ni   i   i   i   i   t   Applet   Bananat   Coconuts     Apples    Banana s   Coco  nut  s	   Coco  nuti   i	   i   i   R   c         S   s%   g  t  |  d  D] } |  | ^ q S(   Ni   (   t   range(   R:   Rv   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV   9  R   i   i   i@   i   c         S   s9   g  |  D]. } | d k r d  | k  o0 d k  n ^ q S(   Ni   i   (   Rl   (   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   test_in_func<  s    c             sh     j  g  d d d g D]) }  g  |  |  d g D] } | ^ q- ^ q d d g d d g d d g g  d  S(   Ni   i   i   i   i   i   (   Rm   (   R   R   (   R   (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   test_nested_frontA  s    Bs"   [i, s for i in nums for s in strs]s   [x if y]t   Boeingt   Fordt
   Macdonaldsi
   t   Airlineri   t   Enginei   t   Cheeseburger(   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i   R   (   i
   R   (   i   R   (   i   R   (   i   i
   (   i   i   (   i   i   (   i   i   (   R   R   (   R   R   (   R   R   (   R   R   (   Rm   t   stripR   t   FalseR   (   R   t   numst   strst   spcsR   R   Rv   RP   R   R   R   t	   supplierst   partst   suppartt   snot   snamet   pnot   pnamet   sp_snot   sp_pno(    (   R   s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testListcomps&  sL    268/				N+C			0c            s  d   t  d  D } |  j | j   g  t  d  D] } | ^ q2  y | j   |  j d  Wn t k
 rs n Xd   y1   f d     D } | j   |  j d  Wn t k
 r n X|  j t d   d D  g  d D] } d D] } | | f ^ q q  |  j t d	   d
 D  g  d
 D] } d D] } | | f ^ q/q% g  t  d  D] } | ^ qX  d   d     D D } |  j t |  t g  t  d  D] } | ^ q  |  j t d   t  d  D  t g  t  d  D] } | d ^ q  |  j t d   t  d  D  t g  t  d  D] } | d r1| | ^ q1  |  j t d   d   t  d  D D  t g  t  d  D] } | ^ q  |  j t d   d   d   t  d  D D D  t g  t  d  D] } | ^ q  |  j t d   g  d   t  d  D D] } | ^ q#D  t g  t  d  D] } | ^ qI  |  j t d   d   d   t  d  D D D  t g  t  d  D] } | ^ q  |  j t d   d   d   t  d  D D D  d  t |  d  t |  d   d  S(!   Nc         s   s.   |  ]$ } g  t  d   D] } | ^ q Vq d S(   i
   N(   R   (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>g  s    i   i
   s&   should produce StopIteration exceptionc         3   s   |  ] }   Vq d  S(   N(    (   R0   RE   (   R:   (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>q  s    s   should produce TypeErrorc         s   s(   |  ] } d  D] } | | f Vq q d S(   t   abcdN(    (   R0   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>w  s    R   c         s   s(   |  ] } d  D] } | | f Vq q d S(   t   xyN(    (   R0   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>x  s    t   abR   c         s   s   |  ] } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>{  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>{  s    c         s   s   |  ] } | d  Vq d S(   i   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>~  s    i   c         s   s#   |  ] } | d  r | | Vq d S(   i   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   RW   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   RW   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } t  r | Vq d  S(   N(   R   (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } t  r | Vq d  S(   N(   R   (   R0   RW   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } t  r | Vq d  S(   N(   R   (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } t  r | Vq d  S(   N(   R   (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    c         s   s   |  ] } t  r | Vq d  S(   N(   R   (   R0   RW   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    i    s   foo(x for x in range(10), 100)s   foo(100, x for x in range(10))(	   R   Rm   t   nextR   t   StopIterationR   R.   t   sumR   (   R   R   R   R   R<   (    (   R:   s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testGenexpse  s8    /

FF5ISOYbY:c            s  d  d   t    D } d  |  j t t |   d  d  t      f d   t    D } d  t   |  j g  t  d  D]% } t  d  D] } | | f ^ q q t |   |  j g  t  d  D]    d r  d r  ^ q d d d g  |  j t d	   t  d  D  d d d g  |  j g  d d d g D] \   ^ qHd
 d d g  |  j t d   d d d g D  d d d g  d  S(   Ni
   c         s   s   |  ] } | Vq d  S(   N(    (   R0   Rv   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    i   c         3   s4   |  ]* }   r t    D] } | | f Vq q d  S(   N(   R   (   R0   Rv   R   (   t   tR   (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    i   i   i   i   c         s   s)   |  ] } | d  r | d r | Vq d S(   i   i   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    i   i   c         s   s   |  ] \ } | Vq d  S(   N(    (   R0   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pys	   <genexpr>  s    i   i	   (   i   (   i   (   i   (   i   (   i   (   i	   (   R   Rm   R   R.   R   R   (   R   R   Rv   R   (    (   R   R   s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testComprehensionSpecials  s         HF/8c         C   s   d t  f d     Y} |    Wd  QX|    } Wd  QX|    \ } } Wd  QX|    |    Wd  QXWd  QX|    } |    } Wd  QXWd  QX|    } |    Wd  QXWd  QXd  S(   Nt   managerc           B   s   e  Z d    Z d   Z RS(   c         S   s   d S(   Ni   i   (   i   i   (    (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt	   __enter__  s    c         W   s   d  S(   N(    (   R   R6   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   __exit__  s    (   R!   R"   R   R   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR     s   	(   t   object(   R   R   R   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   test_with_statement  s     

 
  
c            s    f d   } |  j  g  d   d   f D]       r(     ^ q( t g  |  j  g  d   d   f D]       rf     ^ qf t g  |  j  g  d   d   f D]     t  r   t  ^ q t g  |  j  d	 n | d
 d  d	  |  j  d r	| d d  n d	 d	  |  j  d r+d	 o.d n d d  |  j  d rMd	 oPd n d d  |  j  d	 old n d d  |  j  d rd p| d d  n d d  |  j  d p| d d  n | d d  d  |  j  d pd	 n | d d  d	  |  j  d	 n d t  |  j  d rd	 n d d  |  j  d n d d  |  j  d n d d	  |  j  d n d d  |  j  d d n d d  |  j  d rd d k  n d d  d  S(   Nc            s	     GH| S(   s@   helper to check that evaluation of expressions is done correctly(    (   Rd   t   ret(   R   (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt
   _checkeval  s    c           S   s   t  S(   N(   R   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV     R   c           S   s   t  S(   N(   R   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV     R   c           S   s   t  S(   N(   R   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV     R   c           S   s   t  S(   N(   R   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV     R   c         S   s   |  r
 t  St S(   N(   R   R   (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV     R   c         S   s   |  r
 t  St S(   N(   R   R   (   R   (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyRV     R   i   i   s   check 1i    s   check 2i   s   check 3i   i   s   check 4s   check 5s   check 6i   i   i   i   i   i   (   Rm   R   R   (   R   R   (    (   R   s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   testIfElseExpr  s&    >>D%""+.%((   R!   R"   R$   RU   R]   R_   Rb   Rq   Rr   Rs   Rt   Rw   R|   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyR#   |   sL   						F												"															"		?	#		c           C   s   t  t t  d  S(   N(   R    R   R#   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt	   test_main  s    t   __main__(
   t   test.test_supportR    R   t   unittestR   t   TestCaseR   R#   R   R!   (    (    (    s4   lib/python2.7/lib2to3/tests/data/py2_test_grammar.pyt   <module>   s   
k   Q	