+
    Bi;                    6  a  R t0 t ^ RIHtHt ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RI5 ^ RIHu Ht ^ RIt^ RIHt ^ RIt^ RIHtHt  ! R R]P*                  4      t] ^ k  ! R	 R
]P*                  4      t]R8X  d   ]P2                  ! 4        R# R# )    )check_syntax_errorskip_wasi_stack_overflow)import_helperN)*)ann_module2)VALID_UNDERSCORE_LITERALSINVALID_UNDERSCORE_LITERALSc                      a  ] tR t^t o ^ RIHt ^ RIHt R tR t	R t
R tR tR tR	 tR
 tR tR tR tR tR t]! 4       R 4       tRtV tR# )
TokenTestsr   check_syntax_warningc                Z    ^pV P                  V^R4       ^ pV P                  V^ R4       R# )   zbackslash for line continuationzbackslash ending commentNassertEqualselfxs   & (/usr/lib/python3.14/test/test_grammar.pytest_backslashTokenTests.test_backslash   s6    A@A A9:    c                   V P                  \        ^ 4      \        ^ 4      4       V P                  ^^4       V P                  ^^4       V P                  RR4       V P                  ^	^	4       V P                  \        \        R4       ^ RIHp VR8X  df   V P                  RR4       V P                  R^ 8  4       V P                  R^ 8  4       V P                  R^ 8  4       R F  p \	        V4      pK  	  R
# VR8X  df   V P                  RR4       V P                  R^ 8  4       V P                  R^ 8  4       V P                  R^ 8  4       R F  p \	        V4      pK  	  R
# V P                  R	V,          4       R
#   \         d    T P                  RT,          4        K  i ; i  \         d    T P                  RT,          4        K  i ; i)r   i0x)maxsizel    z(OverflowError on huge integer literal %rl        l    zWeird maxsize value %rNi   )
21474836480o400000000000x100000000"0b10000000000000000000000000000000l         )92233720368547758080o20000000000000000000000x10000000000000000A0b100000000000000000000000000000000000000000000000000000000000000)
r   typeassertRaisesSyntaxErrorevalsysr   
assertTrueOverflowErrorfail)r   r   sr   s   &   r   test_plain_integersTokenTests.test_plain_integers)   s   cDG,s#$]3#+tT2j ]N;OOMA-.OOJN+OO=AB<NQA< ++35NOOO4q89OO.23OO\_``aYNQA	Y II.89 % NIIH1LMN % NIIH1LMNs$   )F F* #F'&F'*#GGc                &    ^ pRpRpRpRpRpRpRpR# )r   r   l   ? l   
~l!]c l            l   N r   s   & r   test_long_integersTokenTests.test_long_integersM   s*    *SSr   c                6    R pRpRpRpRpRpRpRpRpRpRpRpR# )gQ	@g     s@gjt?g  Bgt =g  WHBg     F@Nr2   r   s   & r   test_floatsTokenTests.test_floatsW   s>    r   c                P   \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       V P	                  \        R4      ^4       V P	                  \        R4      ^ 4       RRR4       V P                  \        \
        R4       R#   + '       g   i     L-; i)ignorez1 if 1else 0z1 if 0else 0Nz0 if 1Else 0)warningscatch_warningssimplefilterSyntaxWarningr   r)   r'   r(   r   s   &r    test_float_exponent_tokenization+TokenTests.test_float_exponent_tokenizatione   sm    $$&&!!(M:T.115T.115 ' 	+t^<	 '&s   ABB%	c           
        \          F7  pV P                  \        V4      \        VP                  R R4      4      4       K9  	  \         F  pV P                  \        \        V4       K   	  V P                  \        \        R4       R# )_ _0N)r   r   r)   replacer	   r'   r(   	NameError)r   lits   & r   test_underscore_literals#TokenTests.test_underscore_literalsm   s`    ,CT#YS[[b-A(BC -.Ck45 / 	)T40r   c                P   V P                   pV! R R4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! R	R4       V! R
R4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! RR4       R# )0b12z#invalid digit '2' in binary literal0b1_20b20b1_zinvalid binary literal0b0o18z"invalid digit '8' in octal literal0o1_80o80o1_zinvalid octal literal0o0x1_zinvalid hexadecimal literalr   1_zinvalid decimal literal012z`leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integersz1.2_1e2_z1e+Nr   r   checks   & r   test_bad_numerical_literals&TokenTests.test_bad_numerical_literalsu   s    ''f;<g<=e:;f./d,-f:;g;<e9:f-.d+,f34d12d-.e4	5 	f/0f/0e./r   c           
       a  RV 3R llpR EFb  p\        VRR4       V! V R2VR8H  R7       V! V R2VR8H  R7       V! V R	24       V! V R
24       V! V R24       V! RV R2VR8H  R7       V! RV R24       V! V R2RR7       S P                  \        R4      ;_uu_ 4        \        V R2RR4       RRR4       S P                  \        R4      ;_uu_ 4        \        V R2RR4       RRR4       \
        P                  ! 4       ;_uu_ 4        \
        P                  ! R\        4       S P                  \        R4      ;_uu_ 4        \        V R2RR4       RRR4       RRR4       EKe  	  V! R4       V! R4       V! R4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L]; i  + '       g   i     EK  ; i)Fc                   < SP                  V R 7      ;_uu_ 4        V'       dp   \        P                  ! RR7      ;_uu_ 4       pSP                  \        R4      ;_uu_ 4        \        V RR4       RRR4       RRR4       SP                  X. 4       MSP                  V RR7       RRR4       R#   + '       g   i     LH; i  + '       g   i     LS; i  + '       g   i     R# ; i))exprT)recordinvalid \w+ literal
<testcase>r)   N)errtext)subTestr:   r;   assertRaisesRegexr(   compiler   r   )testerrorwr   s   && r   rZ   8TokenTests.test_end_of_numerical_literals.<locals>.check   s    4((!00==!33K$:< <#D,?< > $$Q,--d$: . < )(< < >= )((s;   (CC	#B11C	9.C1C<C	CCC(	0xf0rb   r)   zand x)rh   zor xzin xznot in xzif x else yzx if zelse y[zfor x in ()]spamTu#   invalid character '⁄' \(U\+2044\)u   ⁄7Nra   zis xrh   z[0x1ffor x in ()]z[0x1for x in ()]z[0xfor x in ()]F)rk   0o70b19rl   z1.1e31j)rf   re   r(   assertWarnsRegexr=   r:   r;   r<   )r   rZ   nums   f  r   test_end_of_numerical_literals)TokenTests.test_end_of_numerical_literals   s   
	< DCCv.SE-u6SE,scz3SE,SE"#SE%&E#f%cUl<AcU,'(SE,d+ ''5[\\3%tlF; ] &&}6LMM3%tlF; N((**%%g}=++K24 4se4L,?4 +*# D. 	!" !  ]\ NM4 4 +**s<   &FF :GF3GF F03G>GGc                   R pR q P                  \        V4      ^ 8H  ;'       d    W8H  4       RpRq P                  \        V4      ^8H  ;'       d    W8H  ;'       d    \        V4      ^'8H  4       RpRq P                  \        V4      ^8H  ;'       d    W8H  ;'       d    \        V4      ^"8H  4       RpRpT P                  \        V4      ^8H  ;'       d    W8H  4       RpRpT P                  \        V4      ^8H  ;'       d    W8H  4       RpRpV P                  W4       RpV P                  W4       RpV P                  W4       RpV P                  W4       R# )rC   '"zdoesn't "shrink" does itzdoes "shrink" doesn't itz2
The "quick"
brown fox
jumps over
the 'lazy' dog.
N)r+   lenordr   r   r   ys   &  r   test_string_literalsTokenTests.test_string_literals   sB   BA!(>(>?c!??3q6Q;+R+R16+R+Rc!fPRlST??3q6Q;+R+R16+R+Rc!fPRlS('A"//0('A"//0 H 	 	 	r   c                T   a  V 3R  lpV! R4       V! R4       V! R4       V! R4       R# )c                    < \        V 4      pSP                  \        V4      \        4       SP	                  \        V4      ^ 4       R# r   N)r)   assertIsr&   strassertGreaterr|   r.   parsedr   s   & r   rZ   .TokenTests.test_string_prefixes.<locals>.check   s2    !WFMM$v,,s6{A.r   zu'abc'zr'abc	'zrf'abc {1 + 1}'zfr'abc {1 + 1}'Nr2   rY   s   f r   test_string_prefixesTokenTests.test_string_prefixes   s+    	/
 	hj!"!"r   c                D   a  V 3R  lpV! R4       V! R4       V! R4       R# )c                    < \        V 4      pSP                  \        V4      \        4       SP	                  \        V4      ^ 4       R# r   )r)   r   r&   bytesr   r|   r   s   & r   rZ   -TokenTests.test_bytes_prefixes.<locals>.check   s2    !WFMM$v,.s6{A.r   zb'abc'zbr'abc	'zrb'abc'Nr2   rY   s   f r   test_bytes_prefixesTokenTests.test_bytes_prefixes   s!    	/
 	hkkr   c                n    R pV P                  V\        J 4       V P                  \        \        R4       R# ).z.. .N)r+   Ellipsisr'   r(   r)   r   s   & r   test_ellipsisTokenTests.test_ellipsis   s)    X&+tV4r   c                    RpV F[  pV P                  \        4      ;_uu_ 4       p\        VRR4       RRR4       V P                  R\	        XP
                  4      4       K]  	  R#   + '       g   i     L;; i)def foo(z<test>execNzwas never closed)r   z	
def foo(z	def foo(
)r'   r(   rf   assertInr   	exception)r   samplesr.   cms   &   r   test_eof_errorTokenTests.test_eof_error   sT    :A"";//28V, 0MM,c",,.?@ //s   A&&A6c                   ^p\        RV,          RV,          ,           4      pV P                  VR4       V P                  \        4      ;_uu_ 4       p\        RV^,           ,          RV^,           ,          ,           4       RRR4       V P	                  \        XP                  4      R4       R#   + '       g   i     L7; i)   ()Nztoo many nested parenthesesr2   )r)   r   r'   r(   assertStartsWithr   r   )r   MAXLEVELresultr   s   &   r   test_max_levelTokenTests.test_max_level   s     cHnsX~56${++r1%x!|(<<= ,c",,/1NO ,+s   /B00C 	r2   N)__name__
__module____qualname____firstlineno__test.supportr   test.support.warnings_helperr   r   r/   r3   r6   r?   rH   r[   rw   r   r   r   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      sj     /A;":HT=10,&!P&P	#5
A 	P  	Pr   r   c                     a  ] tR tRt o ^ RIHt ^ RIHt ^ RIHt R t	R t
R tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R  t$]%PL                  ! R!R"4      R# 4       t'R$ t(R% t)R& t*R' t+R( t,R) t-R* t.R+ t/R, t0R- t1R. t2R/ t3R0 t4R1 t5R2 t6R3 t7R4 t8R5 t9R6 t:R7 t;R8 t<R9 t=R: t>R; t?R< t@R= tAR> tBR? tCR@ tDRA tERB tFRC tGRDtHV tIRE# )FGrammarTestsi  r   r   )check_no_warningsc                    \        R 4      pR# )z	1, 0 or 1N)r)   r   s   & r   test_eval_inputGrammarTests.test_eval_input  s    r   c                v    ^p^*.pR p\          \        . ^W#! 4       ^,
          &   V P                  V^.4       R# )   c                      ^# r   r2   r2   r   r   one/GrammarTests.test_var_annot_basics.<locals>.one#  s    r   N)intlistr   )r   var1my_lstr   s   &   r   test_var_annot_basics"GrammarTests.test_var_annot_basics  s<    		 suQw!%r   c                n   \        V R 4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R	4       \        V R
4       \        V R4       \        V R4       \        V R4       \        V R4       R# )z
def f: intzx: int: strzdef f():
    nonlocal x: int
zdef f():
    global x: int
zx: int = y = 1zz = w: int = 1zx: int = y: int = 1z[x, 0]: int
z	f(): int
z	(x,): intz"def f():
    (x, y): int = (1, 2)
