anchor.diff:   // Dead state? If yes, ...
    if (n=0) and (Flags=0) then begin
     // ... drop it and take the dead state as the next state
  -  result:=DefaultStates[skDead];
  +  result:=DefaultStates[dskDead];
     exit;
    end;
   
  
positive.code:     StartInstruction:PFLREInstruction;
      LocalInput:pansichar;
      LocalByteMap:PFLREByteMap;
      Flags,PreviousChar:longword;
  begin
   result:=DFAFail;
   LocalInput:=ThreadLocalStorageInstance.Input;
   LocalByteMap:=@Instance.ByteMap;
   if StartPosition<=0 then begin
    Start:=skBeginText;
    Flags:=sfEmptyBeginText or sfEmptyBeginLine;
   end else begin
    if rfUTF8 in Instance.Flags then begin
     PreviousPosition:=StartPosition;
     UTF8PtrDec(LocalInput,ThreadLocalStorageInstance.InputLength,PreviousPosition);
     if (PreviousPosition>=0) and (PreviousPosition<=ThreadLocalStorageInstance.InputLength) then begin
      PreviousChar:=UTF8PtrCodeUnitGetCharFallback(LocalInput,ThreadLocalStorageInstance.InputLength,PreviousPosition);
     end else begin
      PreviousChar:=$ffffffff;
     end;
    end else begin
     PreviousChar:=byte(ansichar(LocalInput[StartPosition-1]));
    end;
    case PreviousChar of
     $0a,$0d,$85,$2028,$2029:begin
      Start:=skBeginLine;
      Flags:=sfEmptyBeginLine;
     end;
     else begin
      if Instance.IsWordChar(PreviousChar) then begin
       Start:=skAfterWordChar;
       Flags:=sfDFALastWord;
      end else begin
       Start:=skAfterNonWordChar;
       Flags:=0;
      end;
     end;
    end;
   end;
   if UnanchoredStart then begin
    StartInstruction:=Instance.UnanchoredStartInstruction;
    inc(Start,skUnanchored);
   end else begin
    StartInstruction:=Instance.AnchoredStartInstruction;
    inc(Start,skAnchored);
   end;
   StartState:=@DefaultStates[Start];
   if assigned(StartState^) then begin
    State:=StartState^;
   end else begin
    inc(Generation);
    GetMem(State,StateSize);
    FillChar(State^,StateSize,AnsiChar(#0));
    FullAddInstructionThread(State,StartInstruction,ThreadLocalStorageInstance.GetSatisfyFlags(StartPosition));
    State^.Flags:=Flags or sfDFAStart;
    StateCache.Add(State);
    inc(CountStatesCached);
    StartState^:=State;
   end;
   for Position:=StartPosition to UntilExcludingPosition-1 do begin
    LastState:=State;
    State:=State^.NextStates[LocalByteMap[byte(ansichar(LocalInput[Position]))]];
    if not assigned(State) then begin
     State:=FullProcessNextState(LastState,Position,byte(ansichar(LocalInput[Position])),false);
     if not assigned(State) then begin
      result:=DFAError;
      exit;
  
negative.code:  end;
  
   NewState.Flags:=Flags or (NeedFlags shl sfDFANeedShift);
   NewState.Instructions:=copy(QueueInstructionArray,0,n);
   NewState.CountInstructions:=n;
  
   result:=CacheState(@NewState);
  
  