
    Æeq                     &   d Z ddlZddlmZmZ  ej
                  d      d        Z ej
                  d      d        Z ej                  dj                   ej                          ej                         g            Z ej                  d      Zy)	zRA module to ease code analysis

This module is here to help source code analysis.
    N)codeanalyzeutils   c                    t        j                  |       }t        |       D ]`  \  }}}| |   dk(  r	d||z
  z  }n3d|j                  dd      j	                         v rd}ndd||z
  dz
  z  z  }|N|j                  |||       b |j                         xs | } t        j                  |       }d	}t        j                  |       D ]V  }|j                         }|j                         }	|	d
v r|dz  }|	dv r|dz  }|	dk(  s;|d	kD  sA|j                  ||dz   d       X |j                         xs | } | j                  dd      j                  dd      j                  dd      S )a7  Simplify `source` for analysis

    It replaces:

    * comments with spaces
    * strs with a new str filled with spaces
    * implicit and explicit continuations with spaces
    * tabs and semicolons with spaces

    The resulting code is a lot easier to analyze if we are interested
    only in offsets.
    # fprefix Nz"%s"   r   z({[   z)}]
z\
z  	;)r   ChangeCollectorignored_regionsgetlower
add_changeget_changed_parensfinditerstartgroupreplace)
source	collectorr   endmatchgroupsreplacementparensmatchics
             4/usr/lib/python3/dist-packages/rope/base/simplify.py	real_coder&   
   sv    ++F3I#26#: :sK%=Cu-KKOOHb17799K C3;?$;<K"  [9: ""$.F++F3IF!!&) 0KKMKKM:aKF:aKF9!  AE3/0 ""$.F>>&$'//c:BB3MM    c                     t         j                  |       D cg c]1  }|j                         |j                         |j	                         f3 c}S c c}w )z<Return ignored regions like strings and comments in `source`)_strr   r   r   	groupdict)r   r"   s     r%   r   r   2   sG    
 ]]6* 
		U__%67  s   6A|z[\({\[\]}\)\n])__doc__re	rope.baser   r   cachedr&   r   compilejoinget_comment_patternget_any_string_patternr)   r    r'   r%   <module>r5      s    
 ( a$N $NN a  rzzHH+K++-.K..0	
 "**&
'r'   