z!def f():
    x: int
    global x
z!def f():
    global x
    x: int
z#def f():
    x: int
    nonlocal x
z#def f():
    nonlocal x
    x: int
Nr   r>   s   &r   test_var_annot_syntax_errors)GrammarTests.test_var_annot_syntax_errors*  s    4.4/4 "9 	:4 "7 	84!124!124!67414.4-4 "> 	? 	4 "2 	3 	4 "0 	1 	4 "4 	5 	4 "0 	1r   c                    V P                  \        4      ;_uu_ 4        ^^ ,          \        \        &   RRR4       V P                  \        4      ;_uu_ 4        ^ \        \        &   RRR4       R pV P                  VP                  / 4       R pV! 4        R pV P                  \        4      ;_uu_ 4        V! 4        RRR4       R p V! 4         ! R R4      pV P                  VP                  R\        R	\        /4       V P                  \        4      ;_uu_ 4         ! R
 R4      pRRR4       V P                  \        4      ;_uu_ 4         ! R RV4      pRRR4       R#   + '       g   i     EL=; i  + '       g   i     EL; i  + '       g   i     L; i  \         d*   pT P                  \        T4      \        4        Rp?LRp?ii ; i  + '       g   i     L; i  + '       g   i     R# ; i)r   Nc                       R p R\         n        V # )Hellor      ab)sts    r   f6GrammarTests.test_var_annot_basic_semantics.<locals>.fR  s    BACIr   c                      R # Nr2   r2   r   r   f_OK9GrammarTests.test_var_annot_basic_semantics.<locals>.f_OKW      r   c                      \        X 4       R # r   printr   s    r   fbad9GrammarTests.test_var_annot_basic_semantics.<locals>.fbadZ  s	    !Hr   c                  $    \        \        4       R # r   )r   no_such_globalr2   r   r   f2bad:GrammarTests.test_var_annot_basic_semantics.<locals>.f2bad_  s
    .!r   c                   :   a  ] tR tRt o Rt^tR tV 3R ltRtV t	R# )6GrammarTests.test_var_annot_basic_semantics.<locals>.Cih  attrc                    Wn         R # r   r   r   s   &&r   __init__?GrammarTests.test_var_annot_basic_semantics.<locals>.C.__init__l  s    r   c                2   < V ^8  d   Qh/ S[ ;R&   S[;R&   # )r   _C__foor.   )r   r   )formatr   s   "r   __annotate__CGrammarTests.test_var_annot_basic_semantics.<locals>.C.__annotate__h  s     J O r   r   N)
r   r   r   r   r.   zr   __annotate_func__r   r   r   s   @r   Cr   h  s     AA 	  r   r   r   r.   c                   .   a  ] tR tRt o ^ ]n        RtV tR# )9GrammarTests.test_var_annot_basic_semantics.<locals>.CBadip  r2   N)r   r   r   r   no_such_name_definedr   r   r   r   s   @r   CBadr   p  s     12$))r   r   c                   :   a  ] tR tRt o . ]n        V 3R ltRtV tR# ):GrammarTests.test_var_annot_basic_semantics.<locals>.Cbad2is  c                &   < V ^8  d   Qh/ S[ ;R&   # r   r   r   )r   r   s   "r   r   GGrammarTests.test_var_annot_basic_semantics.<locals>.Cbad2.__annotate__s  s      r   r2   N)	r   r   r   r   r   r   r   r   r   r   s   @r   Cbad2r   s  s       r   r   )r'   ZeroDivisionErrorno_namedoes_not_existrF   r   __annotations__UnboundLocalError	Exceptionr   r&   r   r   )	r   r   r   r   r   er   r   r   s	   &        r   test_var_annot_basic_semantics+GrammarTests.test_var_annot_basic_semanticsI  sm   01156qSGN# 2y))+,GN# *
	 	**B/		 011F 2	"	.G
	  	  	**YS#,FGy))3 3 * y))  *)O 211)))  21  	.MM$q'9--	. *) *))sS   E'E;7FF" !GG,'E8	;F	F	"G-GGG)	,G=	c                    ! R  R4      p ! R RV4      p ! R RV4      p ! R R4      p ! R R	W4      p ! R
 RW14      pV P                  VP                  R\        /4       V P                  VP                  / 4       V P                  VP                  R\        /4       V P                  VP                  R\        /4       V P                  VP                  / 4       V P                  VP                  / 4       R# )c                   ,   a  ] tR tRt o V 3R ltRtV tR# )4GrammarTests.test_annotations_inheritance.<locals>.Aiy  c                &   < V ^8  d   Qh/ S[ ;R&   # r   r   r   )r   r   s   "r   r   AGrammarTests.test_annotations_inheritance.<locals>.A.__annotate__y       I r   r2   Nr   r   r   r   r   r   r   r   s   @r   Ar  y        r   r  c                       ] tR tRtRtR# )4GrammarTests.test_annotations_inheritance.<locals>.Bi{  r2   Nr   r   r   r   r   r2   r   r   Br  {      r   r  c                   ,   a  ] tR tRt o V 3R ltRtV tR# )4GrammarTests.test_annotations_inheritance.<locals>.Ci}  c                &   < V ^8  d   Qh/ S[ ;R&   # r  r   )r   r   s   "r   r   AGrammarTests.test_annotations_inheritance.<locals>.C.__annotate__}  r
  r   r2   Nr  r   s   @r   r   r  }  r  r   r   c                   ,   a  ] tR tRt o V 3R ltRtV tR# )4GrammarTests.test_annotations_inheritance.<locals>.Di  c                &   < V ^8  d   Qh/ S[ ;R&   # )r   attr2r   )r   r   s   "r   r   AGrammarTests.test_annotations_inheritance.<locals>.D.__annotate__  s     J r   r2   Nr  r   s   @r   Dr    r  r   r  c                       ] tR tRtRtR# )4GrammarTests.test_annotations_inheritance.<locals>.Ei  r2   Nr  r2   r   r   Er    r  r   r   c                       ] tR tRtRtR# )4GrammarTests.test_annotations_inheritance.<locals>.Fi  r2   Nr  r2   r   r   Fr"    r  r   r#  r   r  N)r   r   r   r   )r   r  r  r   r  r   r#  s   &      r   test_annotations_inheritance)GrammarTests.test_annotations_inheritancew  s    	 		 		 		 		 		 	**VSM:**B/**VcN;**WsO<**B/**B/r   c                   V P                  \        P                  / 4       V P                  \        P                  R \        R\
        R\        P                  \        \        3,          R\        \        ,          /4       V P                  \        P                  P                  R\        /4       V P                  \        P                  / 4       R# )r   r   r   uoN)r   rg   r   
ann_moduler   r   typingTuplefloatMr&   r   r>   s   &r   test_var_annot_module_semantics,GrammarTests.test_var_annot_module_semantics  s    --r233sCc6<<S3I3PSV[P[\	^55t	&44b9r   c                   \         P                  ! R 4      pV P                  \        4      ;_uu_ 4        VP	                  4        RRR4       V P                  \        4      ;_uu_ 4        VP                  4        RRR4       V P                  \        4      ;_uu_ 4        VP                  ^4       RRR4       R#   + '       g   i     L; i  + '       g   i     L\; i  + '       g   i     R# ; i)ztest.typinganndata.ann_module3N)r   import_fresh_moduler'   rF   	f_bad_ann	g_bad_ann	D_bad_ann)r   ann_module3s   & r   test_var_annot_in_module%GrammarTests.test_var_annot_in_module  s     $778XYy))!!# *y))!!# *y))!!!$ *)	 *))))))s#   B<*C C"<C	C	"C3	c                    / p/ p\        R W4       V P                  RV4       VP                  V4       V P                  VR,          ! \        P
                  P                  4      R\        /4       R# )z'docstring'
x: int = 5
r   r   N)r   assertNotInupdater   annotationlibFormatVALUEr   )r   gnslnss   &  r   test_var_annot_simple_exec'GrammarTests.test_var_annot_simple_exec  sa    #  	'-

3^,]-A-A-G-GH3PS*Ur   c                8   / p\        R V4       V P                  VR,          R
4       Rp\        W!4       V P                  \        VR,          ! 4       4      R.4       R^RRR^R\        P                  /p\        R	V4       V P                  VR,          R4       R# )zx: tuple = 1, 2r   zdef f():
    x: int = yieldr   Nr   r   cr+  zx: Tuple[int, ...] = a,*b,cr   r         r   r   rE  rF  r   )r   r   r   r*  r+  )r   nsstmts   &  r   test_var_annot_rhsGrammarTests.test_var_annot_rhs  s    #C&)%Tbgi4&11c9c!WfllC*B/C/2r   c                  aa R  pV! 4        V! Rz!   V! Rz/ / B  R pR pV P                  VP                  P                  R{4       V P                  VP                  P                  R|4       R pR pR pR pR pV! 4        V! ^4       V! ^4       V! ^^4       V! ^^4       V! 4        V! ^4       V! ^4       V! ^^4       V! ^^^^^^^^^	^ 4
       V! ^4       V! ^4       V! ^^4       V! ^^^4       V! ^^^^^^^^^	^ 4
       V! ^^4       V! ^^^4       V! ^^^^4       V! ^^^^^^^^^	^ 4
       R}R lp	V	! 4        V	! ^4       V	! R}!   T	! . ;'       g    ^.!   T	! . Rz;'       g    RzO/ ;'       d    RzO5/ Rz;'       g    / B  V	! Rz/ R	^/B  T	! Rz/ R	^/;'       g    / B  R}R
 lp
V
! ^4       V
! ^^4       V
! R}/ R^/B  R}R lpV! ^^4       V! ^^^4       V! R~!   V! ^.RO5!   V! ^^.RO5!   V! R/ R^/B  RR lpV! 4        V! ^4       V! ^^4       V! R!   V! ^.RO5!   V! R}/ R^/B  V! Rz/ R	^R^/B  RR lpV! ^4       V! ^^4       V! ^^^4       RR lpV! ^^4       V! ^^^4       V! ^^^^4       R}R lpV! 4        V! ^4       V! ^^4       V! R!   V! R}!   V! Rz/ R	^/B  R}R lpV! ^4       V! ^^4       V! ^^^4       R}R lpV! ^^4       V! ^^^4       V! ^^^^4       V! R!   V! R/ R^/B  RR lpV! 4        V! ^4       V! ^^4       V! ^^^4       V! ^.RO5!   V! Rz/ R	^R^/B  RR lpV! ^4       V! ^^4       V! ^^^4       V! ^^^^4       V! R!   V! ^^.RO5!   V! ^.RO5/ R^/B  RR lpV! ^^4       V! ^^^4       V! ^^^^4       V! ^^^^^4       V! R!   V! ^^.RO5!   V! ^.RO5/ R^/B  \        P                  ! 4       ;_uu_ 4        \        P
                  ! R\        4        \        R/ R^/B  V P                  R4       RRR4       R pV! ^dR7       R^d/R  lpV! ^^^dR!7       V! ^^^d^R"7       V! ^^^d^R#7       R$^d/R% lpV! ^^^d^d^R&7       V! ^^^d^^dR'7       V P                  \        \        R(4       V P                  \        \        R)4       V P                  \        \        R*4       R+ pV P                  V! ^.^^.O5R^R,^/ RR^R,^/34       V P                  V! ^.RO^N5!  R/ 34       V P                  \        \        R-4       V P                  V! Rz/ R.R/R0R1/B RzR.R/R0R1/34       V P                  V! RzR0R1/R.R//B RzR.R/R0R1/34       \        V R24       \        V R34       R4 R5 lpV P                  VP                  R6\        /4       R7 R8 lpV P                  VP                  R\         /4       R9 R: lpV P                  VP                  R\         /4       RR; R< llpV P                  VP                  R\         /4       R= R> lpV P                  VP                  R\        /4       R? R@ lpV P                  VP                  R\"        /4       RA RB lpV P                  VP                  R,^/4       RC RD lpV P                  VP                  R,^/4       RE RF lpV P                  VP                  R^R^/4       RG RH lpV P                  VP                  R^R^/4       RRI RJ llpV P                  VP                  R^R^RK^RL^/4       RRM^RN^
