+
     BiK                         ^ RI Ht ^ RIt^ RIHt  ! R R]P
                  4      t ! R R]P
                  4      t]R8X  d   ]P                  ! ^R	7       R# R# )
    )pyparseN)
namedtuplec                   ,   a  ] tR t^t o R tR tRtV tR# )ParseMapTestc                t   R  Uu/ uF  p\        V4      \        V4      bK  	  pp\        P                  ! V4      pV P                  V\        R4      ,          \        R4      4       V P                  V\        R4      ,          \        R4      4       V P                  VR,          \        R4      4       R# u upi )z 	
	axi  N)ordr   ParseMapassertEqual)selfc	keepwhitemappings   &   5/usr/lib/python3.14/idlelib/idle_test/test_pyparse.pytest_parsemapParseMapTest.test_parsemap
   s    -67YSVSV^Y	7""9-T+SY7S*CH5C1	 8s   B5c                    \         P                  ! ^^4      pV P                  RP                  \         P                  4      R4       R# )   z	 a([{b}])b"c'd
zxxx(((x)))x"x'x
N)r   Parserr   	translatetrans)r   parsers   & r   
test_transParseMapTest.test_trans   s5    1%.88G-	/     N)__name__
__module____qualname____firstlineno__r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      s     2/ /r   r   c                      a  ] tR t^t o ]R 4       t]R 4       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V tR# )PyParseTestc                @    \         P                  ! ^^R7      V n        R# )r   )indentwidthtabwidthN)r   r   r   clss   &r   
setUpClassPyParseTest.setUpClass   s    ^^A>
r   c                
    V = R # N)r   r,   s   &r   tearDownClassPyParseTest.tearDownClass   s    Jr   c                    V P                  V P                  P                  ^4       V P                  V P                  P                  ^4       R# )r   N)r   r   r*   r+   )r   s   &r   	test_initPyParseTest.test_init"   s6    00!4--q1r   c                   V P                   pV P                  pVP                  pV P                  \        4      ;_uu_ 4        V! R 4       RRR4       RpV FT  pV P                  VR7      ;_uu_ 4        V! V4       V! VP                  V4       V! VP                  ^ 4       RRR4       KV  	  R#   + '       g   i     Ln; i  + '       g   i     K~  ; i)r	   Nstring) a
)r   r   set_codeassertRaisesAssertionErrorsubTestcodestudy_level)r   eqpsetcodetestsr9   s   &     r   test_set_codePyParseTest.test_set_code&   s    KK** ~..CL / FV,,1666"1==!$ -,  /. -,,s   	B14/C1C	Cc                T  a V P                   pV P                  pVP                  pVP                  pR  pV! R4       V! V! V4      ^ 4       V! R4       V! V! V4      ^ 4       V! R4       ^!^*upoV P	                  \
        4      ;_uu_ 4        V! 4        RRR4       V P	                  \
        4      ;_uu_ 4        V! R4       RRR4       V P                  V! R R7      4       V! V! V4      S4       V! V! V3R lR7      S4       V! V! V3R lR7      V4       V! V! V3R	 lR7      R4       V! R
4       V! V! V4      S4       V! V! V3R lR7      S4       V! V! V3R lR7      V4       V! V! V3R lR7      S4       R#   + '       g   i     L; i  + '       g   i     L; i)c                     R # )Fr   indexs   &r   char_in_string_falseDPyParseTest.test_find_good_parse_start.<locals>.char_in_string_false=   s    r   zdef spam():
k"""This is a module docstring"""
class C:
    def __init__(self, a,
                 b=True):
        pass
NFc                     R # )Tr   rJ   s   &r   <lambda>8PyParseTest.test_find_good_parse_start.<locals>.<lambda>[   s    r   )is_char_in_stringc                    < V S8  # r1   r   rK   poss   &r   rP   rQ   c   	    r   c                    < V S8  # r1   r   rT   s   &r   rP   rQ   f   	    #r   c                    < V S8  # r1   r   rT   s   &r   rP   rQ   i   rV   r   zZ"""This is a module docstring"""
class C:
    def __init__(self, a, b=True):
        pass
