Ejemplo n.º 1
0
def form_eqs(node1,node2):
	result = Node(syms.simple_stmt,[\
		Node(syms.expr_stmt,[\
			node1.clone(),\
			Leaf(22, '='),\
			node2.clone()]),\
		Leaf(4, '\r\n')\
		])
	result.changed()
	return result
Ejemplo n.º 2
0
def form_mideqs(node1,node2_list):
	if len(node2_list)==1:
		result = node2_list[0].clone()
	else:
		args = []
		for i in node2_list:
			args.append(i.clone())
			args.append(Leaf(12, ','))
		args.pop()
		result = Node(syms.atom, [\
            Leaf(7, '('),\
            Node(syms.testlist_gexp, args),\
            Leaf(8, ')')])
	result = Node(syms.simple_stmt,[\
		Node(syms.expr_stmt,[\
			node1.clone(),\
			Leaf(22, '='),\
			result]),\
		Leaf(4, '\r\n')\
		])
	result.changed()
	return result