Depth in tree (length of the path from self to root)

Property definitions

trees $ TreeNode :: depth
	# Depth in tree (length of the path from `self` to `root`)
	fun depth: Int do
		var node = parent
		var i = 0
		while node != null do
			node = node.parent
			i += 1
		end
		return i
	end
lib/trees/abstract_tree.nit:64,2--73,4