c                    < V S8  # r1   r   rT   s   &r   rP   rQ   s   rV   r   c                    < V S8  # r1   r   rT   s   &r   rP   rQ   t   rX   r   c                    < V S8  # r1   r   rT   s   &r   rP   rQ   w   rV   r   zclass spam(  
)r   r   r<   find_good_parse_startr=   	TypeErrorassertIsNone)r   rB   rC   rD   startrL   pos0rU   s   &      @r   test_find_good_parse_start&PyParseTest.test_find_good_parse_start8   s{   KK**''5 	 
5%&* 	&'
5%&* 	 ! 	 	c y))G *y))%L *
 	%2DEF 	5%&, 	5#<=sC 	5#=>E 	5#<=tD 	 ! 	
 	5%&,
5#<=sC
5#=>E 	5#<=sCG *)))s   F:	FF	F'	c                   R p^*pV P                   pVP                  V4       V P                  \        4      ;_uu_ 4        VP	                  ^4       RRR4       VP	                  ^ 4       V P                  VP                  V4       VP	                  V4       V P                  VP                  WR 4       R#   + '       g   i     Ln; i)rN   N)r   r<   r=   r>   set_lor   r@   )r   r@   rU   rC   s   &   r   test_set_loPyParseTest.test_set_loy   s    ! 	 KK	