/RO RP lllpV P                  VP                  R^R^RK^RL^RQ^RN^	RR^R6^/4       RRM^RN^
/RS RT lllpV P                  VP                  R^R^RK^RU\         RL^RQ^RN^	RR^R6^/	4        ! RV RW4      p ! RX RYV4      pV P                  VP$                  P                  RZ^/4       V P                  VP$                  P                  RZ^/4       R[ oSR\ R] l4       pV P                  VP                  R6\        /4       SR^ 4       pS;pR_ 4       pV3R` lRa 4       pRbSRb.^,          Rc 4       pS! S4      ! S4      Rd 4       pS.^ ,          P&                  P&                  Re 4       p^oV3Rf lpR}V3Rg llpRR^/V3Rh llpRi V3Rj llpRk pRl pRm pRn pRo pRp pRq pRr pRs pRt pRu pRv pRw pRx pRy pR#   \         d     ELi ; i  + '       g   i     EL; i)c                      R # r   r2   r2   r   r   f1%GrammarTests.test_funcdef.<locals>.f1  s    $r   c                     R # r   r2   one_arguments   &r   f2%GrammarTests.test_funcdef.<locals>.f2      dr   c                     R # r   r2   two	argumentss   &&r   f3%GrammarTests.test_funcdef.<locals>.f3  s    r   c                     R # r   r2   )one_args   &r   a1%GrammarTests.test_funcdef.<locals>.a1      $r   c                     R # r   r2   )rX  argss   &&r   a2%GrammarTests.test_funcdef.<locals>.a2      Dr   c                      R # r   r2   rests   *r   v0%GrammarTests.test_funcdef.<locals>.v0      tr   c                     R # r   r2   r   rh  s   &*r   v1%GrammarTests.test_funcdef.<locals>.v1  r`  r   c                     R # r   r2   r   r   rh  s   &&*r   v2%GrammarTests.test_funcdef.<locals>.v2      Tr   c                     R # r   r2   r   s   &r   d01&GrammarTests.test_funcdef.<locals>.d01      dr   r   c                     R # r   r2   r   s   &&r   d11&GrammarTests.test_funcdef.<locals>.d11      r   r   c                     R # r   r2   r   r   rC  s   &&&r   d21&GrammarTests.test_funcdef.<locals>.d21  re  r   rC  c                     R # r   r2   r   s   &&r   d02&GrammarTests.test_funcdef.<locals>.d02      4r   c                     R # r   r2   r  s   &&&r   d12&GrammarTests.test_funcdef.<locals>.d12  rU  r   c                     R # r   r2   r   r   rC  ds   &&&&r   d22&GrammarTests.test_funcdef.<locals>.d22      r   c                     R # r   r2   rm  s   &*r   d01v'GrammarTests.test_funcdef.<locals>.d01v  rU  r   c                     R # r   r2   rq  s   &&*r   d11v'GrammarTests.test_funcdef.<locals>.d11v  r  r   c                     R # r   r2   r   r   rC  rh  s   &&&*r   d21v'GrammarTests.test_funcdef.<locals>.d21v      Dr   c                     R # r   r2   rq  s   &&*r   d02v'GrammarTests.test_funcdef.<locals>.d02v  s    4r   c                     R # r   r2   r  s   &&&*r   d12v'GrammarTests.test_funcdef.<locals>.d12v  s    dr   c                     R # r   r2   )r   r   rC  r  rh  s   &&&&*r   d22v'GrammarTests.test_funcdef.<locals>.d22v'  s    r   r  r9   r   s   fooz/Bytes should not work as keyword argument namesNc                     V # r   r2   keys   $r   pos0key1+GrammarTests.test_funcdef.<locals>.pos0key1:  s    Sjr   r  k2c                
    WW#3# r   r2   )p1p2k1r  s   &&$$r   pos2key2+GrammarTests.test_funcdef.<locals>.pos2key2<  s    B"K-?r   )r  )r  r  )r  r  r  c                    WW#V3# r   r2   )r  r  r  r  kwargs   &&$$,r   pos2key2dict/GrammarTests.test_funcdef.<locals>.pos2key2dict@  s    rUAR:Rr   )r  tokwarg1tokwarg2)r  r  r  zdef f(*): passzdef f(*,): passzdef f(*, **kwds): passc                      W3# r   r2   )rb  kwargss   *,r   r   $GrammarTests.test_funcdef.<locals>.fI  s
    <r   r   zf(1, x=2, *(3,4), x=5)eggs	scrambledrn   friedz
