 
     matches.reverse()
 
-    recurse = true
-    stop = -> recurse = false
+    keepLooping = true
+    stop = -> keepLooping = false
     replacementText = null
     replace = (text) -> replacementText = text
 

    global = regex.global
    regex = new RegExp(regex.source, 'gm')

    traverseRecursively = (text, startIndex, endIndex, lengthDelta) =>
      regex.lastIndex = startIndex
      return unless match = regex.exec(text)


      startPosition = @positionForCharacterIndex(matchStartIndex + lengthDelta)
      endPosition = @positionForCharacterIndex(matchEndIndex + lengthDelta)
      range = new Range(startPosition, endPosition)
      keepLooping = true
      replacementText = null
      stop = -> keepLooping = false
      replace = (text) -> replacementText = text
      iterator(match, range, { stop, replace })

