Replace itself with an other node in the AST

REQUIRE: parent != null

ENSURE: node.parent == old(parent)

ENSURE: parent == null

Property definitions

nitc $ ANode :: replace_with
	# Replace itself with an other node in the AST
	# REQUIRE: parent != null
	# ENSURE: node.parent == old(parent)
	# ENSURE: parent == null
	fun replace_with(node: ANode)
	do
		assert parent != null
		parent.replace_child(self, node)
		parent = null
	end
src/parser/parser_nodes.nit:130,2--139,4

nitc $ Prod :: replace_with
	redef fun replace_with(n: ANode)
	do
		super
		assert n isa Prod
		if not isset n._location and isset _location then n._location = _location
	end
src/parser/parser_nodes.nit:452,2--457,4

nitc :: transform $ AExpr :: replace_with
	redef fun replace_with(other)
	do
		super
		if other isa AExpr then
			if other.implicit_cast_to == null then other.implicit_cast_to = implicit_cast_to
			other.vararg_decl = vararg_decl
		end
	end
src/transform.nit:114,2--121,4