4 ~..HHQK / 	
& 	
d, /.s   B77C	c                   V P                   pV P                  pVP                  pVP                  p\	        ^4      w  rVrxp	\        R. RO4      p
V
! R^ .V4      V
! R^ ^.V4      V
! R^ ^.V4      V
! R^ ^.V4      V
! R^ ^.V4      V
! R^ ^.V4      V
! R^ ^.V4      V
! R	^ ^.V4      V
! R
^ ^.V4      V
! R^ ^.V4      V
! R. ROV4      V
! R^ ^.V4      V
! R^ ^.V	4      V
! R^ ^.V4      V
! R^ ^.V4      V
! R. ROV4      V
! R. ROV	4      V
! R. ROV	4      V
! R^ ^.V4      V
! R^ ^.V	4      V
! R^ ^.V4      3pV F  pV P                  VP                  R7      ;_uu_ 4        V! VP                  4       V! 4        V! VP                  ^4       V! VP                  VP                  4       V! VP                  VP                  4       RRR4       K  	  V P                  V! 4       4       R#   + '       g   i     K  ; i)   TestInfor:   z$"""This is a complete docstring."""
z$'''This is a complete docstring.'''
z""""This is a continued docstring.
z"'''This is a continued docstring.
z""""Closing quote does not match."
z"""Bracket in docstring [
z#'''Incomplete two line docstring.

z"This is a complete string."
z"This is an incomplete string.
z'This is more incomplete.

z# Comment\
z"("""Complete string in bracket"""
z("""Open string in bracket
a = (1 + 2) - 5 *\
0
   def function1(self, a,
                 b):

   def function1(self, a,\

   def function1(self, a,
())
)(
{)(]
r8   N)r9   	goodlinescontinuation)r         )r   rt      )r   r   r<   _study1ranger   r?   r9   rA   rr   rs   r_   )r   rB   rC   rD   studyNONE	BACKSLASHFIRSTNEXTBRACKETrj   rE   tests   &            r   test_study1PyParseTest.test_study1   s/   KK**		27(/%wj +; < R!d#<q!fdK<q!fdK:QFEJ:QFEJ:QFEJ2QFEB<q!fdK51vtD7!QF4iF_q!fd3:QFGL3aVUC,q!fi@J&6	7K4iIWq!fd+VaVW-X1vt,7< DT[[11$1==!$1;;/1>>4#4#45 21  	%'" 211s   A'G**G;c                   V P                   pV P                  pVP                  pVP                  p\	        ^4      w  rVrxp	\        RRR.4      p
V
! RV4      V
! RV4      V
! RV4      V
! RV4      V
! RV	4      3pV FZ  pV P                  VP                  R	7      ;_uu_ 4        V! VP                  4       V! V! 4       VP                  4       R
R
R
4       K\  	  R
#   + '       g   i     Kq  ; i)ri   rj   r9   rs   r:   z%"""This is a continuation docstring.
z-'''This is a multiline-continued docstring.

rk   rm   r8   N)	r   r   r<   get_continuation_typerx   r   r?   r9   rs   )r   rB   rC   rD   gettyperz   r{   r|   r}   r~   rj   rE   r   s   &            r   test_get_continuation_type&PyParseTest.test_get_continuation_type   s    KK**))27(/%wj8^*DER=uEFM,i86@ DT[[11$79d//0 21 111s   !+CC+c                *   V P                   pV P                  pVP                  pVP                  p\	        R . RO4      pV! R^ ^ RRR4      V! R^ ^0RRR4      V! R^ ^RRR4      V! R^ ^ RRR4      V! R^ ^RRR4      V! R	^^0R
RR4      V! R^^R^R 4      V! R^^R^R 4      V! R^^3R^R!4      V! R^ ^7R^R"4      V! R^ ^RRR#4      V! R^ ^R^R$4      V! R^ ^RRR%4      V! R^ ^RRR4      V! R^ ^ RRR4      3pV F  pV P                  VP                  R7      ;_uu_ 4        V! VP                  4       V! 4        V! VP                  ^4       V! VP                  VP                  4       V! VP                  VP                  4       V! VP                  VP                  4       V! VP                  VP                  4       V! VP                  VP                   4       RRR4       K  	  V P#                  V! 4       4       R#   + '       g   i     EK  ; i)&rj   r:   Nz0'''This is a multiline continuation docstring.

'z # Comment\
z #Comment\
rk   *rl   :rm   ,rn   z3
   def function1(self, a,  # End of line comment.
z7  a = ["first item",
  # Comment line
    "next item",
ro   )rp   (rq   ]z:\a
z\a
r8   )r9   r`   endlastchopenbracket
bracketingr   r   )r   r   rt   )0   r   )r   rt   rt   )   r   )r   r   rt   )   r   )rt   r      rt   ).   r   )r   r   )r   r   )   ru   )3   rt   )r   )   rt   )   ru   )   rt   )   ru   )&   rt   )*   ru   )5   rt   )r   r   ru   r   rv   r   )r   r   r   r   r   r   ru   rt   r   r   )r   r   r<   _study2r   r?   r9   rA   
stmt_startr`   stmt_endr   r   lastopenbracketposr   stmt_bracketingr   r_   )r   rB   rC   rD   ry   rj   rE   r   s   &       r   test_study2PyParseTest.test_study2   sk   KK**		j +H I RAr43IC'@B%B&?A _2tY0 ,C'@B JC'AC 6C%68 4C%68 LC%HJ QC %IJ W3&FHVQ3+CDX3&NP Xq!UD)<T1aT95I%N DT[[11$1==!$1<<,1::txx(188T[[)1'')9)9:1$$doo6 21  	%'" 211s   B>H  Hc                ~   V P                   pV P                  pVP                  pVP                  p\	        R RR.4      pV! R^4      V! R^4      V! R^4      V! R^4      V! R^4      V! R^4      V! R	^4      V! R
^4      3pV! R4       V P                  \        4      ;_uu_ 4        V! 4        RRR4       V FZ  pV P                  VP                  R7      ;_uu_ 4        V! VP                  4       V! V! 4       VP                  4       RRR4       K\  	  R#   + '       g   i     Lr; i  + '       g   i     K  ; i)rj   r9   linesz[x for x in a]
z[x
for x in a
z[x\
for x in a\
z[x
for x in a
]
z%
"""Docstring comment L1"""
L2
L3
L4
z%
"""Docstring comment L1
L2"""
L3
L4
z&
"""Docstring comment L1\
L2\
L3\
L4\
z+

"""Docstring comment L1\
L2\
L3\
L4\
"""
r:   Nr8   )
r   r   r<   get_num_lines_in_stmtr   r=   
IndexErrorr?   r9   r   )r   rB   rC   rD   getlinesrj   rE   r   s   &       r   test_get_num_lines_in_stmt&PyParseTest.test_get_num_lines_in_stmt  s   KK****j8W*=>'+'++Q/*A.A1EA1EFJMqQ	 	z**J + DT[[11$8:tzz* 21  +* 211s   &D+D+D(	+D<c                ,   V P                   pV P                  pVP                  pVP                  p\	        R RR.4      p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      3pV! R4       V P                  \        4      ;_uu_ 4        V! 4        RRR4       V F-  pV! VP                  4       V! V! 4       VP                  4       K/  	  R#   + '       g   i     LE; i)rj   r9   spaceszdef function1(self, a,
z
    def function1(self, a,
z
	def function1(self, a,
z
    def function1(
z
	def function1(
z
    def function1(  
z2[
"first item",
  # Comment line
    "next item",
z4[
  "first item",
  # Comment line
    "next item",
z1["first item",
  # Comment line
    "next item",
z(
z(a
zdef function1(self, a, b):
N)	r   r   r<   compute_bracket_indentr   r=   r>   r9   r   )r   rB   rC   rD   indentrj   rE   r   s   &       r   test_compute_bracket_indent'PyParseTest.test_compute_bracket_indent1  s   KK**))j8X*>?/45r:3R8-q1+Q//3MqQOQRSKQOUAVQ" 	./~..H / DDKK vx%  /.s   >DD	c                `   V P                   pV P                  pVP                  pVP                  pRpV F[  pV P	                  VR7      ;_uu_ 4        V! V4       V P                  \        4      ;_uu_ 4        V! 4        RRR4       RRR4       K]  	  \        RR4      p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      3pV FZ  p	V P	                  V	P                  R7      ;_uu_ 4        V! V	P                  4       V! V! 4       V	P                  4       RRR4       K\  	  R#   + '       g   i     L; i  + '       g   i     EKd  ; i  + '       g   i     K  ; i)def function1(self, a, b\
r8   Nrj   rk   za = 1 + 2 - 5 *\
z    a = 1 + 2 - 5 *\
z  a = "spam"\
z  a = \
"a"\
z  a = #\
"a"\
za == \
za != \
z\
z    \
z	\
za\
z{}\
z(1 + 2) - 5 *\
)r   z    """ (\
za = #\
)r9   r   )
r   r   r<   compute_backslash_indentr?   r=   r>   r   r9   r   )
r   rB   rC   rD   r   errorsr9   rj   rE   r   s
   &         r   test_compute_backslash_indent)PyParseTest.test_compute_backslash_indentQ  s   KK**++ FV,,&&~66H 7 -,  j*>?115/33Q7,a0-q1.2+q)+q)&!$*a((A&'1%(A&-q1  DT[[11$68T[[) 21 ) 76 -,,. 211s0   &F8E4 F;+F4F?FFF-c           
        V P                   pV P                  pVP                  pVP                  p\	        R RR.4      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      3pV FZ  pV P                  VP                  R7      ;_uu_ 4        V! VP                  4       V! V! 4       VP                  4       RRR4       K\  	  R#   + '       g   i     Kq  ; i)rj   r9   r   r:   	def a():
z
	def a():
r   z    def a():
z    z    def a(
z	
    def a(
z	
    # Comment.
r8   N)r   r   r<   get_base_indent_stringr   r?   r9   r   )r   rB   rC   rD   
baseindentrj   rE   r   s   &       r   test_get_base_indent_string'PyParseTest.test_get_base_indent_stringx  s    KK**--
j8X*>?"b!,+.$/*F3.&1,f50&9 DT[[11$:<- 21 111s   "+CC,c                B   V P                   pV P                  pV P                  pVP                  pVP                  p\        R RR.4      pV! RV4      V! RV4      V! RV4      V! RV4      V! RV4      V! RV4      V! R	V4      V! R
V4      V! RV4      V! RV4      V! RV4      V! RV4      3pV FX  pV P                  VP                  R7      ;_uu_ 4        V! VP                  4       VP                  V! 4       4       RRR4       KZ  	  R#   + '       g   i     Ko  ; i)rj   r9   assert_r   rl   z:
za:
z):
z(:
z":
rn   !def function1(self, a):
    pass
z# A comment:
z"""A docstring:
r8   N)	
assertTrueassertFalser   r<   is_block_openerr   r?   r9   r   )	r   yesnorC   rD   openerrj   rE   r   s	   &        r   test_is_block_opener PyParseTest.test_is_block_opener  s   ooKK**""j8Y*?@\3'JCPUC VS!VS!VS!VR 4b9:B?%r*("-("- DT[[11$VX& 21 111s   )DDc                R   V P                   pV P                  pV P                  pVP                  pVP                  p\        R RR.4      pV! RV4      V! RV4      V! RV4      V! RV4      V! RV4      V! RV4      V! R	V4      V! R
V4      V! RV4      V! RV4      V! RV4      V! RV4      V! RV4      3pV FX  pV P                  VP                  R7      ;_uu_ 4        V! VP                  4       VP                  V! 4       4       RRR4       KZ  	  R#   + '       g   i     Ko  ; i)rj   r9   r   zreturn
z	break
z  continue
z     raise
z	pass    
zpass	
z	return #
zraised
z
returning
z	# return
z	"""break
z
"continue
r   r8   N)	r   r   r   r<   is_block_closerr   r?   r9   r   )	r   r   r   rC   rD   closerrj   rE   r   s	   &        r   test_is_block_closer PyParseTest.test_is_block_closer  s   ooKK**""j8Y*?@Z%[#&^S)^S)\3'Z%\3'Z$]B'\2&\2&]B':C@  DT[[11$VX& 21 111s   )DD&c                   V P                   pV P                  pVP                  pVP                  p\	        R RR.4      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      3
pV FZ  pV P                  VP                  R7      ;_uu_ 4        V! VP                  4       V! V! 4       VP                  4       RRR4       K\  	  R#   + '       g   i     Kq  ; i)rj   r9   bracketr:   r;   z()()
z(
)()
z()
()
z()(
)
z(())
z(
())
rq   z(((())
r8   Nr   r   )r   r   r   rv   rt   ri   r   )r   r   r   )r   r   r   r   r   )r   r   rt   ru   r   r   )r   r   )ru   ru   r   r   )r   r   r   )ru   rv   )rv   r   )ri   rv   )r   ru   )r   r   r<   get_last_stmt_bracketingr   r?   r9   r   )r   rB   rC   rD   r   rj   rE   r   s   &       r   test_get_last_stmt_bracketing)PyParseTest.test_get_last_stmt_bracketing  s    KK**//
j8Y*?@R#UI&XGHZ!IJZ!9:Z!IJXGHZ!IJXGHZMO DT[[11$:<. 21 111s   :+C33Dr   N)r   r    r!   r"   classmethodr.   r2   r5   rF   rb   rf   r   r   r   r   r   r   r   r   r   r   r#   r$   r%   s   @r   r(   r(      s|     ? ?  2%$?DB-00#d1*;#z+8&@%*N.*'8':/ /r   r(   __main__)	verbosity)
idlelibr   unittestcollectionsr   TestCaser   r(   r   mainr   r   r   <module>r      sR      "/8$$ / G/(## G/T zMMA r   