IfStatementSyntax GenerateIfNameEqualsStatement() { return(SF.IfStatement( condition: SF.InvocationExpression( expression: Basics.SimpleMemberAccess(Basics.TryParseBsonNameIdentifier, SF.IdentifierName("SequenceEqual")), argumentList: Basics.Arguments(Basics.GenerateReadOnlySpanNameIdentifier(ClassSymbol, MemberDecl))), statement: SF.Block(GenerateIfBsonTypeNull(), GenerateMainOperationBlock(), SF.ContinueStatement()) )); }
IfStatementSyntax GenerateIfNameEqualsStatement() { var whileStatement = new SyntaxList <StatementSyntax>() .Add(SF.ParseStatement("if (!reader.TryGetByte(out var arrayType)) { return false; }")) .Add(SF.ParseStatement("if (!reader.TryGetCStringAsSpan(out var index)) { return false; }")) .Add(SF.ParseStatement($"if(arrayType == 10) {{ continue; }}")) .Add(GenerateRead()) .Add(SF.ParseStatement($"message.{MemberDecl.DeclSymbol.Name}.Add(value);")); return(SF.IfStatement( condition: SF.InvocationExpression( expression: Basics.SimpleMemberAccess(Basics.TryParseBsonNameIdentifier, SF.IdentifierName("SequenceEqual")), argumentList: Basics.Arguments(Basics.GenerateReadOnlySpanNameIdentifier(ClassSymbol, MemberDecl))), statement: SF.Block(GenerateIfBsonTypeNull(), SF.ParseStatement($"message.{MemberDecl.DeclSymbol.Name} = new List<{MemberDecl.GenericType.ToString()}>();"), SF.ParseStatement($"if (!reader.TryGetInt32(out var arrayDocLength)) {{ return false; }}"), SF.ParseStatement($"var arrayUnreaded = reader.Remaining + sizeof(int);"), SF.WhileStatement( attributeLists: default,