anchor.diff:                  |> Option.bind (Map.tryFind symbol)
   
               match transitionTarget with
  +            | Some transitionTarget ->
  +                // If the current DFA state is a final (accepting) state,
  +                // mark it as the last final state.
  +                let (), tokenizerState =
  +                    if Map.containsKey tokenizerState.CurrentState dfa.FinalStates then
  +                        let (), tokenizerState = TokenizerState.markFinalState tokenizerState
  +                        TokenizerState.acceptPending tokenizerState
  +                    else
  +                        (), tokenizerState
  +
  +                // Add this symbol to the queue of pending symbols.
  +                let (), tokenizerState = TokenizerState.addPending symbol tokenizerState
  +
  +                // Set the transition target as the current DFA state,
  +                // then recurse to continue tokenizing.
  +                let (), tokenizerState = TokenizerState.transition transitionTarget tokenizerState
  +                yield! tokenize symbolEnumerator tokenizerState
  +
               | None ->
  -                // Add this symbol to the buffer so it will be reprocessed.
  -                let tokenizerState =
  -                    { tokenizerState with
  -                        Buffer = Queue.enqueue symbol tokenizerState.Buffer; }
  -
                   // If the current DFA state is a final (accepting) state,
                   // accept the current token.
                   match Map.tryFind tokenizerState.CurrentState dfa.FinalStates with
                   | Some regexIndex ->
  -                    let (), tokenizerState = TokenizerState.checkpoint tokenizerState
  +                    // Add this symbol to the buffer so it will be reprocessed.
  +                    let tokenizerState =
  +                        { tokenizerState with
  +                            Buffer = Queue.enqueue symbol tokenizerState.Buffer; }
  +
  +                    let (), tokenizerState = TokenizerState.markFinalState tokenizerState   // Is this necessary?
  +                    let (), tokenizerState = TokenizerState.acceptPending tokenizerState
                       let token, tokenizerState = TokenizerState.accept tokenizerState
   
                       // Emit the accepted token.
  
positive.code: /// </remarks>
  let tokenize (dfa : Dfa<'Symbol>) (symbols : seq<'Symbol>) : seq<Choice<int<RegexIndex> * 'Symbol[], 'Symbol[]>> =
      //
      let rec tokenize (symbolEnumerator : IEnumerator<'Symbol>) tokenizerState = seq {
          // Try to read a symbol from the stream or pending characters queue.
          let symbol, tokenizerState =
              // If the buffer contains any symbols, return the next symbol in
  
negative.code: 
                      // Start matching again at the initial DFA state.
                      let (), tokenizerState = TokenizerState.transition dfa.InitialState tokenizerState
                      let (), tokenizerState = TokenizerState.markFinalState tokenizerState
                      yield! tokenize symbolEnumerator tokenizerState
  
                  | None ->
                      // If the last final state is the initial state of the DFA, then the current
                      // sequence of characters does not match any of the input Regexes.
                      let token, tokenizerState =
                          if tokenizerState.LastFinalState = dfa.InitialState then
                              if Queue.isEmpty tokenizerState.Pending then
                                  // Reject the current symbol and restart tokenizing at the initial DFA state.
                                  Choice2Of2 [| symbol |], tokenizerState
                              else
                                  // Reject the first symbol in the pending queue.
                                  let rejectedSymbol, pending = Queue.dequeue tokenizerState.Pending
  
                                  // Add the current symbol to the pending queue,
                                  // which will be merged back into the buffer.
                                  let pending = Queue.enqueue symbol pending
  
                                  Choice2Of2 [| rejectedSymbol |],
                                  { tokenizerState with
                                      Pending = pending; }
                          else
                              // Add this symbol to the buffer so it will be reprocessed.
                              let tokenizerState =
                                  { tokenizerState with
                                      Buffer = Queue.enqueue symbol tokenizerState.Buffer; }
  
                              // Emit the current token (set at the last-encountered final state).
                              let token, tokenizerState = TokenizerState.accept tokenizerState
                              let regexIndex = Map.find tokenizerState.LastFinalState dfa.FinalStates
  