a  ze$@sbddlmZddlmZddddZdZGdd d Zeed kr^dd l m Z e d d ddS)) HyperParser)idleConf([{)]}dc@seZdZdZdZddZeddZddZd d Z d d Z d dZ ddZ d!ddZ ddZddZddZddZeeeedZddZdd ZdS)" ParenMatchz<>)z z z zcCs0||_|j|_|j|j|jd|_d|_dS)Nr)editwintextbindRESTORE_VIRTUAL_EVENT_NAME restore_eventcounteris_restore_active)selfr rF/opt/bitninja-python-dojo/embedded/lib/python3.9/idlelib/parenmatch.py__init__(s zParenMatch.__init__cCsVtjddddd|_tjdddddd |_tjddd d d d |_ttd |_dS)N extensionsr styleopener)defaultz flash-delayinti)typerbellboolZhilite)rZ GetOptionSTYLE FLASH_DELAYBELLZ GetHighlightZ CurrentTheme HILITE_CONFIG)clsrrrreload3s   zParenMatch.reloadcCs,|js(|jD]}|j|j|q d|_dS)NT)rRESTORE_SEQUENCESrZ event_addrrseqrrractivate_restore>s zParenMatch.activate_restorecCs,|jr(|jD]}|j|j|q d|_dS)NF)rr'rZ event_deleterr(rrrdeactivate_restoreEs zParenMatch.deactivate_restorecCst|jd}||dS)Ninsertbreak)rr get_surrounding_bracketsfinish_paren_event)reventindicesrrrflash_paren_eventLs zParenMatch.flash_paren_eventcCsN|jd}|tvrdSt|jd}|s0dS|t|d}||dS)Nz insert-1cT)rget_openersrr Z is_in_coder.r/)rr0ZcloserZhpr1rrrparen_closed_eventSs   zParenMatch.paren_closed_eventcCsT|dur|jr|jdS||j|j|j|||jrH|j n|j dSN) r#rrr*tagfuncsr3r!create_tag_expressionr"set_timeout_lastset_timeout_nonerr1rrrr/`s  zParenMatch.finish_paren_eventNcCs&|jd||jd7_dS)Nparenr )rZ tag_deleter+r)rr0rrrrks zParenMatch.restore_eventcCs||jkr|dSr6)rr)rZ timer_countrrrhandle_restore_timerqs zParenMatch.handle_restore_timercCs&|jd|d|jd|jdS)Nr<r)rtag_add tag_configr$r;rrrcreate_tag_openerxszParenMatch.create_tag_openercCsb|j|ddvr"|dd}n|d}|jd|d|dd|d||jd|jdS)Nr r+1cr<rz-1crr3r>r?r$rr1Z rightindexrrrcreate_tag_parens}s $zParenMatch.create_tag_parenscCsR|j|ddvr"|dd}n|d}|jd|d||jd|jdS)Nr rrAr<rrBrCrrrr8s z ParenMatch.create_tag_expression)rrZparensZ expressioncCs>|jd7_||j|jdfdd}|jjt||dS)Nr r,cSs2||jdkr||n|jjt||dS)Nr,)rindexr=r text_frameafter CHECK_DELAY)callmercrErrrrIs z+ParenMatch.set_timeout_none..callme)rrrEr rFrGrH)rrIrrrr:s  zParenMatch.set_timeout_nonecCs0|jd7_|jj|j||jfdddS)Nr cSs ||Sr6)r=)rrJrrrz-ParenMatch.set_timeout_last..)rr rFrGr")rrrrr9s zParenMatch.set_timeout_last)N)__name__ __module__ __qualname__rr'r classmethodr&r*r+r2r5r/rr=r@rDr8r7r:r9rrrrr s,       r __main__)mainz!idlelib.idle_test.test_parenmatch) verbosityN) Zidlelib.hyperparserrZidlelib.configrr4rHr r&rMZunittestrRrrrrs   &