From: Lucas Bajolet Date: Thu, 5 Jun 2014 14:24:56 +0000 (-0400) Subject: lib/standard/ropes: Preparing introduction of iterators on Rope. X-Git-Tag: v0.6.6~43^2~20 X-Git-Url: http://nitlanguage.org lib/standard/ropes: Preparing introduction of iterators on Rope. Signed-off-by: Lucas Bajolet --- diff --git a/lib/standard/ropes.nit b/lib/standard/ropes.nit index 940939d..d1f7398 100644 --- a/lib/standard/ropes.nit +++ b/lib/standard/ropes.nit @@ -284,3 +284,25 @@ class RopeString end end +# Used to iterate on a Rope +private class IteratorElement + + init(e: RopeNode) + do + if e isa Leaf then + left = true + right = true + end + node = e + end + + # The node being visited + var node: RopeNode + # If the node has a left child, was it visited ? + var left = false + # If the node has a right child, was it visited ? + var right = false + # Was the current node visited ? + var done = false +end +