nitc :: ANode :: replace_with
REQUIRE: parent != null
ENSURE: node.parent == old(parent)
ENSURE: parent == null
# 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
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