B
    b_                 @   s   d Z dZddlZdddZdS )zparse.py is a utility that allows simple checking for line continuations
to give the shell information about where text is commented and where it is
not and also how to appropriately break up a sequence of commands into
separate multi-line commands...
z.David N. Mashburn <david.n.mashburn@gmail.com>    NFc             C   s  d d }g }dg}ddddg}ddd	g}d
ddg}d
ddd}g }	g }
g }g }d}d}xjt | dD ]V\}}t|t|  }|dkr|
d p|	d p|d }| dkrd}n~| d dkrd}nhd}|r||d krd}|| nD|rn>|s(||kr(x,||d k r$|  q
W n|s6d|gS td|	  }|dkrZd}nd}d}t|}t
d|}x|D ]}|	 }|d kr|dkrd}| }P nb||kr|}nR|g kr||kr||d  |kr|  n|sd|gS ||kr|| n||kr|d }q|W |	|d k |d |d |  }|dkr~|	d dkr~|d dkr~d|d< d}|
d t|dkr|s|d dkrd|
d< ||g k qhW |	d s|d s|
d s|d r|sd|gS |r|sd|gS |	||
|fS )Nz Test 4 different types of continuations: String Continuations (ie with ''') Indentation Block Continuations (ie "if 1:" ) Line Continuations (ie with \ character ) Parenthetical continuations (, [, or {r   z"""z'''"'([{)]})r   r   r   F
 T#zInvalid Indentation Errorz *\w*)
ifelseelifforwhiledefclasstryexceptfinallyz%"""|'''|"|'|\"|\'|\(|\)|\[|\]|\{|\}|#zInvalid Syntax Error:\zIncomplete Syntax ErrorzIncomplete Indentation Error)	enumeratesplitlenlstripstripappendpoprematchgroupfinditerstartrstrip)Z	codeBlockZignoreErrorsZ
stringMarkZparaListZindentNumberZstringMarksZ	openMarksZ
closeMarksZparaMarkDictZstringContinuationListZlineContinuationListZindentationBlockListZparentheticalContinuationListZ	newIndentZlspContinuationilZcurrentIndentationZ	emptyLineZ	firstWordZhasContinuationWordZ	commentedZnonCommentLengthresultrjZnonCommentString r,   *lib/python3.7/site-packages/wx/py/parse.pytestForContinuations   s    












r.   )F)__doc__
__author__r!   r.   r,   r,   r,   r-   <module>   s   