private void synchronizePositions(boolean exact) {
    final PsiBuilder delegate = getDelegate();

    if (myLexPosition >= myShrunkSequence.size() || delegate.eof()) {
      myLexPosition = myShrunkSequence.size();
      while (!delegate.eof()) {
        delegate.advanceLexer();
      }
      return;
    }

    if (delegate.getCurrentOffset() > myShrunkSequence.get(myLexPosition).realStart) {
      LOG.error("delegate is ahead of my builder!",
                new Attachment("offset = " + delegate.getCurrentOffset(), getOriginalText().toString()),
                new Attachment("myShrunkSequence", myShrunkSequence.toString())
      );
      return;
    }

    final int keepUpPosition = getKeepUpPosition(exact);

    while (!delegate.eof()) {
      final int delegatePosition = delegate.getCurrentOffset();

      if (delegatePosition < keepUpPosition) {
        delegate.advanceLexer();
      }
      else {
        break;
      }
    }
  }
private void synchronizePositions(boolean exact)