Program: 130526
Project: 130526
Buggy source:
@Nullable private static PsiBuilder.Marker parsePrimary(final CSharpBuilderWrapper builder,@Nullable final BreakPoint breakPoint,final int breakOffset){
  PsiBuilder.Marker startMarker=builder.mark();
  PsiBuilder.Marker expr=parsePrimaryExpressionStart(builder);
  if (expr == null) {
    startMarker.drop();
    return null;
  }
  while (true) {
    final IElementType tokenType=builder.getTokenType();
    if (tokenType == DOT) {
      final PsiBuilder.Marker dotPos=builder.mark();
      final int dotOffset=builder.getCurrentOffset();
      builder.advanceLexer();
      IElementType dotTokenType=builder.getTokenType();
      if (dotTokenType == NEW_KEYWORD) {
        dotPos.drop();
        expr=parseNewExpression(builder,expr);
      }
 else       if (dotTokenType == BASE_KEYWORD) {
        dotPos.drop();
        final PsiBuilder.Marker refExpr=expr.precede();
        builder.advanceLexer();
        refExpr.done(REFERENCE_EXPRESSION);
        expr=refExpr;
      }
 else {
        dotPos.drop();
        final PsiBuilder.Marker refExpr=expr.precede();
        if (!expect(builder,ID_OR_SUPER,"String_Node_Str")) {
          refExpr.done(REFERENCE_EXPRESSION);
          startMarker.drop();
          return refExpr;
        }
        refExpr.done(REFERENCE_EXPRESSION);
        expr=refExpr;
      }
    }
 else     if (tokenType == LT) {
      if (exprType(expr) != REFERENCE_EXPRESSION) {
        startMarker.drop();
        return expr;
      }
      final PsiBuilder.Marker callExpr=expr.precede();
      PsiBuilder.Marker argumentMark=builder.mark();
      builder.advanceLexer();
      parseTypeList(builder,false);
      expect(builder,GT,"String_Node_Str");
      argumentMark.done(TYPE_ARGUMENTS);
      if (builder.getTokenType() == LPAR) {
        parseArgumentList(builder);
        callExpr.done(METHOD_CALL_EXPRESSION);
        expr=callExpr;
      }
 else {
        callExpr.drop();
        startMarker.drop();
        return expr;
      }
    }
 else     if (tokenType == LPAR) {
      if (exprType(expr) != REFERENCE_EXPRESSION) {
        startMarker.drop();
        return expr;
      }
      final PsiBuilder.Marker callExpr=expr.precede();
      parseArgumentList(builder);
      callExpr.done(METHOD_CALL_EXPRESSION);
      expr=callExpr;
    }
 else     if (tokenType == LBRACKET) {
      if (breakPoint == BreakPoint.P4) {
        startMarker.drop();
        return expr;
      }
      builder.advanceLexer();
      final PsiBuilder.Marker arrayAccess=expr.precede();
      while (true) {
        final PsiBuilder.Marker index=parse(builder);
        if (index == null) {
          builder.error("String_Node_Str");
        }
        if (builder.getTokenType() != COMMA) {
          break;
        }
 else {
          builder.advanceLexer();
        }
      }
      if (builder.getTokenType() != RBRACKET) {
        builder.error("String_Node_Str");
        arrayAccess.done(ARRAY_ACCESS_EXPRESSION);
        startMarker.drop();
        return arrayAccess;
      }
      builder.advanceLexer();
      arrayAccess.done(ARRAY_ACCESS_EXPRESSION);
      expr=arrayAccess;
    }
 else {
      startMarker.drop();
      return expr;
    }
  }
}

Fixed version (ground truth):
@Nullable private static PsiBuilder.Marker parsePrimary(final CSharpBuilderWrapper builder,@Nullable final BreakPoint breakPoint,final int breakOffset){
  PsiBuilder.Marker startMarker=builder.mark();
  PsiBuilder.Marker expr=parsePrimaryExpressionStart(builder);
  if (expr == null) {
    startMarker.drop();
    return null;
  }
  while (true) {
    final IElementType tokenType=builder.getTokenType();
    if (tokenType == DOT) {
      final PsiBuilder.Marker dotPos=builder.mark();
      final int dotOffset=builder.getCurrentOffset();
      builder.advanceLexer();
      IElementType dotTokenType=builder.getTokenType();
      if (dotTokenType == NEW_KEYWORD) {
        dotPos.drop();
        expr=parseNewExpression(builder,expr);
      }
 else       if (dotTokenType == BASE_KEYWORD) {
        dotPos.drop();
        final PsiBuilder.Marker refExpr=expr.precede();
        builder.advanceLexer();
        refExpr.done(REFERENCE_EXPRESSION);
        expr=refExpr;
      }
 else {
        dotPos.drop();
        final PsiBuilder.Marker refExpr=expr.precede();
        if (!expect(builder,ID_OR_SUPER,"String_Node_Str")) {
          refExpr.done(REFERENCE_EXPRESSION);
          startMarker.drop();
          return refExpr;
        }
        refExpr.done(REFERENCE_EXPRESSION);
        expr=refExpr;
      }
    }
 else     if (tokenType == LT) {
      if (exprType(expr) != REFERENCE_EXPRESSION) {
        startMarker.drop();
        return expr;
      }
      final PsiBuilder.Marker callExpr=expr.precede();
      PsiBuilder.Marker argumentMark=builder.mark();
      builder.advanceLexer();
      parseTypeList(builder,false);
      expect(builder,GT,"String_Node_Str");
      argumentMark.done(TYPE_ARGUMENTS);
      if (builder.getTokenType() == LPAR) {
        parseArgumentList(builder);
        callExpr.done(METHOD_CALL_EXPRESSION);
        expr=callExpr;
      }
 else {
        argumentMark.rollbackTo();
        callExpr.drop();
        startMarker.drop();
        return expr;
      }
    }
 else     if (tokenType == LPAR) {
      if (exprType(expr) != REFERENCE_EXPRESSION) {
        startMarker.drop();
        return expr;
      }
      final PsiBuilder.Marker callExpr=expr.precede();
      parseArgumentList(builder);
      callExpr.done(METHOD_CALL_EXPRESSION);
      expr=callExpr;
    }
 else     if (tokenType == LBRACKET) {
      if (breakPoint == BreakPoint.P4) {
        startMarker.drop();
        return expr;
      }
      builder.advanceLexer();
      final PsiBuilder.Marker arrayAccess=expr.precede();
      while (true) {
        final PsiBuilder.Marker index=parse(builder);
        if (index == null) {
          builder.error("String_Node_Str");
        }
        if (builder.getTokenType() != COMMA) {
          break;
        }
 else {
          builder.advanceLexer();
        }
      }
      if (builder.getTokenType() != RBRACKET) {
        builder.error("String_Node_Str");
        arrayAccess.done(ARRAY_ACCESS_EXPRESSION);
        startMarker.drop();
        return arrayAccess;
      }
      builder.advanceLexer();
      arrayAccess.done(ARRAY_ACCESS_EXPRESSION);
      expr=arrayAccess;
    }
 else {
      startMarker.drop();
      return expr;
    }
  }
}