Program: 130440
Project: 130440
Buggy source:
private static void parse(@NotNull CSharpBuilderWrapper builder,boolean root){
  PsiBuilder.Marker marker=builder.mark();
  Pair<PsiBuilder.Marker,ModifierSet> modifierListPair=parseWithSoftElements(new NotNullFunction<CSharpBuilderWrapper,Pair<PsiBuilder.Marker,ModifierSet>>(){
    @NotNull @Override public Pair<PsiBuilder.Marker,ModifierSet> fun(    CSharpBuilderWrapper builderWrapper){
      return parseModifierListWithAttributes(builderWrapper,STUB_SUPPORT);
    }
  }
,builder,PARTIAL_KEYWORD,ASYNC_KEYWORD);
  PsiBuilder.Marker modifierListMarker=modifierListPair.getFirst();
  ModifierSet modifierSet=modifierListPair.getSecond();
  IElementType tokenType=builder.getTokenType();
  if (tokenType == null) {
    if (modifierListPair.getSecond().isEmpty()) {
      marker.drop();
    }
 else {
      marker.error("String_Node_Str");
    }
    return;
  }
  if (tokenType == NAMESPACE_KEYWORD) {
    NamespaceDeclarationParsing.parse(builder,marker);
  }
 else   if (CSharpTokenSets.TYPE_DECLARATION_START.contains(tokenType)) {
    TypeDeclarationParsing.parse(builder,marker);
  }
 else   if (tokenType == EVENT_KEYWORD) {
    builder.advanceLexer();
    EventParsing.parse(builder,marker,modifierSet);
  }
 else   if (tokenType == DELEGATE_KEYWORD) {
    builder.advanceLexer();
    MethodParsing.parseMethodStartAtType(builder,marker,modifierSet);
  }
 else   if (tokenType == USING_KEYWORD) {
    UsingStatementParsing.parseUsingList(builder,marker);
  }
 else   if (tokenType == CONST_KEYWORD) {
    builder.advanceLexer();
    FieldOrPropertyParsing.parseFieldOrLocalVariableAtTypeWithDone(builder,marker,FIELD_DECLARATION,STUB_SUPPORT,true,modifierSet);
  }
 else {
    if (tokenType == CSharpTokens.IDENTIFIER && builder.lookAhead(1) == LPAR) {
      MethodParsing.parseMethodStartAfterType(builder,marker,null,MethodParsing.Target.CONSTRUCTOR,modifierSet);
    }
 else     if (tokenType == TILDE) {
      builder.advanceLexer();
      MethodParsing.parseMethodStartAfterType(builder,marker,null,MethodParsing.Target.DECONSTRUCTOR,modifierSet);
    }
 else {
      TypeInfo typeInfo=parseType(builder,STUB_SUPPORT);
      if (typeInfo == null) {
        if (!modifierSet.isEmpty()) {
          if (root) {
            marker.done(DUMMY_DECLARATION);
            return;
          }
          builder.error("String_Node_Str");
          marker.done(FIELD_DECLARATION);
          return;
        }
 else {
          modifierListMarker.drop();
        }
        marker.drop();
        advanceUnexpectedToken(builder);
      }
 else       if (builder.getTokenType() == OPERATOR_KEYWORD) {
        MethodParsing.parseMethodStartAfterType(builder,marker,typeInfo,MethodParsing.Target.METHOD,modifierSet);
      }
 else {
        TypeInfo implementType=parseImplementType(builder);
        if (implementType == null) {
          builder.error("String_Node_Str");
          parseAfterName(builder,marker,builder.getTokenType() == LBRACKET ? THIS_KEYWORD : null,modifierSet);
          return;
        }
        IElementType prevToken=null;
        if (builder.getTokenType() == DOT) {
          builder.advanceLexer();
          prevToken=builder.getTokenType();
          doneThisOrIdentifier(builder);
        }
 else {
          if (implementType.marker != null) {
            implementType.marker.rollbackTo();
          }
          prevToken=builder.getTokenType();
          doneThisOrIdentifier(builder);
        }
        parseAfterName(builder,marker,prevToken,modifierSet);
      }
    }
  }
}

