HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/idlelib/__pycache__/ParenMatch.cpython-35.pyc


Füƒa:ã@s†dZddlmZddlmZdddddd	iZd
ZGdd„dƒZed
kr‚ddl	Z	e	j
dddƒdS)zòParenMatch -- An IDLE extension 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ú)ú(ú]ú[ú}ú{édc@sHeZdZdZdd1gfgZejdddddƒZejddd	d
dddƒZej	ej
ƒd
ƒZejdddd
dddƒZdZ
d2Zdd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd"S)3Ú
ParenMatcha¤Highlight matching parentheses

    There are three supported style of paren matching, based loosely
    on the Emacs options.  The style is select based on the
    HILITE_STYLE attribute; it can be changed used the set_style
    method.

    The supported styles are:

    default -- When a right paren is typed, highlight the matching
        left paren for 1/2 sec.

    expression -- When a right paren is typed, highlight the entire
        expression from the left paren to the right paren.

    TODO:
        - extend IDLE with configuration dialog to change options
        - implement rest of Emacs highlight styles (see below)
        - print mismatch warning in IDLE status window

    Note: In Emacs, there are several styles of highlight where the
    matching paren is highlighted whenever the cursor is immediately
    to the right of a right paren.  I don't know how to do that in Tk,
    so I haven't bothered.
    ZeditúShow surrounding parensú<<flash-paren>>Ú
extensionsÚstyleÚdefaultÚ
expressionzflash-delayÚtypeÚintiôZhiliteÚbellÚbooléz<<parenmatch-check-restore>>ú
<KeyPress>ú
<ButtonPress>ú<Key-Return>ú<Key-BackSpace>cCsT||_|j|_|jj|j|jƒd|_d|_|j|jƒdS)Nr)	ÚeditwinÚtextZbindÚRESTORE_VIRTUAL_EVENT_NAMEÚ
restore_eventÚcounterÚis_restore_activeÚ	set_styleÚSTYLE)Úselfr©r$ú(/usr/lib/python3.5/idlelib/ParenMatch.pyÚ__init__;s	
		zParenMatch.__init__cCs@|js<x'|jD]}|jj|j|ƒqWd|_dS)NT)r ÚRESTORE_SEQUENCESrZ	event_addr)r#Úseqr$r$r%Úactivate_restoreGs	zParenMatch.activate_restorecCs@|jr<x'|jD]}|jj|j|ƒqWd|_dS)NF)r r'rZevent_deleter)r#r(r$r$r%Údeactivate_restoreMs	zParenMatch.deactivate_restorecCsX||_|dkr0|j|_|j|_n$|dkrT|j|_|j|_dS)Nrr)r"Úcreate_tag_defaultÚ
create_tagÚset_timeout_lastÚset_timeoutÚcreate_tag_expressionÚset_timeout_none)r#rr$r$r%r!Ss	zParenMatch.set_stylecCsWt|jdƒjƒ}|dkr2|jƒdS|jƒ|j|ƒ|jƒdS)NÚinsert)rrÚget_surrounding_bracketsÚwarn_mismatchedr)r,r-)r#ÚeventÚindicesr$r$r%Úflash_paren_event\s


zParenMatch.flash_paren_eventcCs™|jjdƒ}|tkr"dSt|jdƒ}|jƒsDdS|jt|dƒ}|dkrt|jƒdS|jƒ|j	|ƒ|j
ƒdS)Nz	insert-1cT)rÚgetÚ_openersrrZ
is_in_coder2r3r)r,r.)r#r4ZcloserZhpr5r$r$r%Úparen_closed_eventfs


zParenMatch.paren_closed_eventNcCs-|jjdƒ|jƒ|jd7_dS)NÚparenr)rZ
tag_deleter*r)r#r4r$r$r%rvs
zParenMatch.restore_eventcCs||jkr|jƒdS)N)rr)r#Ztimer_countr$r$r%Úhandle_restore_timer{szParenMatch.handle_restore_timercCs|jr|jjƒdS)N)ÚBELLrr)r#r$r$r%r3s	zParenMatch.warn_mismatchedcCs1|jjd|dƒ|jjd|jƒdS)z'Highlight the single paren that matchesr:rN)rÚtag_addÚ
tag_configÚ
HILITE_CONFIG)r#r5r$r$r%r+†szParenMatch.create_tag_defaultcCsk|jj|dƒd	kr-|dd}n
|d}|jjd|d|ƒ|jjd|jƒdS)
zHighlight the entire expressionrrrrz+1cr:rN)rrr)rr7r=r>r?)r#r5Z
rightindexr$r$r%r/‹s

z ParenMatch.create_tag_expressioncCsP|jd7_||j|jjdƒdd„}|jjjt||ƒdS)zSHighlight will remain until user input turns it off
        or the insert has movedrr1cSsE||jjdƒkr(|j|ƒn|jjjt||ƒdS)Nr1)rÚindexr;rÚ
text_frameÚafterÚCHECK_DELAY)Úcallmer#Úcr@r$r$r%rDžsz+ParenMatch.set_timeout_none.<locals>.callmeN)rrr@rrArBrC)r#rDr$r$r%r0—s	zParenMatch.set_timeout_nonecCs;|jd7_|jjj|j||jdd„ƒdS)z7The last highlight created will be removed after .5 secrcSs
|j|ƒS)N)r;)r#rEr$r$r%Ú<lambda>­sz-ParenMatch.set_timeout_last.<locals>.<lambda>N)rrrArBÚFLASH_DELAY)r#r$r$r%r-¦szParenMatch.set_timeout_last)rr
)rrrr)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ZmenudefsrZ	GetOptionr"rGZGetHighlightZCurrentThemer?r<rr'r&r)r*r!r6r9rr;r3r+r/r0r-r$r$r$r%rs4		
rÚ__main__Nz!idlelib.idle_test.test_parenmatchÚ	verbosityé)rKZidlelib.HyperParserrZidlelib.configHandlerrr8rCrrHZunittestÚmainr$r$r$r%Ú<module>s¢