<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
ž
©ÿfã  c               @   s^   d  Z  d d l m Z d d l m Z i d d 6d d 6d d	 6Z d
 Z Gd d „  d ƒ Z d S(   uò   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.
i    (   u   HyperParser(   u   idleConfu   (u   )u   [u   ]u   {u   }id   c             B   sL  |  Ee  Z d  Z d Z d d1 g f g Z e j d d  d d d ƒZ e j d d  d	 d
 d d d ƒZ e j	 e j
 ƒ  d ƒ Z e j d d  d d
 d d d ƒZ d Z d2 Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d  d! „  Z d0 d" d# „ Z d$ d% „  Z d& d' „  Z d( d) „  Z d* d+ „  Z d, d- „  Z d. d/ „  Z d0 S(3   u
   ParenMatchu¤  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.
    u   editu   Show surrounding parensu   <<flash-paren>>u
   extensionsu   styleu   defaultu
   expressionu   flash-delayu   typeu   intiô  u   hiliteu   bellu   booli   u   <<parenmatch-check-restore>>u
   <KeyPress>u   <ButtonPress>u   <Key-Return>u   <Key-BackSpace>c             C   sT   | |  _  | j |  _ | j j |  j |  j ƒ d |  _ d |  _ |  j |  j ƒ d  S(   Ni    (	   u   editwinu   textu   bindu   RESTORE_VIRTUAL_EVENT_NAMEu   restore_eventu   counteru   is_restore_activeu	   set_styleu   STYLE(   u   selfu   editwin(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   __init__;   s    	
		u   ParenMatch.__init__c             C   sC   |  j  s? x' |  j D] } |  j j |  j | ƒ q Wd |  _  n  d  S(   NT(   u   is_restore_activeu   RESTORE_SEQUENCESu   textu	   event_addu   RESTORE_VIRTUAL_EVENT_NAMEu   True(   u   selfu   seq(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   activate_restoreG   s    	u   ParenMatch.activate_restorec             C   sC   |  j  r? x' |  j D] } |  j j |  j | ƒ q Wd |  _  n  d  S(   NF(   u   is_restore_activeu   RESTORE_SEQUENCESu   textu   event_deleteu   RESTORE_VIRTUAL_EVENT_NAMEu   False(   u   selfu   seq(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   deactivate_restoreM   s    	u   ParenMatch.deactivate_restorec             C   s[   | |  _  | d k r0 |  j |  _ |  j |  _ n' | d k rW |  j |  _ |  j |  _ n  d  S(   Nu   defaultu
   expression(   u   STYLEu   create_tag_defaultu
   create_tagu   set_timeout_lastu   set_timeoutu   create_tag_expressionu   set_timeout_none(   u   selfu   style(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu	   set_styleS   s    	u   ParenMatch.set_stylec             C   sW   t  |  j d ƒ j ƒ  } | d  k r2 |  j ƒ  d  S|  j ƒ  |  j | ƒ |  j ƒ  d  S(   Nu   insert(   u   HyperParseru   editwinu   get_surrounding_bracketsu   Noneu   warn_mismatchedu   activate_restoreu
   create_tagu   set_timeout_last(   u   selfu   eventu   indices(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   flash_paren_event\   s    

u   ParenMatch.flash_paren_eventc             C   s™   |  j  j d ƒ } | t k r" d  St |  j d ƒ } | j ƒ  sD d  S| j t | d ƒ } | d  k rt |  j	 ƒ  d  S|  j
 ƒ  |  j | ƒ |  j ƒ  d  S(   Nu	   insert-1cT(   u   textu   getu   _openersu   HyperParseru   editwinu
   is_in_codeu   get_surrounding_bracketsu   Trueu   Noneu   warn_mismatchedu   activate_restoreu
   create_tagu   set_timeout(   u   selfu   eventu   closeru   hpu   indices(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   paren_closed_evente   s    

u   ParenMatch.paren_closed_eventc             C   s-   |  j  j d ƒ |  j ƒ  |  j d 7_ d  S(   Nu   pareni   (   u   textu
   tag_deleteu   deactivate_restoreu   counter(   u   selfu   event(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   restore_eventu   s    
u   ParenMatch.restore_eventc             C   s    | |  j  k r |  j ƒ  n  d  S(   N(   u   counteru   restore_event(   u   selfu   timer_count(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   handle_restore_timerz   s    u   ParenMatch.handle_restore_timerc             C   s   |  j  r |  j j ƒ  n  d  S(   N(   u   BELLu   textu   bell(   u   self(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   warn_mismatched~   s    	u   ParenMatch.warn_mismatchedc             C   s1   |  j  j d | d ƒ |  j  j d |  j ƒ d S(   u'   Highlight the single paren that matchesu   pareni    N(   u   textu   tag_addu
   tag_configu   HILITE_CONFIG(   u   selfu   indices(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   create_tag_default…   s    u   ParenMatch.create_tag_defaultc             C   sk   |  j  j | d ƒ d	 k r- | d d } n
 | d } |  j  j d | d | ƒ |  j  j d |  j ƒ d S(
   u   Highlight the entire expressioni   u   )u   ]u   }u   +1cu   pareni    N(   u   )u   ]u   }(   u   textu   getu   tag_addu
   tag_configu   HILITE_CONFIG(   u   selfu   indicesu
   rightindex(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   create_tag_expressionŠ   s
    
u    ParenMatch.create_tag_expressionc             C   sP   |  j  d 7_  |  |  j  |  j j d ƒ d d „ } |  j j j t | | ƒ d S(   uS   Highlight will remain until user input turns it off
        or the insert has movedi   u   insertc             S   sE   | | j  j d ƒ k r( | j | ƒ n | j j j t |  |  ƒ d  S(   Nu   insert(   u   textu   indexu   handle_restore_timeru   editwinu
   text_frameu   afteru   CHECK_DELAY(   u   callmeu   selfu   cu   index(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   callme   s    u+   ParenMatch.set_timeout_none.<locals>.callmeN(   u   counteru   textu   indexu   editwinu
   text_frameu   afteru   CHECK_DELAY(   u   selfu   callme(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   set_timeout_none–   s    	u   ParenMatch.set_timeout_nonec             C   s;   |  j  d 7_  |  j j j |  j |  |  j  d d „ ƒ d S(   u7   The last highlight created will be removed after .5 seci   c             S   s   |  j  | ƒ S(   N(   u   handle_restore_timer(   u   selfu   c(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   <lambda>«   s    u-   ParenMatch.set_timeout_last.<locals>.<lambda>N(   u   counteru   editwinu
   text_frameu   afteru   FLASH_DELAY(   u   self(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   set_timeout_last¥   s    u   ParenMatch.set_timeout_lastN(   u   Show surrounding parensu   <<flash-paren>>(   u
   <KeyPress>u   <ButtonPress>u   <Key-Return>u   <Key-BackSpace>(   u   __name__u
   __module__u   __qualname__u   __doc__u   menudefsu   idleConfu	   GetOptionu   STYLEu   FLASH_DELAYu   GetHighlightu   CurrentThemeu   HILITE_CONFIGu   BELLu   RESTORE_VIRTUAL_EVENT_NAMEu   RESTORE_SEQUENCESu   __init__u   activate_restoreu   deactivate_restoreu	   set_styleu   flash_paren_eventu   paren_closed_eventu   Noneu   restore_eventu   handle_restore_timeru   warn_mismatchedu   create_tag_defaultu   create_tag_expressionu   set_timeout_noneu   set_timeout_last(   u
   __locals__(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu
   ParenMatch   s4   	 		u
   ParenMatchN(   u   __doc__u   idlelib.HyperParseru   HyperParseru   idlelib.configHandleru   idleConfu   _openersu   CHECK_DELAYu
   ParenMatch(    (    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   <module>   s
   