Fixed version (ground truth):
private static void parse(@NotNull CSharpBuilderWrapper builder,boolean root){
  PsiBuilder.Marker marker=builder.mark();
  Pair<PsiBuilder.Marker,ModifierSet> modifierListPair=parseWithSoftElements(new NotNullFunction<CSharpBuilderWrapper,Pair<PsiBuilder.Marker,ModifierSet>>(){
    @NotNull @Override public Pair<PsiBuilder.Marker,ModifierSet> fun(    CSharpBuilderWrapper builderWrapper){
      return parseModifierListWithAttributes(builderWrapper,STUB_SUPPORT);
    }
  }
,builder,PARTIAL_KEYWORD,ASYNC_KEYWORD);
  PsiBuilder.Marker modifierListMarker=modifierListPair.getFirst();
  ModifierSet modifierSet=modifierListPair.getSecond();
  IElementType tokenType=builder.getTokenType();
  if (tokenType == null) {
    if (modifierListPair.getSecond().isEmpty()) {
      marker.drop();
    }
 else {
      if (root) {
        marker.done(DUMMY_DECLARATION);
      }
 else {
        marker.error("String_Node_Str");
      }
    }
    return;
  }
  if (tokenType == NAMESPACE_KEYWORD) {
    NamespaceDeclarationParsing.parse(builder,marker);
  }
 else   if (CSharpTokenSets.TYPE_DECLARATION_START.contains(tokenType)) {
    TypeDeclarationParsing.parse(builder,marker);
  }
 else   if (tokenType == EVENT_KEYWORD) {
    builder.advanceLexer();
    EventParsing.parse(builder,marker,modifierSet);
  }
 else   if (tokenType == DELEGATE_KEYWORD) {
    builder.advanceLexer();
    MethodParsing.parseMethodStartAtType(builder,marker,modifierSet);
  }
 else   if (tokenType == USING_KEYWORD) {
    UsingStatementParsing.parseUsingList(builder,marker);
  }
 else   if (tokenType == CONST_KEYWORD) {
    builder.advanceLexer();
    FieldOrPropertyParsing.parseFieldOrLocalVariableAtTypeWithDone(builder,marker,FIELD_DECLARATION,STUB_SUPPORT,true,modifierSet);
  }
 else {
    if (tokenType == CSharpTokens.IDENTIFIER && builder.lookAhead(1) == LPAR) {
      MethodParsing.parseMethodStartAfterType(builder,marker,null,MethodParsing.Target.CONSTRUCTOR,modifierSet);
    }
 else     if (tokenType == TILDE) {
      builder.advanceLexer();
      MethodParsing.parseMethodStartAfterType(builder,marker,null,MethodParsing.Target.DECONSTRUCTOR,modifierSet);
    }
 else {
      TypeInfo typeInfo=parseType(builder,STUB_SUPPORT);
      if (typeInfo == null) {
        if (!modifierSet.isEmpty()) {
          if (root) {
            marker.done(DUMMY_DECLARATION);
            return;
          }
          builder.error("String_Node_Str");
          marker.done(FIELD_DECLARATION);
          return;
        }
 else {
          modifierListMarker.drop();
        }
        marker.drop();
        advanceUnexpectedToken(builder);
      }
 else       if (builder.getTokenType() == OPERATOR_KEYWORD) {
        MethodParsing.parseMethodStartAfterType(builder,marker,typeInfo,MethodParsing.Target.METHOD,modifierSet);
      }
 else {
        TypeInfo implementType=parseImplementType(builder);
        if (implementType == null) {
          builder.error("String_Node_Str");
          parseAfterName(builder,marker,builder.getTokenType() == LBRACKET ? THIS_KEYWORD : null,modifierSet);
          return;
        }
        IElementType prevToken=null;
        if (builder.getTokenType() == DOT) {
          builder.advanceLexer();
          prevToken=builder.getTokenType();
          doneThisOrIdentifier(builder);
        }
 else {
          if (implementType.marker != null) {
            implementType.marker.rollbackTo();
          }
          prevToken=builder.getTokenType();
          doneThisOrIdentifier(builder);
        }
        parseAfterName(builder,marker,prevToken,modifierSet);
      }
    }
  }
}