f(*g(1=2))zf(**g(1=2))c                $    V ^8  d   QhR\         /# r   returnr   )r   s   "r   r   /GrammarTests.test_funcdef.<locals>.__annotate__Y      Dr   c                     R # r   r2   r   s   &r   r   r  Y  r`  r   r  c                $    V ^8  d   QhR\         /# r   r   )r   s   "r   r   r  [  s    r   c                     R # r   r2   r   s   &r   r   r  [  rk  r   c                $    V ^8  d   QhR\         /# r   r   )r   s   "r   r   r  ]  s    r   c                    R # r   r2   r   s   "r   r   r  ]  r`  r   c                $    V ^8  d   QhR\         /# r   r   )r   s   "r   r   r  _  s    ###r   c                    R # r   r2   r   s   "r   r   r  _      tr   c                $    V ^8  d   QhR\         /# r   r  )r   s   "r   r   r  a  s    #r   c                      R # r   r2   r   s   *r   r   r  a      r   c                $    V ^8  d   QhR\         /# r   )r,  )r   s   "r   r   r  c  s    5r   c                      R # r   r2   r   s   ,r   r   r  c  r  r   c                    V ^8  d   QhR^/# r   r   r2   )r   s   "r   r   r  e  s    Cr   c                     R # r   r2   r   r   s   &&r   r   r  e  r`  r   c                    V ^8  d   QhR^/# r  r2   )r   s   "r   r   r  g  s    !!C!r   c                    R # r   r2   r  s   ""r   r   r  g  rt  r   c                     V ^8  d   QhR^R^/# )r   r   rC  r2   )r   s   "r   r   r  i  s    %%A%!%r   c                     R # r   r2   r  s   &&&&r   r   r  i  r  r   c                     V ^8  d   QhR^R^/# )r   rC  r   r2   )r   s   "r   r   r  k  s    ((Q(A(r   c                    R # r   r2   r  s   ""&&r   r   r  k  r  r   c                (    V ^8  d   QhR^R^R^R^/# )r   r   rC  r  gr2   )r   s   "r   r   r  m  s    ;;A;!;1;1;r   c                     R # r   r2   )r   r   rC  r  r  r   r  s   &&&&&&*r   r   r  m  s    tr   r  r  ijc                8    V ^8  d   QhR^R^R^R^R^R^	R^R^/# )	r   r   rC  r  r  hr  kr  r2   )r   s   "r   r   r  p  sF     	# 	#A 	#! 	#1 	#1 	# 	#A 	#	#	#r   c                    R # r   r2   r   r   rC  r  r  r   r  r  r  r  r  s   &&&&&&$$$*,r   r   r  p      "r   r  r  c                D    V ^8  d   QhR^R^R^R\         R^R^R^	R^R	^/	# )
r   r   rC  r  r   r  r  r  r  r  r   )r   s   "r   r   r  u  sM     	# 	#A 	#! 	#1 	#S 	#Q 	#1 	#a 	#	#	#r   c                   R # r   r2   r  s   """"""$$$*,r   r   r  u  r  r   r   c                   2   a  ] tR tRt o V 3R lR ltRtV tR# )'GrammarTests.test_funcdef.<locals>.Spami{  c                   < V ^8  d   QhR^/# )r   	_Spam__kwr2   )r   r   s   "r   r   4GrammarTests.test_funcdef.<locals>.Spam.__annotate__|  s       r   c                   R # r   r2   )r   r  s   &$r   r   )GrammarTests.test_funcdef.<locals>.Spam.f|      r   r2   N)r   r   r   r   r   r   r   r   s   @r   Spamr  {  s      r   r  c                       ] tR tRtRtR# )&GrammarTests.test_funcdef.<locals>.Hami~  r2   Nr  r2   r   r   Hamr  ~  s    r   r  r  c                     V # r   r2   r   s   &r   null'GrammarTests.test_funcdef.<locals>.null  s    AXr   c                $    V ^8  d   QhR\         /# r  r  )r   s   "r   r   r    r  r   c                     R # r   r2   r   s   &r   r   r    s    r   c                     R # r   r2   r   s   &r   r   r        r   c                     R # r   r2   r   s   &r   r   r    r  r   c                    < S! V 4      # r   r2   )r   r  s   &r   <lambda>+GrammarTests.test_funcdef.<locals>.<lambda>  s	    47r   c                     R # r   r2   r   s   &r   r   r    r  r   .c                     R # r   r2   r   s   &r   r   r    r  r   c                     R # r   r2   r   s   &r   r   r    r  r   c                     R # r   r2   r   s   &r   r   r    r  r   c                     < S # r   r2   closures   r   r   r    s    r   c                    < S# r   r2   )r   r  s   &r   r   r    s    7Nr   c                    < S# r   r2   )r  r  s   $r   r   r    s    g~r   c                $    V ^8  d   QhR\         /# r  r   )r   s   "r   r   r    s    &&3&r   c                     < S # r   r2   r  s   r   r   r    s    wr   c                     R # r   r2   rv  s   &r   r   r    s    4r   c                      R # r   r2   rb  s   *r   r   r    rk  r   c                      R # r   r2   kwdss   ,r   r   r    r  r   c                     R # r   r2   r   rb  s   &*r   r   r    r`  r   c                     R # r   r2   r   r  s   &,r   r   r    r  r   c                     R # r   r2   r   rb  s   $*r   r   r    r`  r   c                     R # r   r2   r   s   $r   r   r    ry  r   c                      R # r   r2   rb  r  s   *,r   r   r    r  r   c                    R # r   r2   r   r   rb  s   &$*r   r   r    rt  r   c                    R # r   r2   r   s   &$r   r   r    r}  r   c                     R # r   r2   r   rb  r  s   &*,r   r   r        $r   c                     R # r   r2   r   rb  r  s   $*,r   r   r    r  r   c                     R # r   r2   r   r  s   $,r   r   r    rU  r   c                    R # r   r2   r   r   rb  r  s   &$*,r   r   r        Tr   c                    R # r   r2   r   r   r  s   &$,r   r   r    r  r   r2   rQ  rW  r   r   r   rE  )r   rE  rE  r   r   )r   r   rE  rF  rD  rE  rF  r   r   )r   rE  rF  )"   )rF  r   )r   __code__co_varnamesr:   r;   r<   BytesWarningr   r-   	TypeErrorr'   r(   r)   r   r   r   r   r,  r   __call__)r   rN  rS  rZ  r^  rc  ri  rn  rr  rw  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  s   &                           @@r   test_funcdefGrammarTests.test_funcdef  s	    	

B
B""$002CD002FG !

1
1
1a
1a	

1
1
1Q
1Qq1Qq1Q
1
1
1Q
1Qq	
1Qq1Qq1Q
1Q
1Qq	
1Qq
1Qq1Qq1QAT
RYYA3.RXX2.		r.RXX2.s1gs1gmmAAq	#a Aq	Aq!YAAq4SGAAq	VA#asAsA"AAq	Aq!%Aq	Aq!Aq!Q"QQ
ldAw%QQ
Q1(Q
Q1Q1alc1X'QQ
Q1Q QQ *QQ
Q1Q1alQIQ""#q"-Q
Q1Q1aQ1alQIQ$$C8$ $$&&!!(L9M'F1;' 		KL ' 	)S?s?A#A##&A##&RsRQqCc:Qq#ss;+t-=>+t->?+t-EF	 10QF00a0958CN3D 	E1ua<*<=+t-EFBf[&ABvk6'BC	E@@F;+?@vk6'BC	E 	4.4/ 	**Xt,<=**S#J7**S#J7#**S#J7**S#J7**S%L9**S!H5!**S!H5%**S!S!,<=(**S!S!,<=;**q#q#q#q9	;	#a 	# 	# 	#**q#q#q#q#q#qr8R1	2	# 	#RT 	# 	#**333S!S!SRSHb2	3	 	 	$//+q1AB..a0@A	 
**Xt,<=  
 
	 

tS	!	 
	dD	 

			$	$ 
% "%1%&& 	#!&&")%m  	 '&&s0   d>%d,2d>,d;7d>:d;;d>>e	c                0   R  pV P                  V! 4       ^ 4       R pR pV P                  V! 4       . RO4       RR l3R l3R lpV P                  V! 4       ^4       RR lpV P                  V! ^^4      ^4       V P                  V! ^^^4      ^4       \        V R4       \        V R4       R	^/R
 lpV P                  V! ^^4      ^4       V P                  V! ^^^
R7      ^4       R pR pR p	R p
R pR pR pR pR pR pR pR pR pR pR pR# )c                      ^ # r   r2   r2   r   r   r  +GrammarTests.test_lambdef.<locals>.<lambda>  s    ar   c                  $    \         \        ,          # r   )r   r  r2   r   r   r  r5    s    adr   c                  6    R U u. uF  p ^V 8  NK
  	  up # u up i )r   )rE  r   r2   r   s    r   r  r5    s    j1jq1uj11s   c                     V # r   r2   r   s   &r   r  r5    s    r   c                     V ! 4       # r   r2   )r   s   &r   r  r5    s    ACr   c                     V ! 4       # r   r2   r   s   &r   r  r5    s    !#r   c                      W,           V,           # r   r2   )r   r   r   s   &&&r   r  r5    s
    quqyr   zlambda x: x = 2zlambda (None,): Noner  c                     W,           V,           # r   r2   )r   r   r  s   &&$r   r  r5    s
    13q5r   )r  c                     ^ # r4  r2   rv  s   &r   r  r5        r   c                      ^ # r4  r2   r	  s   *r   r  r5    s    Qr   c                      ^ # r4  r2   r  s   ,r   r  r5    s    ar   c                     ^ # r4  r2   r  s   &*r   r  r5        r   c                     ^ # r4  r2   r  s   &,r   r  r5    s    r   c                     ^ # r4  r2   r  s   $*r   r  r5    rD  r   c                     ^ # r4  r2   r  s   $r   r  r5    s    Ar   c                      ^ # r4  r2   r  s   *,r   r  r5    s    Qr   c                    ^ # r4  r2   r  s   &$*r   r  r5    s    1r   c                    ^ # r4  r2   r   s   &$r   r  r5    s    qr   c                     ^ # r4  r2   r  s   &*,r   r  r5        r   c                     ^ # r4  r2   r  s   $*,r   r  r5    rL  r   c                     ^ # r4  r2   r   s   $,r   r  r5    s    Ar   c                    ^ # r4  r2   r"  s   &$*,r   r  r5    s    1r   c                    ^ # r4  r2   r%  s   &$,r   r  r5    s    qr   N)r   r   r   r   r(  r   r   )r   l1l2l3l4l5l6l10l11l12l13l14l15l16l17l18l19l20l21l22l23l24s   &                     r   test_lambdefGrammarTests.test_lambdef  s    q!1y)#17=q!(Aq1%Aq!a(4!234!78(r(Aa&)Aa"v. !"!&$ ))%,(r   c                     ^p?R pV! 4        R# )r   c                      ^p ? R# r   Nr2   r   s    r   foo*GrammarTests.test_simple_stmt.<locals>.foo  s	    AQr   Nr2   )r   r   rl  s   &  r   test_simple_stmtGrammarTests.test_simple_stmt  s    	  	r   c                p      ^pRpR;p;r#^^^r2pR;p;w  rVp;w  rr8\        V R4       \        V R4       R# )r   z	x + 1 = 1za + 1 = b + 2Nr&  )r   r   )rE  rF  r   )	r   r   r   r   abcr   r   rC  xyzs	   &        r   test_expr_stmtGrammarTests.test_expr_stmt  sX    	AQa(444gaA4a4-41r   c                   Rp. ROpV F  pRP                  V4      pV F  pVP                  V4      pV P                  VR7      ;_uu_ 4        V P                  \        V4      ;_uu_ 4        \	        V4       RRR4       RRR4       VP                  RR4      pV P                  VR7      ;_uu_ 4        V P                  \        R4      ;_uu_ 4        \	        V4       RRR4       RRR4       K  	  K  	  R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     LH; i  + '       g   i     EK%  ; i)	r   zcall to '{}')sourceNrl  z(foo.)zinvalid syntax)r   r   )z{} fooz{} {{1:foo}}zif 1: {} foozif 1: {} {{1:foo}}zif 1:
    {} foozif 1:
    {} {{1:foo}})r   rd   re   r(   r   rE   )r   keywordscaseskeyword
custom_msgcaserv  s   &      r   (test_former_statements_refer_to_builtins5GrammarTests.test_former_statements_refer_to_builtins  s    "
  G'..w7JW-\\\00//ZHHV I 1  x8\\\00//=MNNV O 10   
 IH 10
 ON 100sH   D	,C98D	4D2	DD2	9D	D	DD/*D2	2Ec                    . R	OpVw  r#pW#V3p?????Rw  r#p???Rw  rgrrp????	?
?Rw  rgrrp????	?
?\        R4      pVR \        RRR4       R# )
r   rr  abcdefgabcd:r   r   Nz-del a, (b[0].c, (d.e, f.g[1:2])), [h.i.j], ()rb   r   Nr&  )r   rf   )r   rq  r   r   r   rr  r   r   rC  r  r  r   r  r  s   &             r   test_del_stmtGrammarTests.test_del_stmt  s    aAgq1ca (aA!1Aq'aA!1AqF|I?vVr   c                    R # r   r2   r>   s   &r   test_pass_stmtGrammarTests.test_pass_stmt  s    r   c                    R# rk  r2   r>   s   &r   test_break_stmtGrammarTests.test_break_stmt&  s    r   c                    ^pV'       d   ^ pK  RpV'       g   Rp K  VR8w  d   V P                  V4       RpV'       g	   Rp  RpK  VR8w  d   V P                  V4       R# R#    Rp KZ  ; i  Rpi ; i)r   rC   okz'continue inside try called except blockzfinally block not calledNr-   )r   r  msgs   &  r   test_continue_stmtGrammarTests.test_continue_stmt*  s    QC@ $;IIcN,C$;IIcN @? s   $A+.A2c                &   a  RV 3R llpV! 4        R# )r   c                    < ^pV'       d/   V^,          p V '       d   V^8X  d   V ^,          p MV^,          pK6  V^8  g   V^8w  d   SP                  R4       R# R#    h ; i)r   z1continue then break in try/except in loop broken!Nr  )extra_burning_oilcount	big_hippor   s   && r   
test_inner9GrammarTests.test_break_continue_loop.<locals>.test_innerN  sg    I
(Y!^)Q.)NI qyIN		MN +s   A A 	A A N)r   r   r2   )r   r  s   f r   test_break_continue_loop%GrammarTests.test_break_continue_loopD  s    	O 	r   c                    R  pR pR pV! 4        V! 4       pV! 4       pV P                  VRR4       \        V R4       R# )c                      R # r   r2   r2   r   r   g1$GrammarTests.test_return.<locals>.g1`  s    &r   c                      ^# r   r2   r2   r   r   g2$GrammarTests.test_return.<locals>.g2a  r@  r   c                      ^^.p ^.V O5# r(  r2   r:  s    r   g3$GrammarTests.test_return.<locals>.g3b  s    AA5q5Lr   z unparenthesized star expr returnzclass foo:return 1Nr&  rQ  )r   r  r  r  r   r   s   &     r   test_returnGrammarTests.test_return^  s@    	 	DDI'IJ4!56r   c                   R  pV! V R^4       V! V R^4       V! V R^4       V! V R^ 4       V! V R^ 4       V! V R^ 4       V! V R^4       V! V R^4       V! V R	^4       V! V R
^4       V! V R^4       V! V R^4       V! V R^4       V! V R^4       V! V R^4       V! V RR4       V! V RR4       V! V RR4       V! V RR4       R# )c                 *   \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       / RV /rC\	        \
        P                  ! V4      W44       V P                  W$R,          4       RRR4       R#   + '       g   i     R# ; i)r9   r   r   N)r:   r;   r<   r=   r   textwrapdedentr   )r   srcexpectedr  ls   &&&  r   run_case;GrammarTests.test_control_flow_in_finally.<locals>.run_casen  sa    ((**%%h>VT+1X__S)10  X;7	 +***s   ABB	z
                result = 0
                while result < 2:
                    result += 1
                    try:
                        pass
                    finally:
                        break
            z
                result = 0
                while result < 2:
                    result += 1
                    try:
                        continue
                    finally:
                        break
            z
            result = 0
            while result < 2:
                result += 1
                try:
                    1/0
                finally:
                    break
            z
            for result in [0, 1]:
                self.assertEqual(result, 0)
                try:
                    pass
                finally:
                    break
            z
            for result in [0, 1]:
                self.assertEqual(result, 0)
                try:
                    continue
                finally:
                    break
            z
            for result in [0, 1]:
                self.assertEqual(result, 0)
                try:
                    1/0
                finally:
                    break
            z
            result = 0
            while result < 2:
                result += 1
                try:
                    pass
                finally:
                    continue
                break
            z
            result = 0
            while result < 2:
                result += 1
                try:
                    break
                finally:
                    continue
            z
            result = 0
            while result < 2:
                result += 1
                try:
                    1/0
                finally:
                    continue
                break
            z
            for result in [0, 1]:
                try:
                    pass
                finally:
                    continue
                break
            z
            for result in [0, 1]:
                try:
                    break
                finally:
                    continue
            z
            for result in [0, 1]:
                try:
                    1/0
                finally:
                    continue
                break
            z
            def f():
                try:
                    pass
                finally:
                    return 1
            result = f()
            z
            def f():
                try:
                    return 2
                finally:
                    return 3
            result = f()
            z
            def f():
                try:
                    1/0
                finally:
                    return 4
            result = f()
            aj  
            def break_in_finally_after_return1(x):
                for count in [0, 1]:
                    count2 = 0
                    while count2 < 20:
                        count2 += 10
                        try:
                            return count + count2
                        finally:
                            if x:
                                break
                return 'end', count, count2

            self.assertEqual(break_in_finally_after_return1(False), 10)
            self.assertEqual(break_in_finally_after_return1(True), ('end', 1, 10))
            result = True
            Ta+  
            def break_in_finally_after_return2(x):
                for count in [0, 1]:
                    for count2 in [10, 20]:
                        try:
                            return count + count2
                        finally:
                            if x:
                                break
                return 'end', count, count2

            self.assertEqual(break_in_finally_after_return2(False), 10)
            self.assertEqual(break_in_finally_after_return2(True), ('end', 1, 10))
            result = True
            a  
            def continue_in_finally_after_return1(x):
                count = 0
                while count < 100:
                    count += 1
                    try:
                        return count
                    finally:
                        if x:
                            continue
                return 'end', count

            self.assertEqual(continue_in_finally_after_return1(False), 1)
            self.assertEqual(continue_in_finally_after_return1(True), ('end', 100))
            result = True
            a  
            def continue_in_finally_after_return2(x):
                for count in [0, 1]:
                    try:
                        return count
                    finally:
                        if x:
                            continue
                return 'end', count

            self.assertEqual(continue_in_finally_after_return2(False), 0)
            self.assertEqual(continue_in_finally_after_return2(True), ('end', 1))
            result = True
            Nr2   )r   r  s   & r   test_control_flow_in_finally)GrammarTests.test_control_flow_in_finallyl  s   	8 	 	 	 	 	 	 	 
	 	 
	 	 
	 		 	 	 	 		 	 	 
	 	 		 	 
	 	 
	 	 
	 	 
	 	" '	, 	 #	( 	  %	( 	 !	r   c                   R  pR pR pR pR pR p\        V R4       \        V R4       R pR	 p\        V R
4       \        V R4       R pR pR pR pR pV P                  \        V! 4       4      R.4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       \        V R4       R# )c               3      "   ^x  R# 5irk  r2   r2   r   r   r  "GrammarTests.test_yield.<locals>.g  s	     q   	c               3   &   "   R R j  xL
  R #  L5iNr2   r2   r2   r   r   r  r    s     B   c               3      "   ^x p R# 5irk  r2   r   s    r   r  r    s     1Wr  c               3   &   "   R R j  xL
 p R #  L5ir  r2   r   s    r   r  r    s     ]]r  c               3      "   Rx  R# 5ir   N)r   r   r2   r2   r   r   r  r    s	     tr  c               3      "   Rx p R# 5ir  r2   r   s    r   r  r    s     4Zr  zdef g(): yield from (), 1zdef g(): x = yield from (), 1c               3      "   ^^x 3 R# 5irk  r2   r2   r   r   r  r    s     1Ws   	c               3   *   "   ^R Rj  xL
 3 R#  L5ir   Nr2   r2   r2   r   r   r  r    s     ]#]s   zdef g(): 1, yield 1zdef g(): 1, yield from ()c               3   (   "   \        ^x 4       R# 5irk  r   r2   r   r   r  r    s     !G   c               3   *   "   \        ^x ^4       R# 5irk  r  r2   r   r   r  r    s     !Gas   c               3   8   "   \        R R j  xL
 4       R #  L
5ir  r  r2   r   r   r  r    s     rM#Ms   c               3   :   "   \        R R j  xL
 ^4       R #  L5ir  r  r2   r   r   r  r    s     rMA&Ms   c               3   $   "   Rp . ROV O5x  R# 5i)rF  NrF  r      r&  r2   rg  s    r   r  r    s     ~~!5   zdef g(): f(yield 1)zdef g(): f(yield 1, 1)zdef g(): f(yield from ())zdef g(): f(yield from (), 1)yieldz
yield fromzclass foo:yield 1zclass foo:yield from ()zdef g(a:(yield)): passN)r   r   rE  rF  r   r  )r   r   r   )r   r  s   & r   
test_yieldGrammarTests.test_yield  s    "4!<=4!@A#4!674!<= #&5ac%7$894!674!9:4!<=4!?@4)4.4!454!:;4!9:r   c                    R  pR pV P                   pV! RR4       V! RR4       V! RR4       V! RR4       V! RR	4       V! R
R	4       V! RR4       V! RR4       V! RR4       V! RR4       R# )c               3   >   "   ^x 3 U u. uF  q NK  	   p R# u up i 5irk  r2   r   s    r   r  4GrammarTests.test_yield_in_comprehensions.<locals>.g  s     Qw[)[![))s   
	c               3   N   "   R R j  xL
 3 U u. uF  q NK  	   p R #  Lu up i 5ir  r2   r   s    r   r  r    s"     "}./.!./}/s   %%
 %%z def g(): [(yield x) for x in ()]z!'yield' inside list comprehensionz)def g(): [x for x in () if not (yield x)]z-def g(): [y for x in () for y in [(yield x)]]z def g(): {(yield x) for x in ()}z 'yield' inside set comprehensionz#def g(): {(yield x): x for x in ()}z!'yield' inside dict comprehensionz#def g(): {x: (yield x) for x in ()}z def g(): ((yield x) for x in ())z#'yield' inside generator expressionz%def g(): [(yield from x) for x in ()]z class C: [(yield x) for x in ()]z[(yield x) for x in ()]Nr   )r   r  rZ   s   &  r   test_yield_in_comprehensions)GrammarTests.test_yield_in_comprehensions  s    )/''01	391	3=1	300	231	331	303	551	301	3'1	3r   c                h    \        R 4      h  \          d	     \        hi ; i  \         d     R# i ; i)zjust testingN)RuntimeErrorKeyboardInterruptr>   s   &r   
test_raiseGrammarTests.test_raise  s.    //!T$$ 	" &$&s    " 11c                f    ^ RI p^ RIp^ RI p^ RIHp ^ RIHp ^ RI HpHp ^ RI HpHp ^ RI HpHp R# )r   N)time)pathargv)r*   r  r  r  )r   r*   r  r  r  s   &    r   test_importGrammarTests.test_import  s     	#$%%r   c                    R # r   r2   r>   s   &r   test_globalGrammarTests.test_global  r   r   c                    aa ^ o^ oVV3R lpR# )r   c                     < R # r   r2   r  s   r   r   %GrammarTests.test_nonlocal.<locals>.f  s    r   Nr2   )r   r   r   r   s   & @@r   test_nonlocalGrammarTests.test_nonlocal  s    	 	r   c                      R '       g   Q h    R#   \          d   pT P                  R4        Rp?L$Rp?ii ; i  \          d   pT P                  R4        Rp?R# Rp?ii ; i)r   c                     V # r   r2   r   s   &r   r  *GrammarTests.test_assert.<locals>.<lambda>  s    r   z6'assert True' should not have raised an AssertionErrorNz;'assert True, msg' should not have raised an AssertionError)AssertionErrorr-   r   r  s   & r   test_assertGrammarTests.test_assert  sq    zz	P	2	  	PIINOO	P
  	2II 1 2 2	2s   :5:A$AA$Tz Won't work if __debug__ is Falsec                
    Q R4       h  \         d.   pT P                  TP                  ^ ,          R4        Rp?MRp?ii ; i Q h  \         d1   pT P                  \	        TP                  4      ^ 4        Rp?R# Rp?ii ; i)r   r  N)r-   r  r   rb  r|   r  s   & r   test_assert_failures!GrammarTests.test_assert_failures  sq    	?eO1 	/QVVAY..	/
	E5 	-S[!,,	-s*   	 A#<AA B%A==Bc                   V P                  R R4       V P                  RR4       V P                  RR4       V P                  \        R7      ;_uu_ 4        \        RRR4       \        RRR4       R	R	R	4       R	#   + '       g   i     R	# ; i)
assert(x, "msg")zassertion is always trueassert(False, "msg")assert(False,))categoryzassert x, "msg"rb   r   zassert False, "msg"N)r   r   r=   rf   r>   s   &r   test_assert_syntax_warnings(GrammarTests.test_assert_syntax_warnings  s     	!!"4"<	>!!"8"<	>!!"2"<	> ##]#;;%|V<)<@ <;;;s   A::B	c           	        \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4        \	        RRR4       V P                  \
        4      ;_uu_ 4        \	        RRR4       RRR4       V P                  \
        4      ;_uu_ 4        \	        RRR4       RRR4       V P                  \
        4      ;_uu_ 4        \	        RRR4       RRR4       RRR4       R#   \
         d    T P                  R4        Li ; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lb; i  + '       g   i     R# ; i)	rh   zassert x, "msg" rb   r   z4SyntaxError incorrectly raised for 'assert x, "msg"'r  Nr  r  )r:   r;   r<   r=   rf   r(   r-   r'   r>   s   &r   ,test_assert_warning_promotes_to_syntax_error9GrammarTests.test_assert_warning_promotes_to_syntax_error   s     $$&&!!'=9T*L&A "";//*L&A 0"";//.fE 0"";//(,? 0 '&  T		RST////// '&&sv   EC+E%D	3%ED 	&%ED3	E+D
E	D

EDE D0+E3E>EE	c                            R# rk  r2   r>   s   &r   test_ifGrammarTests.test_if5  s    r   c                :       ^ p ^pT P                  T^4       R# r   r   r   s   & r   
test_whileGrammarTests.test_whileB  s,      AAr   c                   R F  pK  	  R F  w  rpK  	    ! R R4      p^ pV! ^
4       F  qeV,           pK  	  VR8w  d   V P                  R4       . pR F  w  pVP                  V4       K  	  V P                  V. RO4       . p. RO;p;r. VOV	OV
O F  pVP                  V4       K  	  V P                  V^V,          4       R# )	r   c                   2   a  ] tR tRt o R tR tR tRtV tR# )&GrammarTests.test_for.<locals>.SquaresiV  c                     Wn         . V n        R # r   maxsofar)r   r  s   &&r   r   /GrammarTests.test_for.<locals>.Squares.__init__W  s    
r   c                ,    \        V P                  4      # r   )r|   r  r>   s   &r   __len__.GrammarTests.test_for.<locals>.Squares.__len__Z  s    c$**o5r   c                   ^ Tu;8:  d   V P                   8  g   \        h \        h\        V P                  4      pW!8:  d-   V P                  P	                  W",          4       V^,           pK2  V P                  V,          # r4  )r  
IndexErrorr|   r  append)r   r  ns   && r   __getitem__2GrammarTests.test_for.<locals>.Squares.__getitem__[  s]    A((
*:(
*:

OfJJ%%ac*!Azz!}$r   r  N)	r   r   r   r   r   r  r  r   r   r   s   @r   Squaresr   V  s       6% %r   r  i  zfor over growing sequenceNr&  r2   )r   r(  r'  )r-   r  r   )r   r  r  r  r  r  r   r   r   r   rC  s   &          r   test_forGrammarTests.test_forQ  s    A$GA!4r	% 	% AA#a8II12$BAMM! %+A!a!AMM! Q'r   c                @    ^^ ,            ^^ ,            ^^ ,           ^^ ,           ^^ ,             T P                  \        4      ;_uu_ 4        \        RRR4       \        RRR4       RRR4       R#   \          d     Lvi ; i  \         d     L}\         d   p Rp?LRp?i  L; i  \        \        \         3 d     Li ; i  \        \        \         3 d     Li ; i  \        \        \         3 d   p Rp?LRp?ii ; i  i ; i  + '       g   i     R# ; i)r   Nz/try:
    pass
except Exception as a.b:
    pass?r   z0try:
    pass
except Exception as a[b]:
    passr   EOFErrorr.  r'   r(   rf   r   r  s   & r   test_tryGrammarTests.test_tryr  s    	aC qS qSqSqS	{++H#vVI3PVW ,+# ! 		
 % )%67==$55;t;)%67DD+++ss   	A5 	B 	B, 	C 	C$ D5BBB)B)B)"B),CCC! C!$D?DD	D	c                    ^^ ,            ^^ ,            ^^ ,           ^^ ,           ^^ ,             T P                  \        4      ;_uu_ 4        \        RRR4       \        RRR4       \        RRR4       RRR4       R#   . ;\          ;e    NMN NM N6;f     Lu i ; i  . ;\         ;e    MN M \          ;e   pRp?NM	Rp?N NM N6;f     Lu i ; i  . ;\        \        \         3 ;e    NMN NM N6;f     Lu i ; i  . ;\        \        \         3 ;e    NMN NM N6;f     ELu i ; i  . ;\        \        \         3 ;e   pRp?NM	Rp?N NM N6;f     EL>u i ; i  i ; i  + '       g   i     R# ; i)r   Nz0try:
    pass
except* Exception as a.b:
    passr  r   z1try:
    pass
except* Exception as a[b]:
    passztry:
    pass
except*:
    passr  r  s   & r   test_try_starGrammarTests.test_try_star  s   	aC qS qSqSqS	{++I3PVWJCQWX8#vF ,+!	! 		
 	$!.$. 	?9&78>$><)%66<<E9&78EE+++sm   	B 	B& 	C  	D 	D? (E:B#B#&CCC %DD%D<5D<?+E2+E25E7:F	c                          R# rk  r2   r>   s   &r   
test_suiteGrammarTests.test_suite  s     r   c                         R# rk  r2   r>   s   &r   	test_testGrammarTests.test_test  s     48r   c                P    ^^8H  p^^8X  d    ^^8w  d    ^^8  d    ^^8  d    ^^8:  d    ^^8  d    WJ d    WJd    ^R9   d    ^R9  d    ^^u;8  dF   ^u;8  d>   ^u;8X  d6   ^u;8  d.   ^u;8:  d&   ^u;8w  d   ^u;9   d   Tu;9  d   Tu;J d   VJd   M R# R# R# r  r2   r   s   & r   test_comparisonGrammarTests.test_comparison  s     !V6464q5$q5$646464:t7DB;qD1DDQD!DqDADQD!D1DdDr   c                T  a  V 3R  lpV! RR4       V! RR4       V! RR4       V! RR4       V! RR4       V! R	R
4       V! RR
4       V! RR4       V! RR4       V! RR4       V! RR4       \         P                  ! 4       ;_uu_ 4        \         P                  ! R\        4       \	        RRR4       \	        RRR4       \	        RRR4       \	        RRR4       \	        RRR4       \	        RRR4       \	        RRR4       \	        RRR4       RRR4       R#   + '       g   i     R# ; i)c                 *   < SP                  W4       R # r   r   rg   r  r   s   &&r   rZ   6GrammarTests.test_comparison_is_literal.<locals>.check  s    %%d0r   zx is 1z"is" with 'int' literalzx is "thing"z"is" with 'str' literalz1 is xzx is y is 1z
x is not 1z"is not" with 'int' literalzx is not (1, 2)z"is not" with 'tuple' literalz(1, 2) is not xz	None is 1z	1 is Nonezx == 3 is yzx == "thing" is yrh   z	x is Nonerb   r   z
x is Falsez	x is Truezx is ...z	None is xz
False is xz	True is xz... is xNr:   r;   r<   r=   rf   rY   s   f r   test_comparison_is_literal'GrammarTests.test_comparison_is_literal  s   	1 	h34n9:h34m89l;<!BC!BCk67k67m89!#>?$$&&!!'=9Kv6L,7Kv6Jf5Kv6L,7Kv6Jf5 '&&&s   BDD'	c                N  a a VV 3R  lpRoV! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R	4       V! R
4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       RoV! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R 4       V! R!4       V! R"4       V! R#4       R$oV! R%4       V! R&4       V! R'4       V! R(4       V! R)4       V! R*4       V! R+4       V! R,4       R-oV! R.4       R/oV! R04       V! R14       R2oV! R34       V! R44       R5oV! R64       V! R74       R8oV! R94       R:oV! R;4       R<oV! R=4       V! R>4       V! R?4       R@oV! RA4       V! RB4       RCoV! RD4       V! RE4       V! RF4       V! RG4       V! RH4       \         P                  ! 4       ;_uu_ 4        \         P                  ! RI\        4       \	        RJRKRL4       \	        RMRKRL4       \	        RNRKRL4       \	        RORKRL4       \	        RPRKRL4       \	        RQRKRL4       RRRRRR4       RR#   + '       g   i     RR# ; i)Sc                 ,   < SP                  V S4       R # r   r   r'  s   &r   rZ   2GrammarTests.test_warn_missed_comma.<locals>.check  s    %%dC0r   z-is not callable; perhaps you missed a comma\?z[(1, 2) (3, 4)]z[(x, y) (3, 4)]z[[1, 2] (3, 4)]z[{1, 2} (3, 4)]z[{1: 2} (3, 4)]z[[i for i in range(5)] (3, 4)]z[{i for i in range(5)} (3, 4)]z[(i for i in range(5)) (3, 4)]z![{i: i for i in range(5)} (3, 4)]z[f"{x}" (3, 4)]z[f"x={x}" (3, 4)]z["abc" (3, 4)]z[b"abc" (3, 4)]z[123 (3, 4)]z[12.3 (3, 4)]z[12.3j (3, 4)]z[None (3, 4)]z[True (3, 4)]z[... (3, 4)]z[t"{x}" (3, 4)]z[t"x={x}" (3, 4)]z2is not subscriptable; perhaps you missed a comma\?z[{1, 2} [i, j]]z[{i for i in range(5)} [i, j]]z[(i for i in range(5)) [i, j]]z[(lambda x, y: x) [i, j]]z[123 [i, j]]z[12.3 [i, j]]z[12.3j [i, j]]z[None [i, j]]z[True [i, j]]z[... [i, j]]z[t"{x}" [i, j]]z[t"x={x}" [i, j]]zKindices must be integers or slices, not tuple; perhaps you missed a comma\?z[(1, 2) [i, j]]z[(x, y) [i, j]]z[[1, 2] [i, j]]z[[i for i in range(5)] [i, j]]z[f"{x}" [i, j]]z[f"x={x}" [i, j]]z["abc" [i, j]]z[b"abc" [i, j]]z.indices must be integers or slices, not tuple;z[[1, 2] [3, 4]]z-indices must be integers or slices, not list;z[[1, 2] [[3, 4]]]z [[1, 2] [[i for i in range(5)]]]z,indices must be integers or slices, not set;z[[1, 2] [{3, 4}]]z [[1, 2] [{i for i in range(5)}]]z-indices must be integers or slices, not dict;z[[1, 2] [{3: 4}]]z#[[1, 2] [{i: i for i in range(5)}]]z2indices must be integers or slices, not generator;z [[1, 2] [(i for i in range(5))]]z1indices must be integers or slices, not function;z[[1, 2] [(lambda x, y: x)]]z,indices must be integers or slices, not str;z[[1, 2] [f"{x}"]]z[[1, 2] [f"x={x}"]]z[[1, 2] ["abc"]]zDindices must be integers or slices, not string.templatelib.Template;z[[1, 2] [t"{x}"]]z[[1, 2] [t"x={x}"]]z'indices must be integers or slices, notz[[1, 2] [b"abc"]]z[[1, 2] [12.3]]z[[1, 2] [12.3j]]z[[1, 2] [None]]z[[1, 2] [...]]rh   z[(lambda x, y: x) (3, 4)]rb   r   z[[1, 2] [i]]z[[1, 2] [0]]z[[1, 2] [True]]z[[1, 2] [1:2]]z[{(1, 2): 3} [i, j]]Nr)  )r   rZ   r  s   f @r   test_warn_missed_comma#GrammarTests.test_warn_missed_comma  s   	1 =     ./././12 !" nooon !"A ././)*nooon !"Z   ./ !" = <!"01;!"01<!"34A01@+,;!"#$ !S!"#$6!"  ! $$&&!!'=9/vFNL&9NL&9%|V<$lF;*L&A '&&&s   A*JJ$	c                    ^p^ p^pR# rk  r2   r   s   & r   test_binary_mask_ops!GrammarTests.test_binary_mask_opsH  s    r   c                    ^p^ p^pR# rk  r2   r   s   & r   test_shift_opsGrammarTests.test_shift_opsM  s    r   c                    ^p^pRp^pR# )r   Nr8  r2   r   s   & r   test_additive_opsGrammarTests.test_additive_opsR  s    r   c                    ^pRp^ pRpR# )r   N      ?g        r2   r   s   & r   test_multiplicative_ops$GrammarTests.test_multiplicative_opsX  s    r   c                    ^pRpRpRpRpR# )r   Nr8  r;  r2   r   s   & r   test_unary_opsGrammarTests.test_unary_ops^  s    #!r   c                   ^ RI p^ RIpVP                  ^ ,          pVP                  4       pVP                  R,          P                  4       pRpV^ ,          pVR,          pVR,          pVR,          pVR,          pVR,          pVRR pVRR pVRR p/ p^V^&   ^VR&   ^VR&   ^VR&   \	        V4      pVP                  R R	7       V P                  \        V4      R
4       R# )r   Nr  01234:r   r   N:Nr   N:r   NN:NNNc                 0    \        V 4      P                  V 3# r   )r&   r   r   s   &r   r  -GrammarTests.test_selectors.<locals>.<lambda>  s    d1g..2r   r  z[1, (1,), (1, 2), (1, 2, 3)]r8  r   r   r&  )r*   r  r  modulesr   sortr   r   )	r   r*   r  rC  r   r   r.   r  Ls	   &        r   test_selectorsGrammarTests.test_selectorse  s     	HHQKIIKKK$$&aDbEcFbEbEaDbcFcrFbH !"#%G	23Q!?@r   c                    ^p^p^^^3p. p^.p^.p^^^.p. p/ pR^/pR^/pR^/pR^R^/pR^R^/pR^R^R^R^R^R^/pR0pR^0p0 R	mp0 R
mpTpRp^{pR# )r   r   rX  threefourfivesixr   N>   r   rX  rO  >   r   rE  rF  r2   r   s   & r   
test_atomsGrammarTests.test_atoms  s     !QCM!QAJAKQ$Aua Aua!Aua!VQ5!LGAK#r   c                  a  ! R  R4      p ! R R4      p ! R RV4      p ! R RV4      p ! R R	W4V4      p ! R
 R4      pR oS ! R R4      4       pS ! R R4      4       pS;p	 ! R R4      4       p
V3R l ! R R4      4       pRSR.^,           ! R R4      4       pS! S4      ! S4       ! R R4      4       pS.^ ,          P                   P                    ! R R4      4       pR# )c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Bi  r2   Nr  r2   r   r   r  rW    s    r   r  c                       ] tR tRtRtR# )&GrammarTests.test_classdef.<locals>.B2i  r2   Nr  r2   r   r   B2rY    s    Dr   rZ  c                       ] tR tRtRtR# )&GrammarTests.test_classdef.<locals>.C1i  r2   Nr  r2   r   r   C1r\        Tr   r]  c                       ] tR tRtRtR# )&GrammarTests.test_classdef.<locals>.C2i  r2   Nr  r2   r   r   C2r`    r^  r   ra  c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Di  r2   Nr  r2   r   r   r  rc    s    Dr   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )%GrammarTests.test_classdef.<locals>.Ci  c                    R # r   r2   r>   s   &r   meth1+GrammarTests.test_classdef.<locals>.C.meth1  rt  r   c                    R # r   r2   )r   args   &&r   meth2+GrammarTests.test_classdef.<locals>.C.meth2  r  r   c                    R # r   r2   )r   r^  rc  s   &&&r   meth3+GrammarTests.test_classdef.<locals>.C.meth3  r#  r   r2   N)	r   r   r   r   rg  rk  rn  r   r   r   s   @r   r   re    s     !&))r   r   c                     V # r   r2   r   s   &r   class_decorator3GrammarTests.test_classdef.<locals>.class_decorator  s    qr   c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Gi  r2   Nr  r2   r   r   Grt        r   ru  c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Hi  r2   Nr  r2   r   r   Hrx    rv  r   ry  c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Ii  r2   Nr  r2   r   r   Ir{    rv  r   r|  c                    < S! V 4      # r   r2   )rC  rq  s   &r   r  ,GrammarTests.test_classdef.<locals>.<lambda>  s
    ?1%r   c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Ji  r2   Nr  r2   r   r   Jr    rv  r   r  .c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Ki  r2   Nr  r2   r   r   Kr    rv  r   r  c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Li  r2   Nr  r2   r   r   rK  r    rv  r   rK  c                       ] tR tRtRtR# )%GrammarTests.test_classdef.<locals>.Mi  r2   Nr  r2   r   r   r-  r    rv  r   r-  N)r/  )r   r  rZ  r]  ra  r  r   ru  ry  r  r|  r  r  rK  r-  rq  s   &              @r   test_classdefGrammarTests.test_classdef  s      	* 	* 	)	 
 " 
"	 
	% 
&
	$Q	' 
(		)/	: 
;
	1		&	&	/	/ 
0r   c           	     v    . ROpT P                  V Uu/ uF  q"V^,           bK  	  up^^^^^^/4       R# u upi )r   Nr&  r   )r   numsr  s   &  r   test_dictcompsGrammarTests.test_dictcomps  s>     .AAaC%.Aq!Q0BC.s   6c                X  a  . ROp. R	Op. R
OpS P                  V Uu. uF  qDP                  4       NK  	  up. RO4       S P                  V Uu. uF  p^V,          NK  	  up. RO4       S P                  V Uu. uF  qU^8  g   K  VNK  	  up. RO4       S P                  V UUu. uF  qb F  qFV3NK  	  K  	  upp. RO4       S P                  V UUUu. uF'  qb Uu. uF  pRV9   g   K  VNK  	  up F  qFV3NK  	  K)  	  uppp. RO4       S P                  \        ^4       Uu. uF  pR ! V4      NK  	  up^.^^.. RO. RO. RO.4       R p	S P                  V	! V4      . RO4       V 3R lp
V
! 4        \        S R4       \        S R4       . ROp. ROp. ROpV UUUUUUu. uF3  w  rV F(  w  ppV F  w  ppVV8X  g   K  VV8X  g   K  VV3NK  	  K*  	  K5  	  pppppppS P                  V. RO4       R# u upi u upi u upi u uppi u upi u upppi u upi u uppppppi )r   r  c                 \    \        V ^,           4       Uu. uF  qV,          NK  	  up# u upi r   range)r   r  s   & r   r  -GrammarTests.test_listcomps.<locals>.<lambda>  s"    51:$>:aTT:$>$>s   )c                 h    V  Uu. uF!  q^8  g   K  ^ Tu;8  ;'       d    ^8  Mu NK#  	  up# u upi r(  r2   )r  r   s   & r   test_in_func1GrammarTests.test_listcomps.<locals>.test_in_func  s*    '(2q!EIAIIAIq222s   ///c            
         < SP                  R U Uu. uF  q V ^,           3 Uu. uF  qNK  	  upNK  	  upp ^^.^^.^^..4       R# u upi u upp i )r   N)r   rE  r   r   )r   r   r   s     r   test_nested_front6GrammarTests.test_listcomps.<locals>.test_nested_front  sS    wGw!a!e*5*Qq*5wG !fq!fq!f575Gs   A

AA
A
z"[i, s for i in nums for s in strs]z[x if y]NrG  )AppleBananaCoconut)z  Applez Banana zCoco  nut  )r  r  z	Coco  nut)rE  r  	         r)  ))r   r  r   r  r   r  )r   r  r   r  r   r  )rE  r  rE  r  rE  r  )rF  r  rF  r  rF  r  )r   r  r   r  r   r  )
r  r  r  r  r  r  r  r  r  r  )r   r   rF  )r   rE  r     )r   rF     @      )FFF))r   Boeing)r   Ford)rE  
Macdonalds))
   Airliner)   Engine)   Cheeseburger))r   r  )r   r  )r   r  )rE  r  ))r  r  )r  r  )r  r  )r  r  )r   stripr  r   )r   r  strsspcsr.   r   r  r   r  r  r  	supplierspartssuppartsnosnamepnopnamesp_snosp_pnos   f                   r   test_listcompsGrammarTests.test_listcomps  s4   -5T2T'')T24TU.A!a%%.0ABT3TU!!T3Y?$=$Q1a&&$=G	H 	$V$QD8UDqCSTHD8U1a&8U&$V9	: 	ERSHUHq>BHU#1vy-ATU	W	3 	d+-BC	7 	4!EF4,
	

 !*
 
 )"',3(/$VVF]	  (+f}	 5%. )0 "'  ) 	
 
 	 = 	>m 3.3= 9VV VB
sS   G<H9HH&H
H	H,H2H'H&H"H"H"Hc           
       a R  \        ^4       4       pT P                  \        V4      \        ^
4       Uu. uF  q"NK  	  up4        \        V4       V P                  R4       ^o V3R lS 4       p\        V4       V P                  R4       T P                  \        R R 4       4      R UUu. uF  pR F  q2V3NK  	  K  	  upp4       T P                  \        R R 4       4      R UUu. uF  pR F  q2V3NK  	  K  	  upp4       \        ^
4       Uu. uF  q"NK  	  upoR	 R
 S 4        4       pT P                  \        V4      \        \        ^
4       Uu. uF  q"NK  	  up4      4       T P                  \        R \        ^
4       4       4      \        \        ^
4       Uu. uF  q"^,          NK  	  up4      4       T P                  \        R \        ^
4       4       4      \        \        ^
4       Uu. uF  q"^,          '       g   K  W",          NK  	  up4      4       T P                  \        R R \        ^
4       4        4       4      \        \        ^
4       Uu. uF  q"NK  	  up4      4       T P                  \        R R R \        ^
4       4        4        4       4      \        \        ^
4       Uu. uF  q"NK  	  up4      4       T P                  \        R R \        ^
4       4        Uu. uF  q3NK  	  up 4       4      \        \        ^
4       Uu. uF  q"NK  	  up4      4       T P                  \        R R R \        ^
4       4        4        4       4      \        \        ^
4       Uu. uF  q"NK  	  up4      4       V P                  \        R R R \        ^
4       4        4        4       4      ^ 4       \        V R4       \        V R4       R# u upi   \         d     ELi ; i  \
         d     ELyi ; iu uppi u uppi u upi u upi u upi u upi u upi u upi u upi u upi u upi )c              3   `   "   T F  p\        ^
4       Uu. uF  qNK  	  upx  K!  	  R# u upi 5i)r  Nr  .0r   s   & r   	<genexpr>,GrammarTests.test_genexps.<locals>.<genexpr>  s&     6Xr#Aa#X#s   .
).z&should produce StopIteration exceptionc              3   (   <"   T F  pSx  K	  	  R # 5ir   r2   )r  r  r   s   & r   r  r    s     AqAs   zshould produce TypeErrorc              3   :   "   T F  pR  F  q!V3x  K
  	  K  	  R# 5i)r  Nr2   r  r   r   s   &  r   r  r    s     Eff!ffff   r  c              3   :   "   T F  pR  F  q!V3x  K
  	  K  	  R# 5i)xyNr2   r  s   &  r   r  r     s     AdDq!fDfdr  abr  c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  s   & r   r  r  #  s     '1Qr  c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  r   s   & r   r  r  #  s     AqAr  c              3   2   "   T F  q^,          x  K  	  R# 5ir   Nr2   r  s   & r   r  r  &  s     59aTT9s   c              3   R   "   T F  q^,          '       g   K  W,          x  K  	  R# 5ir  r2   r  s   & r   r  r  '  s     ;)QssSQSS)s   ''c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  s   & r   r  r  (  s     ?(>1Q(>r  c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  s   & r   r  r  (  s     (>IqIr  c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  s   & r   r  r  )       L(K1Q(Kr  c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  s   & r   r  r  )  s     (K4Jq4Jr  c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  r   s   & r   r  r  )       4J	1Q	r  c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  s   & r   r  r  *  r  r  c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  s   & r   r  r  *  r  r  c              3   &   "   T F  pVx  K	  	  R# 5iTNr2   r  s   & r   r  r  +  s     \(S1Q(S   c              3   $   "   T F  qx  K  	  R # 5ir   r2   r  s   & r   r  r  +  s     (S4Rq4Rr  c              3   &   "   T F  pVx  K	  	  R# 5ir  r2   r  s   & r   r  r  +       4R	1Q	r  c              3   &   "   T F  pVx  K	  	  R# 5ir  r2   r  s   & r   r  r  ,  s     e(\1Q(\r  c              3      "   T F  pK  	  R# 5i)FNr2   r  s   & r   r  r  ,  s     (\4Rq4Rs   c              3   &   "   T F  pVx  K	  	  R# 5ir  r2   r  s   & r   r  r  ,  r  r  zfoo(x for x in range(10), 100)zfoo(100, x for x in range(10))N)	r  r   nextr-   StopIterationr.  r   sumr   )r   r  r   r   r   r   s   &    @r   test_genexpsGrammarTests.test_genexps  s   6U1X6aeBi"8i1i"89	GII>? 	AAGII01 	EfEEX^GoX^SThncdAhnX^GopAdAATXCgTXqbf]^FbfFTXCghb	"	1Q	"'A'Qr%;Aa%;!<=55955s%PR);T)QqDD);T7UV;%);;SuUWyA`y!^_\_\_#!##yA`=ab?(>E"I(>??QVWYQZE[QZAaQZE[A\]L(K4Jb	4J(KLLc^cdf^gRh^gYZST^gRhNijL4Jb	4J(K4Jq4J(KLLc^cdf^gRh^gYZST^gRhNij\(S4Rb	4R(S\\^anstvnwbxnwijcdnwbx^yze(\4Rb	4R(\eeghi4!AB4!AB= #9  		  		 HpCg"%;;TA`E[Rh(KRhbxsq   
O#
O( '(O: 0P.P
P
P(P";P'P'%
P,?
P1:
P6!
P;;
Q (O76O7:P	P	c           	       aa ^
oR \        S4       4       p^oV P                  \        \        V4      4      ^
4       ^
oRoVV3R l\        S4       4       p^oRoT P                  \        ^
4       UUu. uF  p\        ^4       F  q2V3NK  	  K  	  upp\        V4      4       T P                  \        ^
4       Uu. uF&  qD^,          '       g   K  V^,          '       g   K$  VNK(  	  up. RO4       V P                  \        R \        ^
4       4       4      . RO4       T P                  R	 Uu. uF  w  qDNK  	  up. R
O4       V P                  \        R R 4       4      . RO4       R# u uppi u upi u upi )r  c              3   $   "   T F  qx  K  	  R # 5ir   r2   )r  r  s   & r   r  ;GrammarTests.test_comprehension_specials.<locals>.<genexpr>2  s     )1Qr  Fc              3   b   <"   T F$  pS'       g   K  \        S4       F  q!V3x  K
  	  K&  	  R # 5ir   r  )r  r  r  tr   s   &  r   r  r  6  s#     Ox!1eAh1hxs   
//Tc              3   h   "   T F(  q^,          '       g   K  V^,          '       g   K$  Vx  K*  	  R# 5ir  r2   r  s   & r   r  r  =  s"     EA!eeaq1uuaas   22
2c              3   (   "   T F  w  qx  K
  	  R # 5ir   r2   r  s   & r   r  r  A  s     =*<BAa*<r  N)r   r      )rF  )r   )r  r  ))r  )   )r  )r  r  r  )r  r   r|   r   )r   r  r  r  r   r  s   &   `@r   test_comprehension_specials(GrammarTests.test_comprehension_specials0  s2   )a)q1T!Wr* EOuQxO14qrEAE!HqQ%H%EtAwO 	eBiCiq551AEE11iCYOErEEyQ 	&89&8!&899E=*<==yI F D :s   4E*
<E0E0"E0.E5c                    ! R  R\         4      pV! 4       ;_uu_ 4         RRR4       V! 4       ;_uu_ 4       p RRR4       V! 4       ;_uu_ 4       w  r# RRR4       V! 4       ;_uu_ 4        V! 4       ;_uu_ 4         RRR4       RRR4       V! 4       ;_uu_ 4       q!! 4       ;_uu_ 4       p RRR4       RRR4       V! 4       ;_uu_ 4       q!! 4       ;_uu_ 4         RRR4       RRR4       V! 4       ;_uu_ 4         RRR4       V! 4       ;_uu_ 4       p RRR4       V! 4       ;_uu_ 4       w  r#V! 4       ;_uu_ 4       p RRR4       RRR4       V! 4       ;_uu_ 4        V! 4       ;_uu_ 4         RRR4       RRR4       V! 4       ;_uu_ 4       pV! 4       ;_uu_ 4       p RRR4       RRR4       V! 4       ;_uu_ 4       pV! 4       ;_uu_ 4         RRR4       RRR4       V! 4       ;_uu_ 4       pV! 4       ;_uu_ 4       pV! 4       ;_uu_ 4       p RRR4       RRR4       RRR4       V! 4       ;_uu_ 4       pV! 4       ;_uu_ 4       pV! 4       ;_uu_ 4         RRR4       RRR4       RRR4       R#   + '       g   i     ELb; i  + '       g   i     EL]; i  + '       g   i     ELV; i  + '       g   i     ELA; i  + '       g   i     ELM; i  + '       g   i     EL9; i  + '       g   i     ELE; i  + '       g   i     EL1; i  + '       g   i     EL=; i  + '       g   i     EL8; i  + '       g   i     EL3; i  + '       g   i     EL; i  + '       g   i     EL(; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL
; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL ; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     R# ; i)c                   ,   a  ] tR tRt o R tR tRtV tR# )1GrammarTests.test_with_statement.<locals>.manageriD  c                    R# r   r   r2   r>   s   &r   	__enter__;GrammarTests.test_with_statement.<locals>.manager.__enter__E  s    r   c                    R # r   r2   )r   rb  s   &*r   __exit__:GrammarTests.test_with_statement.<locals>.manager.__exit__G  r  r   r2   N)r   r   r   r   r  r  r   r   r   s   @r   managerr  D  s      r   r  N)object)r   r  r   r   r   s   &    r   test_with_statement GrammarTests.test_with_statementC  sx   	f 	 YY YY! YY&1 YY		 "YYY!WYY! 'YYY!WYY 'Y II 
 II 
 II!II   IIII   IIII   IIII   IIIIII    IIIIII   Io YYYYYY!		YYY&YYYYY&YYYYY II
 II II II II II II II II II II II II II II IIs  I:JJ",K
<J6	>K
K2,K	.K2LL	L=L.M/M*M	M*"N2M>	4NN:#N&	%N:O"O	O"5PP
	O6P
	P>QQ	P2 Q	(Q:J	J	"J3	6K	K

K	K/)	K22L	L	LL+	.L?	M	M'!	M**M;	>N		NN#	&N71	N::O	O	O""O3	6P	P
	
P	PP/	2Q=	Q	Q	QQ+	c                (   R  pT P                  R R 3 Uu. uF  q"! 4       '       g   K  V! 4       NK  	  upR.4       T P                  R R 3 Uu. uF  q"! R4      '       g   K  V! R4      NK  	  upR.4       T P                  ^^4       T P                  ^^4       T P                  ^^4       T P                  ^^4       T P                  ^^4       T P                  ^^4       T P                  ^^4       T P                  ^^4       T P                  RR4       T P                  ^^4       T P                  ^^4       T P                  ^^4       T P                  ^^4       T P                  R^4       T P                  ^^4       R# u upi u upi )	c                    \        V 4       V# )z@helper to check that evaluation of expressions is done correctlyr   )r  rets   &&r   
_checkeval2GrammarTests.test_if_else_expr.<locals>._checkeval  s    #JJr   c                      R # )Tr2   r2   r   r   r  0GrammarTests.test_if_else_expr.<locals>.<lambda>  s    r   c                      R # ro   r2   r2   r   r   r  r    s    ur   Tc                     V '       d   R # R# )FTr2   r   s   &r   r  r    s    8L8Lr   c                     V '       d   R # R# )TFr2   r   s   &r   r  r    s    `aX\XlglXlr   FNg      @r   )r   r  r   s   &  r   test_if_else_exprGrammarTests.test_if_else_expr  s{   	 	}(EN(E1313(ENQUPVW.LNl-m{-mqrsxqy81U8-m{  C  ~D  	E!CQCA2a!4!4!aH!]^_qaH%e4!a0%a0%a0%b1%a0!a0! O{s   F
F
F%Fc                   V P                  ^^4       V P                  ^^4       V P                  ^^4       ^p^pV P                  RWJ J 4       V P                  RVJ VJ 4       T P                  RTu;J ;'       d    VJ 4       R# u 4       R# )r  FN)r   r+   assertFalser~   s   &  r   test_paren_evaluation"GrammarTests.test_paren_evaluation  s    ++q)!&)*%1**+!q))r   c                     ! R  R4      pV! 4       pV P                  W",          ^4       V^*,          pV P                  VP                  ^*4       R# )c                   ,   a  ] tR tRt o R tR tRtV tR# )'GrammarTests.test_matrix_mul.<locals>.Mi  c                    ^# r  r2   r   r(  s   &&r   
__matmul__2GrammarTests.test_matrix_mul.<locals>.M.__matmul__  s    r   c                    Wn         V # r   otherr  s   &&r   __imatmul__3GrammarTests.test_matrix_mul.<locals>.M.__imatmul__  s    
r   r"  N)r   r   r   r   r  r$  r   r   r   s   @r   r-  r    s      r   r-  N)r   r#  )r   r-  ms   &  r   test_matrix_mulGrammarTests.test_matrix_mul  sD    	 	 C"	R"%r   c                   R  pV P                  VP                  R4       V P                  \        VP                  P
                  \        P                  ,          4      4       R pVR 4       pV P                  VP                  4       V P                  VP                  R4       V P                  \        VP                  P
                  \        P                  ,          4      4       R# )c                  >   "   R  p  \        4       G Rj  xL
  R#  L5i)c                      R # r   r2   r2   r   r   r  8GrammarTests.test_async_await.<locals>.test.<locals>.sum  r  r   N)someobj)r  s    r   rg   +GrammarTests.test_async_await.<locals>.test  s     is   rg   c                      \        V R R4       V # )_markedT)setattr)funcs   &r   	decorator0GrammarTests.test_async_await.<locals>.decorator  s    D)T*Kr   c                     "   ^# 5i)   r2   r2   r   r   test2,GrammarTests.test_async_await.<locals>.test2  s        r7  N)	r   r   r+   boolr+  co_flagsinspectCO_COROUTINEr0  )r   rg   r3  r7  s   &   r   test_async_awaitGrammarTests.test_async_await  s    	  	/T]]33g6J6JJKL	 
	 
	&1U^^44w7K7KKLMr   c                   aa  ! R  R\         4      o ! R R4      oVV3R lpV P                  S4      ;_uu_ 4        V! 4       P                  R4       RRR4       R#   + '       g   i     R# ; i)c                       ] tR tRtRtR# ))GrammarTests.test_async_for.<locals>.Donei  r2   Nr  r2   r   r   DonerB        tr   rC  c                   ,   a  ] tR tRt o R tR tRtV tR# )*GrammarTests.test_async_for.<locals>.AIteri  c                    V # r   r2   r>   s   &r   	__aiter__4GrammarTests.test_async_for.<locals>.AIter.__aiter__  s    r   c                   "   \         h5ir   )StopAsyncIterationr>   s   &r   	__anext__4GrammarTests.test_async_for.<locals>.AIter.__anext__  s     ((r  r2   N)r   r   r   r   rH  rL  r   r   r   s   @r   AIterrF    s     ) )r   rN  c                     <"   S! 4         R j  xL
  p K   LDS! 4         R j  xL 
  w  rK  D	S! 4         R j  xL 
  p K  D Sh5ir   r2   )r  r  rN  rC  s     r   rl  (GrammarTests.test_async_for.<locals>.foo  s_      7  a7#g  da & 7  a # JsD   A	A	A	0(0A	A?AA	Nr   r'   send)r   rl  rN  rC  s   & @@r   test_async_forGrammarTests.test_async_for  sJ    #9#	) 	)		 t$$EJJt %$$$   AA.	c                   aa  ! R  R\         4      o ! R R4      oVV3R lpV P                  S4      ;_uu_ 4        V! 4       P                  R4       RRR4       R#   + '       g   i     R# ; i)c                       ] tR tRtRtR# )*GrammarTests.test_async_with.<locals>.Donei  r2   Nr  r2   r   r   rC  rX    rD  r   rC  c                   ,   a  ] tR tRt o R tR tRtV tR# )-GrammarTests.test_async_with.<locals>.manageri  c                   "   R# 5ir   r2   r>   s   &r   
__aenter__8GrammarTests.test_async_with.<locals>.manager.__aenter__  s
     r9  c                   "   R # 5iro   r2   )r   excs   &*r   	__aexit__7GrammarTests.test_async_with.<locals>.manager.__aexit__  s     r9  r2   N)r   r   r   r   r\  r`  r   r   r   s   @r   r  rZ    s      r   r  c            
      f  <"   S! 4       ;_uu_4       GR j  xL
   R R R 4      GR j  xL
  S! 4       ;_uu_4       GR j  xL
 p  R R R 4      GR j  xL
  S! 4       ;_uu_4       GR j  xL
 w  r R R R 4      GR j  xL
  S! 4       ;_uu_4       GR j  xL
  S! 4       ;_uu_4       GR j  xL
   R R R 4      GR j  xL
  R R R 4      GR j  xL
  S! 4       ;_uu_4       GR j  xL
 p S! 4       ;_uu_4       GR j  xL
 p R R R 4      GR j  xL
  R R R 4      GR j  xL
  S! 4       ;_uu_4       GR j  xL
 p S! 4       ;_uu_4       GR j  xL
   R R R 4      GR j  xL
  R R R 4      GR j  xL
  Sh EL_ ELQ  + GR j  xL 
 '       g   i     ELi; i ELY ELK  + GR j  xL 
 '       g   i     ELc; i ELS ELC  + GR j  xL 
 '       g   i     EL[; i ELK EL6 EL(  + GR j  xL 
 '       g   i     EL@; i EL8  + GR j  xL 
 '       g   i     ELP; i EL@ EL+ EL  + GR j  xL 
 '       g   i     EL5; i EL-  + GR j  xL 
 '       g   i     ELE; i EL5 EL  EL  + GR j  xL 
 '       g   i     EL*; i EL"  + GR j  xL 
 '       g   i     Sh; i5ir   r2   )r   r   rC  r  s     r   rl  )GrammarTests.test_async_with.<locals>.foo  s    yyy !yyyyA !yyyyFQ !yyyy'))) #,)yyyyyAwyyyA (1yyyyyyAwyyy (1yyyJ !yyy yyy yyy ))))yyyy yyyyyyyy yyyyyyyyJs  J1E6J1E<J1E9J1 FJ1FJ1FJ1)F<*J1-G1J1<F?=J1GJ1H,G"-H0G(	2H=G%>HJ1HJ1%H%&J1)I=H(>IH.	IH+IJ1IJ16I+7J1:JI.JI4	JI1 J$J1/J0J19J1<F	F
F	F	
J1J1F9	%F(&
F9	1F9	3
J1?J1G	G	
G	G	
J1"H%H(H.G1/
H:H<	HJ1H"	H
H"	H"	
J1(I+I.I4H75
I I	IJ1I(	I
I(	 I(	"
J1.J1J4J:I=;
JJ	JJ1J.	J
J.	&J.	(	J1NrQ  )r   rl  rC  r  s   & @@r   test_async_withGrammarTests.test_async_with  sJ    #9#	 		 t$$EJJt %$$$rU  c                H   a R  oV3R lpV P                  V! 4       R4       R# )c                     R # )rC   r2   rl  bars   &&r   test1/GrammarTests.test_complex_lambda.<locals>.test1  s    r   c                     < S ! R  R R7       # )c                      R # )u3   、、、、、、、、、、、、、、、、、r2   r2   r   r   r  AGrammarTests.test_complex_lambda.<locals>.test2.<locals>.<lambda>  s    Qr   c                      R # )z.abcdefghijklmnopqrstuvwxyz 123456789 123456789r2   r2   r   r   r  rn    s    Lr   rh  r2   )rj  s   r   r7  /GrammarTests.test_complex_lambda.<locals>.test2  s    QL  r   rC   Nr   )r   r7  rj  s   & @r   test_complex_lambda GrammarTests.test_complex_lambda  s!    		 	"%r   r2   N)Jr   r   r   r   r   r   r   r   r   r   r   r   r  r$  r.  r6  r@  rJ  r0  rg  rn  rs  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  unittest
skipUnlessr  r  r  r  r  r  r  r  r  r   r#  r*  r/  r2  r5  r8  r<  r@  rL  rS  r  r  r  r  r  r  r  r  r'  r>  rS  rd  rq  r   r   r   s   @r   r   r     s    /A>
&1>,\0*:	%V3v&p!)N2%.W4447]~%;N36'&I2& $FGE HEA@*(BX6G4	9K"6:WBr

"A<FBD=>~!CFJ&BH16*&N*.6
& 
&r   r   __main__c                @    V ^8  d   Qh/ ^ \         9   d
   \        ;R&   # )r   var_annot_global)__conditional_annotations__r   )r   s   "r   r   r      s     E EH  # I Fr   )rx  r   r   r   r   r;  r<  rs  r*   r  r:   test.typinganndata.ann_moduletypinganndatar)  r*  test.typinganndatar   rg   test.support.numbersr   r	   TestCaser   r   r   mainr   )rx  s   @r   <module>r     s    F E &    
    3 2  * 
lP"" lP\ @&8$$ @&F8 zMMO r   