def list_literals(self):
if not len(self.expr.elts):
raise StructureException("List must have elements", self.expr)
o = []
out_type = None
for elt in self.expr.elts:
o.append(Expr(elt, self.context).lll_node)
if not out_type:
out_type = o[-1].typ
elif len(o) > 1 and o[-1].typ != out_type:
out_type = MixedType()
return LLLnode.from_list(["multi"] + o, typ=ListType(out_type, len(o)), pos=getpos(self.expr))
评论列表
文章目录