anchor.diff:      /// Creates an arbitrary object out of the characters at the given `CharSpan`.
       /// After that call, the characters at and before the span might be freed from memory, so this function must not be used twice.
       let unpinSpanAndGenerate symbol (fPostProcess: CharStreamCallback<'symbol>) cs ({IndexFrom = idxStart; IndexTo = idxEnd} as span) =
  -        if cs.StartingIndex <= idxStart && cs.LengthSoFar > idxEnd then
  +        if cs.StartingIndex <= idxStart && cs.Source.LengthSoFar > idxEnd then
               cs.StartingIndex <- idxEnd + 1UL
               let length = idxEnd - idxStart + 1UL |> int
  -            let span =
  -                match cs.Source with
  -                | StaticBlock sb -> sb.Span.Slice(int idxStart, length)
  -                | DynamicBlock db -> ReadOnlySpan(db.Buffer).Slice(int <| idxStart - db.BufferStartingIndex, length)
  +            let span = cs.Source.GetSpanForCharacters(idxStart, length)
               cs._LastUnpinnedSpanPosition <- cs.GetCurrentPosition()
               fPostProcess.Invoke(symbol, cs.LastUnpinnedSpanPosition, span)
           else
  
positive.code:     member x.Length = x.IndexTo - x.IndexFrom + 1UL |> int
      override x.ToString() = sprintf "[%d,%d]" x.IndexFrom x.IndexTo
  
  /// The internal structure to support `CharStreamSource.DynamicBlock`.
  type private DynamicBlock =
      {
          /// The `TextReader` that powers the stream.
          Reader: TextReader
          /// A character array where the characters that get read, but are still needed are stored.
          mutable Buffer: char[]
          /// The index of the first element in the buffer.
          mutable BufferStartingIndex: uint64
          /// The index of the next character to be read.
          mutable NextReadIndex: uint64
      }
      member x.Item
          with get idx =
              if idx >= x.BufferStartingIndex && idx < x.NextReadIndex then
                  let position = int <| idx - x.BufferStartingIndex
                  x.Buffer.[position]
              else
                  failwithf "Trying to get character at %d, while only characters from %d to %d have been loaded"
                      idx x.BufferStartingIndex <| x.NextReadIndex - 1UL
      /// The real length of the buffer, excluding the unpinned characters at the end.
      member x.BufferContentLength = x.NextReadIndex - x.BufferStartingIndex |> int
      interface IDisposable with
          member x.Dispose() =
              x.Reader.Dispose()
              GC.SuppressFinalize(x)
      override x.Finalize() = (x :> IDisposable).Dispose()
  
  /// A representation of a `CharStream`.
  type private CharStreamSource =
      /// A representation of a `CharStream` that stores
      /// the characters in one continuous area of memory.
      /// It is not recommended for large files.
      | StaticBlock of ReadOnlyMemory<char>
      /// A representation of a `CharStream` that lazily
      /// loads input from a `TextReader` when it is needed
      /// and unloads it when it is not.
      | DynamicBlock of DynamicBlock
      /// Gets a specified character by index; if it exists in memory, or raises an exception.
      member x.Item
          with get idx =
              match x with
              | StaticBlock sb -> sb.Span.[int idx]
              | DynamicBlock db -> db.[idx]
      /// Returns how many characters have been read so far.
      /// In dynamic block streams, it doesn't mean that all these characters are still on memory.
      member x.LengthSoFar =
          match x with
          | StaticBlock sb -> uint64 sb.Length
          | DynamicBlock db -> db.NextReadIndex
      interface IDisposable with
          member x.Dispose() =
              match x with
              | StaticBlock _ -> ()
              | DynamicBlock db -> (db :> IDisposable).Dispose()
  
  /// A data structure that supports efficient and copy-free access to a read-only sequence of characters.
  /// It is not thread-safe.
  
negative.code: 
      /// Reads the `idx`th character of `cs`, places it in `c` and returns `true`, if there are more characters left to be read.
      /// Otherwise, returns `false`.
      let readChar cs (c: outref<_>) (idx: byref<_>) =
          if idx.Index >= cs.CurrentIndex then
              cs.Source.ReadNextCharacter(cs.StartingIndex, &idx, &c)
          else
              failwithf "Trying to view the %dth character of a stream, while the first %d have already been consumed." idx.Index cs.CurrentIndex
  
      /// Creates a `CharSpan` that contains the next `idxTo` characters of a `CharStream` from its position.
      /// On the dynamic block character stream, it ensures that the characters in the span stay in memory.
  