def parse_assign_expr(ctx, tree, subparser):
if isinstance(tree, _ast.Assign):
assert len(tree.targets) == 1 and isinstance(tree.targets[0], _ast.Name)
return RowExprAssign(tree.targets[0].id, subparser(ctx, tree.value))
elif isinstance(tree, _ast.Expr):
if isinstance(tree.value, _ast.Name):
return RowExprAssign(tree.value.id, subparser(ctx, tree))
else:
raise Exception("Please assign expression to a variable")
else:
raise Exception("Please assign expression to a variable")
评论列表
文章目录