   seek: (position) ->
     @position = Point.zero()
     @sourcePosition = Point.zero()
-    @transformDelegate.reset(@position, @sourcePosition)
+    @transformBuffer.reset(@position, @sourcePosition)
     return if position.isZero()
 
     until @position.compare(position) >= 0

  getSourcePosition: ->
    @sourcePosition

class TransformDelegate
  constructor: (@sourceIterator) ->
    @reset(Point.zero(), Point.zero())

  reset: (position, sourcePosition) ->
    @position = position
    @sourcePosition = sourcePosition
    @bufferedOutputs = []
    @bufferedSourceOutput = null
    @sourceIterator.seek(sourcePosition)

  read: =>
    @bufferedSourceOutput or= @sourceIterator.next().value

  consume: (count) =>
    @sourcePosition.column += count
    @bufferedSourceOutput = @bufferedSourceOutput.substring(count)

  produce: (output) =>
    switch output

      else
        @position.column += output.length

    @outputs.push(
      content: output
      position: @position.copy()
      sourcePosition: @sourcePosition.copy()
