;
Ñâ"Ic               @   su  d  d l  Z  d  d l Z e d ƒ \ Z Z Z Z Z e  j d e  j	 e  j
 Bƒ j Z e  j d e  j	 ƒ j Z e  j d e  j	 e  j Bƒ j Z e  j d e  j	 ƒ j Z e  j d e  j	 ƒ j Z e  j d e  j	 ƒ j Z i  Z x e d	 ƒ D] Z d
 e e <qä Wx d D] Z d e e e ƒ <qÿ Wx d D] Z d e e e ƒ <q Wx d D] Z e e e e ƒ <qAW[ [ Gd „  d ƒ Z d S(   i    Ni   uä   
    ^
    [ \t]*
    (?: while
    |   else
    |   def
    |   return
    |   assert
    |   break
    |   class
    |   continue
    |   elif
    |   try
    |   except
    |   raise
    |   import
    |   yield
    )
    \b
u'   
    [ \t]*
    (?: \# \S .* )?
    \n
uK  
    \""" [^"\\]* (?:
                     (?: \\. | "(?!"") )
                     [^"\\]*
                 )*
    (?: \""" )?

|   " [^"\\\n]* (?: \\. [^"\\\n]* )* "?

|   ''' [^'\\]* (?:
                   (?: \\. | '(?!'') )
                   [^'\\]*
                )*
    (?: ''' )?

|   ' [^'\\\n]* (?: \\. [^'\\\n]* )* '?
uM   
    [ \t]*
    [^\s#\\]    # if we match, m.end()-1 is the interesting char
u_   
    \s*
    (?: return
    |   break
    |   continue
    |   raise
    |   pass
    )
    \b
u   
    [^[\](){}#'"\\]+
i   u   xu   ({[u   (u   )}]u   )u   "'\
#c             B   s§   |  Ee  Z d  „  Z d „  Z d e d „ Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d Z d „  Z d Z d „  Z d S(   c             C   s   | |  _  | |  _ d  S(   N(   u   indentwidthu   tabwidth(   u   selfu   indentwidthu   tabwidth(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   __init__n   s    	c             C   s·   t  | ƒ d k p | d d k p t ‚ t | t ƒ of | } g  } | j } x; t t | ƒ D]* } | | d k  o t | ƒ p d ƒ q` Wd j | ƒ } n | |  _ d |  _	 d  S(   Ni    iÿÿÿÿu   
i   u   xu    (
   u   lenu   AssertionErroru
   isinstanceu   stru   appendu   mapu   ordu   chru   joinu   study_level(   u   selfu   su	   uniphooeyu   pushu   raw(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   set_strr   s    +	 (	c       
      C   sd  |  j  d  } } | p d  St | ƒ } x˜ t d ƒ D]Š } | j d d | ƒ } | d k  o Pn | j d d | ƒ d } | | | | ƒ } | o% | | j ƒ  ƒ o | j ƒ  } Pn | } q5 W| d  k o< | | ƒ } | o$ | | j ƒ  ƒ o | j ƒ  } n | S| d } xG | | | ƒ } | o- | j ƒ  \ }	 } | |	 ƒ p
 |	 } q]qPq| S(   Ni   u   :
i    u   
i   (   u   stru   Noneu   lenu   rangeu   rfindu   startu   span(
   u   selfu   is_char_in_stringu   _synchreu   stru   posu   limitu   triesu   iu   mu   s(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   find_good_parse_start   s:     
	
c             C   sW   | d k p |  j  | d d k p t ‚ | d k o |  j  | d  … |  _  n d  S(   Ni    i   u   
(   u   stru   AssertionError(   u   selfu   lo(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   set_loÃ   s    ,c             C   sP  |  j  d k o d  Sd |  _  |  j } | j t ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } t } d } } d g |  _ } | j } d t | ƒ } } x | | k  oò| | }	 | d } |	 d k o qÏ n |	 d k o, | d } | d k o | | ƒ qÏ qÏ n |	 d	 k o | d } qÏ n |	 d
 k o | o | d } qÏ qÏ n |	 d k p |	 d k o†|	 }
 | | d | d … |
 d k o |
 d }
 n | } t |
 ƒ d } | | } x%| | k  oö | | }	 | d } |	 d k o qøn | | d | | … |
 k o | | } Pn |	 d k o> | d } | d k o  | d k o | | ƒ n Pqøqøn |	 d k oD | | k  p t	 ‚ | | d k o | d } n | d } qøqøqøW| d | k o
 t
 } qÏ t } qÏ n |	 d k o- | j d | ƒ } | d k p t	 ‚ qÏ n |	 d k p t	 ‚ | | k  p t	 ‚ | | d k o) | d } | d | k o
 t } qÀn | d } qÏ W| t
 k o$ | t k o | d k o
 t } n | |  _ | t k | d | k k p t	 ‚ | d | k o | | ƒ n d  S(   Ni   u   xxxxxxxxu   xu   xxxxu   xxu   
xu   
i    u   (u   )u   "u   'i   i   u   \u   #iÿÿÿÿ(   u   study_levelu   stru	   translateu   _tranu   replaceu   C_NONEu	   goodlinesu   appendu   lenu   AssertionErroru   C_STRING_FIRST_LINEu   C_STRING_NEXT_LINESu   findu   C_BACKSLASHu	   C_BRACKETu   continuation(   u   selfu   stru   continuationu   levelu   lnou	   goodlinesu	   push_goodu   iu   nu   chu   quoteu   firstlnou   w(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   _study1Ì   s¨    		
	 



#
 







	$c             C   s   |  j  ƒ  |  j S(   N(   u   _study1u   continuation(   u   self(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   get_continuation_typeL  s    
c             C   s  |  j  d k o d  S|  j ƒ  d |  _  |  j |  j } } t | ƒ d } t | ƒ } x‚ | oz | p t ‚ | } x@ t | | d | | ƒ D]# } | j d d | d ƒ d } q‘ Wt | | ƒ o | d } qZ PqZ W| d k o | d k p t ‚ | } n | | |  _	 |  _
 d } g  } | j }	 | d f g }
 x“| | k  o…t | | | ƒ } | o} | j ƒ  } | d } x- | | k o | | d k o | d } q€W| | k o | | } n | } | | k o Pqän | | } | d k o: |	 | ƒ |
 j | t | ƒ f ƒ | } | d } qAn | d k oB | o | d	 =n | } | d } |
 j | t | ƒ f ƒ qAn | d
 k p | d k o[ |
 j | t | ƒ d f ƒ | } t | | | ƒ j ƒ  } |
 j | t | ƒ f ƒ qAn | d k oj |
 j | t | ƒ d f ƒ | j d | | ƒ d } | d k p t ‚ |
 j | t | ƒ f ƒ qAn | d k p t ‚ | d } | | k  p t ‚ | | d k o | | | } n | d } qAW| |  _ | o | d	 |  _ n t |
 ƒ |  _ d  S(   Ni   i   u   
i    u    u    	
u   ([{u   )]}iÿÿÿÿu   "u   'u   #u   \(   u   study_levelu   _study1u   stru	   goodlinesu   lenu   AssertionErroru   rangeu   rfindu   _junkreu
   stmt_startu   stmt_endu   appendu   _chew_ordinaryreu   endu   _match_stringreu   findu   lastchu   lastopenbracketposu   tupleu   stmt_bracketing(   u   selfu   stru	   goodlinesu   iu   pu   qu   nothingu   lastchu   stacku
   push_stacku
   bracketingu   mu   newpu   ch(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   _study2a  s–    
	  !
	 
 	




	c             C   s   |  j  ƒ  |  j t k p t ‚ |  j } |  j } t | ƒ } | j d d | ƒ d } } | d } x“ | | k  oO t | | ƒ } | o | j	 ƒ  d } d } Pqi | j
 d | ƒ d } } qi W| } } x  | | d k o | d } qÓ W|  j } t | | | … j |  j ƒ ƒ | S(   Nu   
i    i   u    	(   u   _study2u   continuationu	   C_BRACKETu   AssertionErroru   lastopenbracketposu   stru   lenu   rfindu   _itemreu   endu   findu   indentwidthu
   expandtabsu   tabwidth(   u   selfu   ju   stru   nu   origiu   iu   mu   extra(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   compute_bracket_indentÎ  s*    
		
 
 	c             C   s#   |  j  ƒ  |  j } | d | d S(   Niÿÿÿÿiþÿÿÿ(   u   _study1u	   goodlines(   u   selfu	   goodlines(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   get_num_lines_in_stmtí  s    
	c             C   s0  |  j  ƒ  |  j t k p t ‚ |  j } |  j } x  | | d k o | d } q6 W| } | j d | ƒ d } d } } x| | k  o| | } | d k o | d } | d } q | d k o# | o | d } n | d } q | d k p | d k o t | | | ƒ j ƒ  } q | d	 k o Pq | d k oO | d
 k oB | d k p | | d d k o  | | d d
 k o d } Pq | d } q W| o0 | d } t	 j
 d | | | … ƒ d  k } n | p- | } x$ | | d k o | d } qåWn t | |  j | … j |  j ƒ ƒ d S(   Nu    	i   u   
i    u   ([{u   )]}u   "u   'u   #u   =u   =<>!u   \s*\\u    	
(   u   _study2u   continuationu   C_BACKSLASHu   AssertionErroru   stru
   stmt_startu   findu   _match_stringreu   endu   reu   matchu   Noneu   lenu
   expandtabsu   tabwidth(   u   selfu   stru   iu   startposu   endposu   foundu   levelu   ch(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   compute_backslash_indentö  sP    
		 
 

"
& c             C   sj   |  j  ƒ  |  j |  j } } | } |  j } x- | | k  o | | d k o | d } q/ W| | | … S(   Nu    	i   (   u   _study2u
   stmt_startu   stmt_endu   str(   u   selfu   iu   nu   ju   str(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   get_base_indent_string+  s    
	 c             C   s   |  j  ƒ  |  j d k S(   Nu   :(   u   _study2u   lastch(   u   self(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   is_block_opener6  s    
c             C   s#   |  j  ƒ  t |  j |  j ƒ d  k	 S(   N(   u   _study2u   _closereu   stru
   stmt_startu   None(   u   self(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   is_block_closer<  s    
c             C   s   |  j  ƒ  |  j S(   N(   u   _study2u   lastopenbracketpos(   u   self(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   get_last_open_bracket_posC  s    
c             C   s   |  j  ƒ  |  j S(   N(   u   _study2u   stmt_bracketing(   u   self(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   get_last_stmt_bracketingL  s    
N(   u   __name__u
   __module__u   __init__u   set_stru   Noneu   _synchreu   find_good_parse_startu   set_lou   _study1u   get_continuation_typeu   _study2u   compute_bracket_indentu   get_num_lines_in_stmtu   compute_backslash_indentu   get_base_indent_stringu   is_block_openeru   is_block_closeru   lastopenbracketposu   get_last_open_bracket_posu   stmt_bracketingu   get_last_stmt_bracketing(   u
   __locals__(    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   Parserl   s$   
		3			€		m				5				u   Parser(   u   reu   sysu   rangeu   C_NONEu   C_BACKSLASHu   C_STRING_FIRST_LINEu   C_STRING_NEXT_LINESu	   C_BRACKETu   compileu   VERBOSEu	   MULTILINEu   searchu   _synchreu   matchu   _junkreu   DOTALLu   _match_stringreu   _itemreu   _closereu   _chew_ordinaryreu   _tranu   iu   chu   ordu   Parser(    (    (    u,   /mit/python/lib/python3.0/idlelib/PyParse.pyu   <module>   s:   	    