python (3.11.7)

(root)/
lib/
python3.11/
idlelib/
__pycache__/
parenmatch.cpython-311.opt-1.pyc

e$dZddlmZddlmZddddZdZGd	d
Zee	dkrddl
mZed
ddSdS)zParenMatch -- for parenthesis matching.

When you hit a right paren, the cursor should move briefly to the left
paren.  Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
)HyperParser)idleConf([{)]}dceZdZdZdZdZdZedZdZ	dZ
dZd	Zd
Z
ddZd
ZdZdZdZeeeedZdZdZdS)
ParenMatcha'Highlight matching openers and closers, (), [], and {}.

    There are three supported styles of paren matching.  When a right
    paren (opener) is typed:

    opener -- highlight the matching left paren (closer);
    parens -- highlight the left and right parens (opener and closer);
    expression -- highlight the entire expression from opener to closer.
    (For back compatibility, 'default' is a synonym for 'opener').

    Flash-delay is the maximum milliseconds the highlighting remains.
    Any cursor movement (key press or click) before that removes the
    highlight.  If flash-delay is 0, there is no maximum.

    TODO:
    - Augment bell() with mismatch warning in status window.
    - Highlight when cursor is moved to the right of a closer.
      This might be too expensive to check.
    z<<parenmatch-check-restore>>)z
<KeyPress>z
<ButtonPress>z<Key-Return>z<Key-BackSpace>c||_|j|_|j|j|jd|_d|_dS)Nr)editwintextbindRESTORE_VIRTUAL_EVENT_NAME
restore_eventcounteris_restore_active)selfrs  F/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/idlelib/parenmatch.py__init__zParenMatch.__init__(sNL		$9,	.	.	.!"ctjdddd|_tjddddd	|_tjddd
dd	|_tjtjd
|_dS)N
extensionsrstyleopener)defaultzflash-delayinti)typerbellboolhilite)r	GetOptionSTYLEFLASH_DELAYBELLGetHighlightCurrentTheme
HILITE_CONFIG)clss rreloadzParenMatch.reload3s&gxAAA	",\-eCQQQ%\&vqJJJ$1(2G2I2I2:<<rcz|js3|jD]"}|j|j|#d|_dSdS)z5Activate mechanism to restore text from highlighting.TN)rRESTORE_SEQUENCESr	event_addrrseqs  ractivate_restorezParenMatch.activate_restore>sW%	*-
J
J	##D$CSIIII%)D"""	*	*rcz|jr3|jD]"}|j|j|#d|_dSdS)zRemove restore event bindings.FN)rr0revent_deleterr2s  rdeactivate_restorezParenMatch.deactivate_restoreEsW!	+-
M
M	&&t'FLLLL%*D"""	+	+rc~t|jd}||dS)zAHandle editor 'show surrounding parens' event (menu or shortcut).insertbreak)rrget_surrounding_bracketsfinish_paren_event)reventindicess   rflash_paren_eventzParenMatch.flash_paren_eventLs;t|X66,,..	(((wrc|jd}|tvrdSt|jd}|sdS|t|d}||dS)zHandle user input of closer.z	insert-1cNT)rget_openersrr
is_in_coder;r<)rr=closerhpr>s     rparen_closed_eventzParenMatch.paren_closed_eventSs{++!!F
{
3
3}}	F--hv.>EE(((rc|"|jr|jdS||j|j|j|||jr|j	n|j
dSN)r)rr"r4tagfuncsrAr'create_tag_expressionr(set_timeout_lastset_timeout_nonerr>s  rr<zParenMatch.finish_paren_event`s?ty?INNFA
$*d&@AA$PPP
2$"2
2		 1	5	5	5	5	5rNc|jd||xjdz
c_dS)zRemove effect of doing match.parenr$N)r
tag_deleter7r)rr=s  rrzParenMatch.restore_eventks>	W%%%!!!rcH||jkr|dSdSrH)rr)rtimer_counts  rhandle_restore_timerzParenMatch.handle_restore_timerqs/$,&&     '&rc|jd|d|jd|jdS)z'Highlight the single paren that matchesrOrN)rtag_add
tag_configr,rMs  rcreate_tag_openerzParenMatch.create_tag_openerxs?	'71:...	Wd&899999rc|j|ddvr|ddz}n|d}|jd|d|ddz|dz||jd|jdS)z#Highlight the left and right parensr$r+1crOrz-1cNrrArUrVr,rr>
rightindexs   rcreate_tag_parenszParenMatch.create_tag_parens}s9==$$77 E)JJ J	'71:wqz%/?EAQS]^^^	Wd&899999rc|j|ddvr|ddz}n|d}|jd|d||jd|jdS)zHighlight the entire expressionr$rrYrOrNrZr[s   rrJz ParenMatch.create_tag_expressionsw9==$$77 E)JJ J	'71:z:::	Wd&899999r)rrparens
expressionc|xjdz
c_||j|jdfd}|jjt||dS)zSHighlight will remain until user input turns it off
        or the insert has movedr$r9c||jdkr||dS|jjt||dS)Nr9)rindexrSr
text_frameafterCHECK_DELAY)callmercrcs    rrgz+ParenMatch.set_timeout_none.<locals>.callmesX	1111))!,,,,,'--k66JJJJJrN)rrrcrrdrerf)rrgs  rrLzParenMatch.set_timeout_nonesi	
 $22	K	K	K	K	
%%k66BBBBBrc|xjdz
c_|jj|j||jfddS)zFThe last highlight created will be removed after FLASH_DELAY millisecsr$c,||SrH)rS)rrhs  r<lambda>z-ParenMatch.set_timeout_last.<locals>.<lambda>sd.G.G.J.JrN)rrrdrer()rs rrKzParenMatch.set_timeout_lastsV	
%%JJJ	L	L	L	L	LrrH)__name__
__module____qualname____doc__rr0rclassmethodr.r4r7r?rFr<rrSrWr]rJrIrLrKrrrr
s4("@<	#	#	#<<[<***+++	5	5	5!!!:::
::::::$$#+	

H
C
C
CLLLLLrr__main__)mainz!idlelib.idle_test.test_parenmatch)	verbosityN)roidlelib.hyperparserridlelib.configrrBrfrr.rlunittestrsrqrr<module>rys,+++++######$$bLbLbLbLbLbLbLbLJzD	,::::::r