%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/compiler/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/compiler/transformer.pyo


Oac)@sfdZddlTddlZddlZddlZdefdYZddlmZm	Z	ddlm
Z
mZmZdZ
d	d
ZdZdZd
ZdfdYZejejejejejejejejejejejejejej ej!ej"gZ#idej$6dej%6dej&6dej'6dej(6dej)6dej*6Z+ej,ej-ej.ej/ej0ej1ej2ejej3ej4ej5ej6ej7ej8ej9ej:ej;ej<ej=ej>ej?ej@ejAejBejCejejejejejejejDejejejejejej ej!ej"ejEg)ZFeGedreFjHejIneGedreFjHejJnejejejejejejejejejejej ej!gZKiZLx'ejMjND]\ZOZPePeLeO<qWx'ejQjND]\ZOZPePeLeO<q?WdZRdS(sParse tree transformation module.

Transforms Python source code into an abstract syntax tree (AST)
defined in the ast module.

The simplest ways to invoke this module are via parse and parseFile.
parse(buf) -> AST
parseFile(path) -> AST
i(t*NtWalkerErrorcBseZRS((t__name__t
__module__(((s0/usr/local/lib/python2.7/compiler/transformer.pyR!s(t
CO_VARARGStCO_VARKEYWORDS(t	OP_ASSIGNt	OP_DELETEtOP_APPLYcCs3t|d}|jd}|jt|S(NtUs
(topentreadtclosetparse(tpathtftsrc((s0/usr/local/lib/python2.7/compiler/transformer.pyt	parseFile's
texeccCsT|dks|dkr(tj|S|dkrDtj|StddS(NRtsingletevals4compile() arg 3 must be 'exec' or 'eval' or 'single'(tTransformert
parsesuitet	parseexprt
ValueError(tbuftmode((s0/usr/local/lib/python2.7/compiler/transformer.pyR
1s
cCsg}x|D]}t|dr8|j|jq
t|tdkrl|jtt|q
t|tgkr|jt|q
|j|q
W|S(NtasList(NN(thasattrtappendRttypetNonettuple(tnodestltitem((s0/usr/local/lib/python2.7/compiler/transformer.pyR:s
cCsbt|dts|dSx@|dD]4}t|tr&t|}|dk	rZ|Sq&q&WdS(Nii(t
isinstanceR t
extractLineNoR(tasttchildtlineno((s0/usr/local/lib/python2.7/compiler/transformer.pyR%HscGst|d}|tkr]yt||dSWqptk
rYt|Gt|G|GHqpXntdt|dS(Niis$Can't find appropriate Node type: %s(R!t	TypeErrortlenRtstr(targstkind((s0/usr/local/lib/python2.7/compiler/transformer.pytNodeRs


RcBsUeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZeZdZdZeZeZeZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2d-Z3d.Z4d/Z5d0Z6d1Z7d2Z8d3Z9e9Z:e9Z;e9Z<d4Z=d5Z>d6Z?e?Z@d7ZAd8ZBd9ZCd:ZDd;ZEd<ZFd=ZGd>ZHd?ZId@ZJdAZKdBZLdCZMdDZNdEZOdFZPdGZQdHZRdIZSdJZTdKZUdLZVdMZWdNZXdOZYdPZZdQZ[dRZ\dSZ]dTZ^dUZ_dVZ`dWZadXZbdYZcdZZdd[Zed\Zfd]Zgd^Zhd_Zid`ZjdaZkdbZldcZmddZndeZodfZpdgZqdhZrdiZsdjZtdkZudlZvdmZwdnZxdoZydpZzdqZ{drZ|dsZ}dudtZRS(vsUtility object for transforming Python parse trees.

    Exposes the following methods:
        tree = transform(ast_tree)
        tree = parsesuite(text)
        tree = parseexpr(text)
        tree = parsefile(fileob | filename)
    cCsi|_xEtjjD]4\}}t||rt|||j|<qqW|j|jtj<i|j	tj
6|jtj6|j
tj6|jtj6|jtj6|jtj6|jtj6|_d|_dS(N(t	_dispatchtsymboltsym_nametitemsRtgetattrtcom_NEWLINEttokentNEWLINEt	atom_lpartLPARt	atom_lsqbtLSQBtatom_lbracetLBRACEtatom_backquotet	BACKQUOTEtatom_numbertNUMBERtatom_stringtSTRINGt	atom_nametNAMEt_atom_dispatchRtencoding(tselftvaluetname((s0/usr/local/lib/python2.7/compiler/transformer.pyt__init__hs	




cCsCt|tpt|ts6tj|dd}n|j|S(s,Transform an AST into a modified parse tree.t	line_infoi(R$R tlisttparsertst2tupletcompile_node(RGttree((s0/usr/local/lib/python2.7/compiler/transformer.pyt	transformxscCs|jtj|S(s6Return a modified parse tree for the given suite text.(RQRMtsuite(RGttext((s0/usr/local/lib/python2.7/compiler/transformer.pyR~scCs|jtj|S(s;Return a modified parse tree for the given expression text.(RQRMtexpr(RGRS((s0/usr/local/lib/python2.7/compiler/transformer.pyRscCs:t|tdkr't|}n|j|jS(s@Return a modified parse tree for the contents of the given file.t(RR
RR(RGtfile((s0/usr/local/lib/python2.7/compiler/transformer.pyt	parsefilescCs|d}|tjkr=|d|_|d}|d}n|tjkr]|j|dS|tjkr}|j|dS|tjkr|j|dS|tjkr|j|dS|tjkr|j|dS|tjkr|j|dSt	d|fdS(Niiisunexpected node type(
R0t
encoding_declRFtsingle_inputt
file_inputt
eval_inputtlambdeftfuncdeftclassdefR(RGtnodetn((s0/usr/local/lib/python2.7/compiler/transformer.pyROs$



cCs5|dd}|tjkr.|j|dStS(Ni(R5R6tcom_stmttPass(RGR_R`((s0/usr/local/lib/python2.7/compiler/transformer.pyRYscCs|j|tj}|dk	r*d}nd}g}xK||D]?}|dtjkrA|dtjkrA|j||qAqAWt|t	|S(Nii(
t
get_docstringR0RZRR5t	ENDMARKERR6tcom_append_stmttModuletStmt(RGtnodelisttdoctitstmtsR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRZs	&cCst|j|dS(Ni(t
Expressiontcom_node(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyR[scCs]t|}|j|}d}x5||krXt|||dd}|d7}q$W|S(Nii(R*RCtGetattr(RGRhtlistlenR#Rj((s0/usr/local/lib/python2.7/compiler/transformer.pytdecorator_namescCsL|j|dd}t|dkrB|j||d}n|}|S(Nii(RpR*tcom_call_function(RGRhtfuncnameRT((s0/usr/local/lib/python2.7/compiler/transformer.pyt	decorators
cCs;g}x(|D] }|j|j|dq
Wt|S(Ni(RRst
Decorators(RGRhR2tdec_nodelist((s0/usr/local/lib/python2.7/compiler/transformer.pyt
decoratorss
cCs|ddtjkrC|dgt|dd}|j|S|ddtjkr|j|dd}|j|dd}||_|StdS(Nii(R0R]RLR^RvR(RGRhR`Rvtcls((s0/usr/local/lib/python2.7/compiler/transformer.pyt	decorateds
	c
Cst|dkr,|j|dd}nd}|dd}|dd}|dd}|dtjkr|j|d\}}}nd	}}d}|j|d}	|j|d}
|	dk	r|
jd=nt	||||||	|
d|S(
NiiiiiiiR(((
R*RvRR0tvarargslisttcom_arglistRcRmR!tFunction(RGRhRvR(RIR,tnamestdefaultstflagsRitcode((s0/usr/local/lib/python2.7/compiler/transformer.pyR]s 

cCs~|ddtjkr:|j|dd\}}}nd}}d}|j|d}t||||d|ddS(NiiiiR(((R0RyRzRmtLambda(RGRhR|R}R~R((s0/usr/local/lib/python2.7/compiler/transformer.pyR\s#
cCs|dd}|j|d}|ddtjkrAg}n3|ddtjkrag}n|j|d}|j|d}|dk	r|jd=nt||||d|ddS(NiiiiiR((	RcR5tCOLONtRPARt	com_basesRmRR!tClass(RGRhRIRitbasesR((s0/usr/local/lib/python2.7/compiler/transformer.pyR^&s		
cCs|j|dS(Ni(Ra(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytstmt<scCsGg}x4tdt|dD]}|j|||qWt|S(Nii(trangeR*ReRg(RGRhRkRj((s0/usr/local/lib/python2.7/compiler/transformer.pytsimple_stmtCscCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyt
parametersJscCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyRyMscCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytfpdefPscCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytfplistSscCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytdotted_nameVscCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytcomp_opYscCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyttrailer\scCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytsliceop_scCs
tdS(N(R(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytargumentbscCs|d}|j||d}t|dkrHt|d|jS|ddtjkrg}xAtdt|ddD]#}|j|j||t	qWt
||d|ddS|j|d}|j|d}t
||d|d|dStddS(NiiR(iiscan't get here(tlookup_nodeR*tDiscardR(R5tEQUALRRt
com_assignRtAssignt
com_augassigntcom_augassign_opt	AugAssignR(RGRhtentexprNodetnodeslRjtlvaltop((s0/usr/local/lib/python2.7/compiler/transformer.pyt	expr_stmtjs
#!cCsg}t|dkr'd}d}n?|ddtjkrZ|j|d}d}nd}d}x:t|t|dD] }|j|j||qW|ddtjkrt||d|ddSt	||d|ddS(NiiiiiR((
R*RR5t
RIGHTSHIFTRmRRtCOMMAtPrinttPrintnl(RGRhR2tstarttdestRj((s0/usr/local/lib/python2.7/compiler/transformer.pyt
print_stmt{s		cCs|j|dtS(Ni(RR(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytdel_stmtscCstd|ddS(NR(ii(Rb(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyt	pass_stmtscCstd|ddS(NR(ii(tBreak(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyt
break_stmtscCstd|ddS(NR(ii(tContinue(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyt
continue_stmtscCsUt|dkr0ttdd|ddSt|j|dd|ddS(NiR(ii(R*tReturntConstRRm(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytreturn_stmtscCs&|j|d}t|d|jS(NiR((RmRR((RGRhRT((s0/usr/local/lib/python2.7/compiler/transformer.pyt
yield_stmtscCsLt|dkr(|j|d}ntd}t|d|ddS(NiR(ii(R*RmRRtYield(RGRhRH((s0/usr/local/lib/python2.7/compiler/transformer.pyt
yield_exprscCst|dkr(|j|d}nd}t|dkrV|j|d}nd}t|dkr|j|d}nd}t|||d|ddS(NiiiR(ii(R*RmRtRaise(RGRhtexpr3texpr2texpr1((s0/usr/local/lib/python2.7/compiler/transformer.pyt
raise_stmtscCs|j|dS(Ni(Rm(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytimport_stmtscCs%t|j|dd|ddS(NiR(ii(tImporttcom_dotted_as_names(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytimport_namescCsd}x"||ddkr*|d7}q	W|d}||dtjkrl|j||}|d7}nd}||ddtjkrt|dg|d|ddS||d||ddtjk}t||j||d|ddSdS(	Nit.iRURR(i(RN(	R0Rtcom_dotted_nameR5tSTARtFromRR8tcom_import_as_names(RGRhtidxtleveltfromnameR_((s0/usr/local/lib/python2.7/compiler/transformer.pytimport_froms

'cCsVg}x5tdt|dD]}|j||dqWt|d|ddS(NiiR(i(RR*RtGlobal(RGRhR|Rj((s0/usr/local/lib/python2.7/compiler/transformer.pytglobal_stmtscCs|j|d}t|dkri|j|d}t|dkr`|j|d}qsd}n
d}}t|||d|ddS(	NiiiiiR(ii(RmR*RtExec(RGRhRRR((s0/usr/local/lib/python2.7/compiler/transformer.pyt	exec_stmts	
cCs\|j|d}t|dkr;|j|d}nd}t||d|ddS(NiiiR(ii(RmR*RtAssert(RGRhRR((s0/usr/local/lib/python2.7/compiler/transformer.pytassert_stmts
cCsg}xetdt|ddD]G}|j||d}|j||d}|j||fq#Wt|ddkr|j|d}nd}t||d|ddS(NiiiiiR(i(RR*RmRRtIf(RGRhttestsRjttestNodet	suiteNodetelseNode((s0/usr/local/lib/python2.7/compiler/transformer.pytif_stmts#cCsr|j|d}|j|d}t|dkrN|j|d}nd}t|||d|ddS(NiiiiR(ii(RmR*RtWhile(RGRhRtbodyNodeR((s0/usr/local/lib/python2.7/compiler/transformer.pyt
while_stmt	scCs|j|dt}|j|d}|j|d}t|dkrd|j|d}nd}t||||d|ddS(NiiiiR(ii(RRRmR*RtFor(RGRht
assignNodetlistNodeRR((s0/usr/local/lib/python2.7/compiler/transformer.pytfor_stmtscCs
|j|S(N(tcom_try_except_finally(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyttry_stmt%scCs
|j|S(N(tcom_with(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyt	with_stmt(scCs
|j|S(N(tcom_with_var(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytwith_var+scCsjt|dkr#|j|dSg}x4|D],}|dtjkr0|j||q0q0Wt|S(Nii(R*RaR0RReRg(RGRhRkR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRR.s
cCs|jt|S(N(t
com_binarytTuple(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyttestlist>scCs]t|dkrP|ddtjkrP|j|d}|j||dS|j|S(Niii(R*R0tcomp_forRmtcom_generator_expressionR(RGRhttest((s0/usr/local/lib/python2.7/compiler/transformer.pyt
testlist_compHs)cCst|dkr:|ddtjkr:|j|dS|j|d}t|dkr|j|d}|j|d}t|||d|ddS|S(NiiiiR((R*R0R\RmtIfExp(RGRhtthenRtelse_((s0/usr/local/lib/python2.7/compiler/transformer.pyRPs)cCsJt|dkr:|ddtjkr:|j|dS|jt|S(Nii(R*R0R\RtOr(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytor_test^s)cCs|jt|S(N(RtAnd(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytand_testescCsA|j|d}t|dkr=t|d|ddS|S(NiiR(i(RmR*tNot(RGRhtresult((s0/usr/local/lib/python2.7/compiler/transformer.pytnot_testisc	Cs	|j|d}t|dkr)|Sg}xtdt|dD]}||d}|d}|dtjkr|d}t|dkr|dkrd}qd}qnt|d}|dd}|j||j||fqHWt||d|S(	Niiiitnotsnot insis notR((RmR*RR5RDt
_cmp_typesRtCompare(	RGRhR_tresultsRjtnlR`RR(((s0/usr/local/lib/python2.7/compiler/transformer.pyt
comparisonps"

	$cCs|jt|S(N(RtBitor(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyRTscCs|jt|S(N(RtBitxor(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytxor_exprscCs|jt|S(N(RtBitand(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytand_exprscCs|j|d}xtdt|dD]}|j||}||ddtjkrt||gd|dd}q,||ddtjkrt||gd|dd}q,td||ddq,W|S(NiiiR(sunexpected token: %s(	RmRR*R5t	LEFTSHIFTt	LeftShiftRt
RightShiftR(RGRhR_Rjtright((s0/usr/local/lib/python2.7/compiler/transformer.pyt
shift_exprs##cCs|j|d}xtdt|dD]}|j||}||ddtjkrt||gd|dd}q,||ddtjkrt||gd|dd}q,td||ddq,W|S(NiiiR(sunexpected token: %s(	RmRR*R5tPLUStAddtMINUStSubR(RGRhR_RjR((s0/usr/local/lib/python2.7/compiler/transformer.pyt
arith_exprs##cCs
|j|d}xtdt|dD]}|j||}||dd}|tjkr{t||g}ny|tjkrt||g}nU|tjkrt	||g}n1|tj
krt||g}n
td||dd|_
q,W|S(Niiisunexpected token: %s(RmRR*R5RtMultSLASHtDivtPERCENTtModtDOUBLESLASHtFloorDivRR((RGRhR_RjRtt((s0/usr/local/lib/python2.7/compiler/transformer.pytterms
cCs|d}|d}|j|d|dd}|tjkrXt|d|dS|tjkr{t|d|dS|tjkrt|d|d}n|S(NiiiR(i(RR5RtUnaryAddRtUnarySubtTILDEtInvert(RGRhteltR
R_((s0/usr/local/lib/python2.7/compiler/transformer.pytfactors

!cCs|j|d}xwtdt|D]`}||}|dtjkrwt||j||dgd|dS|j||}q)W|S(NiiR(i(RmRR*R5t
DOUBLESTARtPowertcom_apply_trailer(RGRhR_RjR((s0/usr/local/lib/python2.7/compiler/transformer.pytpowers
 cCs|j|dd|S(Ni(RE(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pytatomscCs@|ddtjkr/tdd|ddS|j|dS(NiiR(i((R5RRRm(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyR7scCs@|ddtjkr/tdd|ddS|j|dS(NiiR(i((R5tRSQBtListtcom_list_constructor(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyR9scCs@|ddtjkr/tdd|ddS|j|dS(NiiR(i((R5tRBRACEtDicttcom_dictorsetmaker(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyR;scCst|j|dS(Ni(t	BackquoteRm(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyR=scCs,t|dd}t|d|ddS(NiiR(i(RR(RGRhtk((s0/usr/local/lib/python2.7/compiler/transformer.pyR?scCs[|jrM|jdkr6t|dj|j}ntd|j|fSt|SdS(Nsutf-8s
iso-8859-1s# coding: %s
%s(sutf-8s
iso-8859-1(RFtunicodetencodeR(RGtlit((s0/usr/local/lib/python2.7/compiler/transformer.pytdecode_literals
	cCsFd}x%|D]}||j|d7}q
Wt|d|ddS(NRUiR(ii(R"R(RGRhRR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRAs
cCs t|ddd|ddS(NiiR(i(tName(RGRh((s0/usr/local/lib/python2.7/compiler/transformer.pyRC
scCs|j|dS(Ni(R/(RGR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRscCs|j|d|dS(Nii(R/(RGR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRm scGsttdS(N(RRR(RGR,((s0/usr/local/lib/python2.7/compiler/transformer.pyR4'scCsg}g}d}d}x|t|kr||}|dtjks]|dtjkr+|dtjkr||d}|dtjkr|j|d|tB}|d}qn|t|kr'||d}|tjkr||d}n
td||j|d|tB}nPn|j|j	||d}|t|kr||dtj
kr|j|j||d|d}nt|rtdn|d}qW|||fS(Niiisunexpected token: %sis-non-default argument follows default argument(
R*R5RRRDRRRRt	com_fpdefRRmtSyntaxError(RGRhR|R}R~RjR_R
((s0/usr/local/lib/python2.7/compiler/transformer.pyRz-s<
&



)
cCs4|ddtjkr(|j|dS|ddS(Niii(R5R8t
com_fplist(RGR_((s0/usr/local/lib/python2.7/compiler/transformer.pyR$_scCspt|dkr#|j|dSg}x:tdt|dD] }|j|j||qBWt|S(Nii(R*R$RRR (RGR_RLRj((s0/usr/local/lib/python2.7/compiler/transformer.pyR&escCs\d}xK|D]C}t|tdkr
|ddkr
||dd}q
q
W|d S(NRUiiRi((R(RGR_RIR`((s0/usr/local/lib/python2.7/compiler/transformer.pyRns

(cCsO|d}|j|dd}t|dkr=|dfS||ddfS(Niii(RR*R(RGR_tdot((s0/usr/local/lib/python2.7/compiler/transformer.pytcom_dotted_as_namevs


cCsa|d}|j|dg}x:tdt|dD] }|j|j||q9W|S(Niii(R(RR*R(RGR_R|Rj((s0/usr/local/lib/python2.7/compiler/transformer.pyRs

cCsH|d}t|dkr.|dddfS|dd|ddfS(Niii(R*R(RGR_((s0/usr/local/lib/python2.7/compiler/transformer.pytcom_import_as_names
cCsa|d}|j|dg}x:tdt|dD] }|j|j||q9W|S(Niii(R)RR*R(RGR_R|Rj((s0/usr/local/lib/python2.7/compiler/transformer.pyRs

cCsGg}x:tdt|dD] }|j|j||qW|S(Nii(RR*RRm(RGR_RRj((s0/usr/local/lib/python2.7/compiler/transformer.pyRsc
Cs|ddtjkrLt|j|d|j|dd|ddSg}d}d}x4tdt|dD]}||}|dtjkr't|dkr|j|d}t|dkr|j	|dt
}qd}n
d}}|j|||j||dfn|dtjkrw|ddkrd|j||d}q|dd	kr|j||d}qqwqwWt|j|d||d|dd}	|rt|	|d|ddS|	SdS(
NiiiiR(iitelsetfinally(
R5RDt
TryFinallyRmRRR*R0t
except_clauseRRRt	TryExcept(
RGRhtclausesRtfinallyNodeRjR_RRt
try_except((s0/usr/local/lib/python2.7/compiler/transformer.pyRs6
	
*!cCsu|j|d}x[tt|dddD]=}|j||||dd}|dkrg|S|}q0WdS(Niiiiii(RmRR*t
com_with_item(RGRhtbodyRjtret((s0/usr/local/lib/python2.7/compiler/transformer.pyRs#!cCsZt|dkr+|j|dt}nd}|j|d}t|||d|S(NiiiR((R*RRRRmtWith(RGRhR3R(tvarRT((s0/usr/local/lib/python2.7/compiler/transformer.pyR2s
cCs|dS(Ni((RGR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRscCsE|j|}|jttttfkr.|Std|jjdS(sReturn node suitable for lvalue of augmented assignment

        Names, slices, and attributes are the only allowable nodes.
        scan't assign to %sN(Rmt	__class__R#tSlicet	SubscriptRnR%R(RGR_R"((s0/usr/local/lib/python2.7/compiler/transformer.pyRscCsUxN|d}|tjtjtjtjfkr`t|dkrS|j||S|d}q|tkrt|dkrtdn|d}q|tj	krq|ddtj
krtdnt|dkrd|j|d}x\tdt|dD]A}||}|dt
jkr7tdn|j||}qW|j||d|S|d}q|tj
kr@|dd}|t
jkr|d}|dt
jkr=tdq=qM|t
jkr|d}|dt
jkrtdn|j||S|t
jkr4|j|d|Stdqtd	|qWdS(
Niiiscan't assign to operatoriscan't assign to ()scan't assign to []scan't assign to literalsbad assignment (%s)(R0texprlistRt
testlist_safeRR*tcom_assign_tuplet
_assign_typesR%RRRmRR5RRtcom_assign_trailerR8RR:Rtcom_assign_listRDtcom_assign_name(RGR_t	assigningR
tprimaryRjtch((s0/usr/local/lib/python2.7/compiler/transformer.pyRsL
$

 



cCs\g}x=tdt|dD]#}|j|j|||qWt|dt|S(NiiR((RR*RRtAssTupleR%(RGR_RAtassignsRj((s0/usr/local/lib/python2.7/compiler/transformer.pyR<s!cCsg}x}tdt|dD]c}|dt|kre||ddtjkretdqen|j|j|||qWt|dt|S(Niiis"can't assign to list comprehensionR((	RR*R0tlist_forR%RRtAssListR%(RGR_RARERj((s0/usr/local/lib/python2.7/compiler/transformer.pyR?s!cCst|d|d|dS(NiR(i(tAssName(RGR_RA((s0/usr/local/lib/python2.7/compiler/transformer.pyR@%scCs|dd}|tjkr4|j||d|S|tjkrZ|j||d|S|tjkrutdntd|dS(Niiiscan't assign to function callsunknown trailer type: %s(R5tDOTtcom_assign_attrR:tcom_subscriptlistR8R%(RGRBR_RAR
((s0/usr/local/lib/python2.7/compiler/transformer.pyR>(scCst||d|d|dS(NiR(i(tAssAttr(RGRBR_RA((s0/usr/local/lib/python2.7/compiler/transformer.pyRJ2scCst|}|dkr9|d}|j||dSg}xDtd|dD]0}||}|j|j||dqRW||dt|S(s=Compile 'NODE (OP NODE)*' into (type, [ node1, ..., nodeN ]).iiiR((R*RRRR%(RGtconstructorRhR"R`R2Rj((s0/usr/local/lib/python2.7/compiler/transformer.pyR5s

$cCs9|j||d}t|tr,|St|gS(Ni(RR$Rg(RGR_R((s0/usr/local/lib/python2.7/compiler/transformer.pyRaAscCsL|j||d}t|tr;|j|jn
|j|dS(Ni(RR$RgtextendR!R(RGRkR_R((s0/usr/local/lib/python2.7/compiler/transformer.pyReHscCsg}xtdt|D]l}||dtjkrQ|j|d||S||dtjkrnqn|j|j||qWt	|d|dj
S(NiiR((RR*R0RFtcom_list_comprehensionR5RRRmRR((RGRhtvaluesRj((s0/usr/local/lib/python2.7/compiler/transformer.pyRPs
cCs|j|d|dS(NRL(tcom_comprehensionR(RGRTR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRO]sc
Cs|dd}g}x|r|dd}|dkr|j|dt}|j|d}	t||	g}
|dd|
_|j|
t|dkrd}q|dkr|j|d}q|j	|d}q|dkr|j|d}t
|d|dd}|
jj|t|d	krGd}q|dkri|j|d	}q|j	|d	}qtd
||fqW|dkrt
||d|S|dkrt||d|S|dkrt|||d|Std
t|dS(NiitforiiRLtifR(is'unexpected comprehension element: %s %dtsettdictsunexpected comprehension type: (RRRmtListCompForR(RR*Rt
com_list_itert
com_comp_itert
ListCompIftifsR%tListComptSetComptDictCompRtrepr(
RGRRR_RR(tforsR
RtcompNodetnewforRtnewif((s0/usr/local/lib/python2.7/compiler/transformer.pyRQ`sD
	
		cCs|dS(Ni((RGR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRWscCs|dS(Ni((RGR_((s0/usr/local/lib/python2.7/compiler/transformer.pyRXscCsu|dd}g}x8|rN|dd}|dkr|j|dt}|j|d}t||gd|dd}|j|t|dkrd}qK|j|d}q|dkr8|j|d}	t|	d|dd}
|j	j|
t|dkr"d}qK|j|d}qt
d	||fqWt|d
_t
t||d|S(NiiRRiR(iRSis.unexpected generator expression element: %s %di(RRRmt
GenExprForRR*RRXt	GenExprIfRZR%tTruet
is_outmosttGenExprtGenExprInner(RGRTR_R(R_R
RtgenNodeRaRRb((s0/usr/local/lib/python2.7/compiler/transformer.pyRs2	
		
cCs|d}t|dks3|ddtjkrg}x:tdt|dD] }|j|j||qRWt|d|djS|ddtj	kr|j|d}|j
|d|ddSt|dkr:|ddtj	kr:|j|d}|j|d}|j
|||ddSg}xQtdt|dD]7}|j|j|||j||dfqYWt|d|ddjSdS(	NiiiR(RTiRUi(
R*R5RRRRmtSetR(R0RRQRR(RGRhR2RjRTtkeyRH((s0/usr/local/lib/python2.7/compiler/transformer.pyRs$
))cCs|dd}|tjkr1|j||dS|tjkrT|j||dS|tjkrz|j||dtStd|dS(Niiisunknown node type: %s(	R5R8RqRItcom_select_memberR:RKRR%(RGtprimaryNodeRhR
((s0/usr/local/lib/python2.7/compiler/transformer.pyRscCs:|dtjkrtdnt||dd|dS(Nismember must be a nameiR(i(R5RDR%Rn(RGRmRh((s0/usr/local/lib/python2.7/compiler/transformer.pyRlscCs|dtjkr,t|gdt|Sg}d}d}}t|}d}x@||kr||}	|	dtjkr|dk	rtdn|j||d}|d}qWnR|	dtj	kr|dk	rtdn|j||d}|d}qWn|j
|	||\}}
|dkr|t|
tr|t|	dkr||	ddt
jkr|tdn|j|
|d}qWWt||||dt|S(	NiR(is$already have the varargs indentifieris#already have the kwargs indentifieris&generator expression needs parenthesis(R5RtCallFuncR%RR*RR%RmRtcom_argumentR$RgR0RR(RGRmRhR,tkwt	star_nodet
dstar_nodetlen_nodelistRjR_R((s0/usr/local/lib/python2.7/compiler/transformer.pyRqs:



)
cCsDt|dkrV|ddtjkrV|j|d}d|j||dfSt|dkr|rztdn|rtdnd|j|dfS|j|d}|d}x3t|dkr|dtjkr|d}qW|dtjkrtd|dnt|d|d|d}d|fS(	Niiiis!non-keyword arg after keyword args+only named arguments may follow *expressions#keyword can't be an expression (%s)R((	R*R0RRmRR%R5RDtKeyword(RGRhRpRqRRR`R_((s0/usr/local/lib/python2.7/compiler/transformer.pyRos")
(cCst|dkr|d}|ddtjks\t|dkr|ddtjkr|ddtjkr|j|||Sng}x:tdt|dD] }|j|j||qWt	|||dt
|S(NiiiiR((R*R5RR0Rt	com_sliceRRt
com_subscriptR9R%(RGRBRhRAtsubt
subscriptsRj((s0/usr/local/lib/python2.7/compiler/transformer.pyRK"s
)cCs||d}|d}|tjkrA|ddtjkrAtS|tjksbt|dkro|j|S|j|S(Niii(R5RItEllipsisRR*tcom_sliceobjRm(RGR_RCR
((s0/usr/local/lib/python2.7/compiler/transformer.pyRv6s

&!
cCs>g}|ddtjkr9|jtdd}n |j|j|dd}|t|kr||dtjkr|j|j|||d}n|jtdxit	|t|D]R}||}t|dkr
|jtdq|j|j|dqWt
|dt|S(NiiiiR((R5RRRRRmR*R0RRtSliceobjR%(RGR_R2RjtjRC((s0/usr/local/lib/python2.7/compiler/transformer.pyRz@s 
	)

cCsd}}t|dkr_|ddtjkrI|j|d}q|j|d}n;t|dkr|j|d}|j|d}nt||||dt|S(NiiiiiR((RR*R5RRmR8R%(RGRBR_RAtlowertupper((s0/usr/local/lib/python2.7/compiler/transformer.pyRuds
cCs|dkr#|d}|d}n|tjkrt|dkrU|j|dSx.|D]&}|dtjkr\|j|Sq\WdS|tjkrx.|D]&}|dtjkr|j|SqWdS|tjkr'|ddtj	kr#d}x"|D]}|t
|d}qW|SdS|tjksT|tjksT|tjkre|j|dS|t
krt|dkr|j|dSdS(NiiRU(RR0RRR*RcRRZRR5RBRRt
small_stmtt
_doc_nodes(RGR_R`RwtsR
((s0/usr/local/lib/python2.7/compiler/transformer.pyRcrs8




N(RRt__doc__RJRQRRRWRORYRZR[RpRsRvRxR]R\told_lambdefR^RRt	flow_stmtt
compound_stmtRRRyRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR;t	testlist1R:RRRtold_testRRRRTRRRRRRRRR7R9R;R=R?R"RARCRRmR4RzR$R&RR(RR)RRRRR2RRRR<R?R@R>RJRRaReRRORQRWRXRRRRlRqRoRKRvRzRuRRc(((s0/usr/local/lib/python2.7/compiler/transformer.pyR^s							
							!																																
												!				
			
	
													2					
		
			)						
	,		
		
					
		1			"				'			
	$	t<t>s==s<=s>=s!=RRcCs~g}xq|D]i}t|ttfrD|jtj||q
t|trc|j|q
|jt|q
W|S(N(R$tinttlongRt_namestgetR+t
debug_tree(RPR"R((s0/usr/local/lib/python2.7/compiler/transformer.pyRs
(SRtcompiler.astRMR0R5t
StandardErrorRtcompiler.constsRRRRRRR
RR%R.RRRR;RRRRRRTRRRRRRRRtLESStGREATERtEQEQUALRt	LESSEQUALtGREATEREQUALtNOTEQUALRR]R^RRRRRRRRRRRRRRRRRRRRRRRR:Rt_legal_node_typesRRRRR=RR1R2Rtvttok_nameR(((s0/usr/local/lib/python2.7/compiler/transformer.pyt<module>	s
	
			
	9








Zerion Mini Shell 1.0