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:                 // avoid creating the intermediate array.
                  (tokenizerState.Accepted, Queue.toArray tokenizerState.Pending)
                  ||> Array.fold (fun accepted el -> el :: accepted);
              Pending = Queue.empty;
              LastFinalState = tokenizerState.CurrentState; }
  
      /// Gets the current token ('Symbol[]) and clears the list of
      /// accepted symbols from the tokenizer state.
  
negative.code:                 yield Choice1Of2 (regexIndex, token)
  
              | None ->
                  // If the last final DFA state is the initial DFA state and there
                  // are some symbols we could still parse, reject the first pending
                  // symbol and restart tokenizing.
                  if tokenizerState.LastFinalState = dfa.InitialState then
                      if not <| Queue.isEmpty tokenizerState.Pending then
                          let rejectedSymbol, pending = Queue.dequeue tokenizerState.Pending
                          yield Choice2Of2 [| rejectedSymbol |]
  
                          // Move the remaining pending symbols into the buffer.
                          let tokenizerState =
                              { tokenizerState with
                                  Pending = Queue.empty;
                                  Buffer = pending; }
  
                          // Start matching again at the initial DFA state.
                          let (), tokenizerState = TokenizerState.transition dfa.InitialState tokenizerState
                          let (), tokenizerState = TokenizerState.checkpoint tokenizerState
                          yield! tokenize symbolEnumerator tokenizerState
                  else
                      // 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
                      yield Choice1Of2 (regexIndex, token)
  
                      // Move the pending symbols into the buffer.
                      // They are placed at the front of the buffer to keep
                      // the symbols in the same order as they were in the symbol stream.
                      let tokenizerState =
                          { tokenizerState with
                              Pending = Queue.empty;
                              Buffer =
                                  // OPTIMIZE : Implement a Queue.fold function for this.
                                  let buffer = Queue.toArray tokenizerState.Buffer
                                  (tokenizerState.Pending, buffer)
                                  ||> Array.fold (fun buffer el ->
                                      Queue.enqueue el buffer); }
                      
                      // Start tokenizing again at the initial DFA state.
                      let (), tokenizerState = TokenizerState.transition dfa.InitialState tokenizerState
                      let (), tokenizerState = TokenizerState.markFinalState tokenizerState
                      yield! tokenize symbolEnumerator tokenizerState
  
          | Some symbol ->
  