3
æ?^.  ã               @   s<   d Z ddlmZmZmZ ddlmZ ddlmZ dd„ Z	dS )z7Isolate Python version-specific semantic actions here.
é    )Ú
PRECEDENCEÚTABLE_RÚTABLE_DIRECT)Ú
SyntaxTree)ÚTokenc                s  |r$t jdQdSdUdXd[d\d]d^d_dœ	ƒ n4t jd`daddtd ffddtd fdfdbdcdddœƒ |dk r–|dk r|t jdedfdœƒ ddlm} |ˆ |ƒ nrt jddjiƒ |d"k rºt d# t d$< d%|  k oÎd"kn   ræt jd&dkiƒ nt jd&dliƒ |d)kr6dd*lm} |ˆ |ƒ |d"krÌdd+lm} |ˆ |ƒ n–t	d,t	d-t	d	t
d.d/dd0d1gƒt	d!t
d2d3dd0d1gƒgƒgƒat jdmdndqd8œƒ |d%kr¤‡ fd9d:„}|ˆ _n(t jd;driƒ |d=krÌt jdsdudBœƒ tjdvdyd|dd‚dƒd„d…dKœƒ t jdLd†iƒ ‡ fdNdO„}|ˆ _d S )‡Nú%|assert %c
é   Úassert_exprr   ú%|assert not %c
Ú
assert_expú%|assert not %c, %c
é   Úexprú%|assert %c, %c
ú%|try:
%+%c%-%c

é   ú %|try:
%+%c%-%|finally:
%+%c%-

é   ú%|%c, %c, %c = %c, %c, %c
é   ú%|%c, %c = %c, %c
)	Zassert_pypyZassert0_pypyZassert_not_pypyZassert2_not_pypyZassert2_pypyZtry_except_pypyZtryfinallystmt_pypyZassign3_pypyZassign2_pypyz%|assert not %p
Z	unary_notz%|assert not %p, %c
é   é   )ÚassertZassert2Z	assertnotZ
assert2notZassign2Zassign3Z
try_exceptg      @gš™™™™™	@ú	%|del %c
ú%{pattr})Zdel_deref_stmtÚDELETE_DEREF)Úcustomize_for_version3Zexcept_cond3ú%|except %c, %c:
ÚstoregÍÌÌÌÌÌ@ZtesttrueZtesttrue_theng333333@Úcomp_forú for %c in %cú for %c in %c%cg      @)Úcustomize_for_version25)Úcustomize_for_version26_27ÚstmtZassignÚLOAD_GLOBALÚ__name__T)ZpattrÚoffsetÚhas_argÚ
STORE_NAMEÚ
__module__ú%|import %c%c
ú, %cú%|try:
%+%c%-%|finally:
%+%c%-Úsuite_stmts_opt)ÚimportmultipleZimport_contZtryfinallystmtc                s"   ˆ j d| ƒ ˆ j| ƒ ˆ jƒ  d S )Nú%cr   )r1   r   )Ztemplate_engineÚdefaultÚprune)Únode)Úself© ú[/home/psgendb/BIRCHDEV/python/lib/python3.6/site-packages/uncompyle6/semantics/customize.pyÚn_iftrue_stmt24   s    
z.customize_for_version.<locals>.n_iftrue_stmt24Zif1_stmtú%|if 1
%+%c%-gÍÌÌÌÌÌ @ú%cú%C%,éd   Ú
)r0   Zimports_contú%c[:]ú%c[%p:]ú%c[:%p]ú	%c[%p:%p]ú%|del %c[:]
ú%|del %c[%c:]
ú%|del %c[:%c]
ú%|del %c[%c:%c]
)zSTORE_SLICE+0zSTORE_SLICE+1zSTORE_SLICE+2zSTORE_SLICE+3zDELETE_SLICE+0zDELETE_SLICE+1zDELETE_SLICE+2zDELETE_SLICE+3Zraise_stmt2ú%|raise %c, %c
c                sn   ˆ j ˆ jdƒ ˆ j| d ƒ | d d jƒ sZd}x(| d D ]}ˆ j |ƒ d}ˆ j|ƒ q:W ˆ jƒ  ˆ jƒ  dS )zy
            exec_stmt ::= expr exprlist DUP_TOP EXEC_STMT
            exec_stmt ::= expr exprlist EXEC_STMT
            zexec r   r   z in z, N)ÚwriteÚindentZpreorderZisNoneZprintlnr3   )r4   ÚsepÚsubnode)r5   r6   r7   Ún_exec_stmt³   s    
z*customize_for_version.<locals>.n_exec_stmt©r   r	   )r   rL   ©r   r	   )r   rM   ©r   r   )r
   rN   ©r   r   ©r   r   )r   rO   rP   ©r   r	   ©r   r   )r   rQ   rR   )r   r   r   )r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   )r   r   )r   r   r   )r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   )r   r   )r   r   ©r   r   éþÿÿÿ©rT   r   )r   rS   rU   )r!   r   r   )r"   r   r   r   )r,   r   r   )r-   r   ©r   r/   ©r   r/   )r.   rV   rW   )r9   r   )r:   r   ©r   r<   r=   )r;   rX   )r>   r   éÿÿÿÿ©r   rY   )r?   r   rZ   rY   ©r   rY   )r@   r   r[   rY   ©r   rY   rY   ©r   rY   )rA   r   r\   r]   )rB   r   )rC   r   r   )rD   r   r   )rE   r   r   r   )rF   r   r   )r   Úupdater   Zuncompyle6.semantics.customize3r   Z uncompyle6.semantics.customize25r#   Z#uncompyle6.semantics.customize26_27r$   r   r   ZNAME_MODULEr8   r   Z
n_exec_smt)r5   Zis_pypyÚversionr   r#   r$   r8   rK   r6   )r5   r7   Úcustomize_for_version   s®      









  



	
r`   N)
Ú__doc__Zuncompyle6.semantics.constsr   r   r   Zuncompyle6.parsers.treenoder   Zuncompyle6.scanners.tokr   r`   r6   r6   r6   r7   Ú<module>   s   