67 references to YieldStatementSyntax
Microsoft.CodeAnalysis.CSharp (14)
Binder\Binder_Statements.cs (6)
133result = BindYieldBreakStatement((YieldStatementSyntax)node, diagnostics); 136result = BindYieldReturnStatement((YieldStatementSyntax)node, diagnostics); 216private void CheckRequiredLangVersionForIteratorMethods(YieldStatementSyntax statement, BindingDiagnosticBag diagnostics) 230protected virtual void ValidateYield(YieldStatementSyntax node, BindingDiagnosticBag diagnostics) 235private BoundStatement BindYieldReturnStatement(YieldStatementSyntax node, BindingDiagnosticBag diagnostics) 276private BoundStatement BindYieldBreakStatement(YieldStatementSyntax node, BindingDiagnosticBag diagnostics)
Binder\ExpressionVariableFinder.cs (1)
197public override void VisitYieldStatement(YieldStatementSyntax node)
Binder\InMethodBinder.cs (1)
121protected override void ValidateYield(YieldStatementSyntax node, BindingDiagnosticBag diagnostics)
Binder\LocalBinderFactory.cs (1)
838public override void VisitYieldStatement(YieldStatementSyntax node)
Binder\WithLambdaParametersBinder.cs (1)
78protected override void ValidateYield(YieldStatementSyntax node, BindingDiagnosticBag diagnostics)
Syntax\LookupPosition.cs (2)
364return ((YieldStatementSyntax)statement).YieldKeyword; 442return ((YieldStatementSyntax)statement).SemicolonToken;
Syntax\YieldStatementSyntax.cs (2)
11public YieldStatementSyntax Update(SyntaxToken yieldKeyword, SyntaxToken returnOrBreakKeyword, ExpressionSyntax expression, SyntaxToken semicolonToken) 20public static YieldStatementSyntax YieldStatement(SyntaxKind kind, SyntaxToken yieldKeyword, SyntaxToken returnOrBreakKeyword, ExpressionSyntax expression, SyntaxToken semicolonToken)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
ParenthesizedExpressionSyntaxExtensions.cs (1)
144(nodeParent is YieldStatementSyntax(SyntaxKind.YieldReturnStatement) yieldStatement && yieldStatement.Expression == node) ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
CSharpAddYieldCodeFixProvider.cs (1)
78var yieldStatement = SyntaxFactory.YieldStatement(
CSharpTypeInferenceService.TypeInferrer.cs (3)
187YieldStatementSyntax yieldStatement => InferTypeInYieldStatement(yieldStatement), 254YieldStatementSyntax yieldStatement => InferTypeInYieldStatement(yieldStatement, token), 2022private IEnumerable<TypeInferenceInfo> InferTypeInYieldStatement(YieldStatementSyntax yieldStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Semantics\PatternMatchingTests_Scope.cs (2)
10199var statement = (YieldStatementSyntax)SyntaxFactory.ParseStatement(@"
Microsoft.CodeAnalysis.CSharp.Features (15)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (4)
287var yieldStatementsCount = memberDeclarationSyntax.DescendantNodes().OfType<YieldStatementSyntax>() 305(YieldStatementSyntax)statementCannotBeConverted, 324(YieldStatementSyntax)statementCannotBeConverted, 325yieldBreakStatement: (YieldStatementSyntax)lastNonLocalFunctionStatement);
ConvertLinq\ConvertForEachToLinqQuery\YieldReturnConverter.cs (4)
17private readonly YieldStatementSyntax _yieldReturnStatement; 18private readonly YieldStatementSyntax _yieldBreakStatement; 22YieldStatementSyntax yieldReturnStatement, 23YieldStatementSyntax yieldBreakStatement)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
776var yieldBreakStatement = SyntaxFactory.YieldStatement(SyntaxKind.YieldBreakStatement);
CSharpAddYieldCodeFixProvider.cs (1)
78var yieldStatement = SyntaxFactory.YieldStatement(
EditAndContinue\SyntaxUtilities.cs (2)
290/// <see cref="YieldStatementSyntax"/> for yield return statements, 300=> body.DescendantNodesAndSelf(LambdaUtilities.IsNotLambda).Any(n => n is YieldStatementSyntax);
Highlighting\KeywordHighlighters\YieldStatementHighlighter.cs (3)
22internal class YieldStatementHighlighter : AbstractKeywordHighlighter<YieldStatementSyntax> 31YieldStatementSyntax yieldStatement, List<TextSpan> spans, CancellationToken cancellationToken) 52case YieldStatementSyntax statement:
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IReturnStatement.cs (2)
85VerifyOperationTreeAndDiagnosticsForTest<YieldStatementSyntax>(source, expectedOperationTree, expectedDiagnostics); 110VerifyOperationTreeAndDiagnosticsForTest<YieldStatementSyntax>(source, expectedOperationTree, expectedDiagnostics);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (10)
Semantics\IteratorTests.cs (8)
327var yieldNode = (YieldStatementSyntax)tree.GetRoot().DescendantNodes().Where(n => n is YieldStatementSyntax).SingleOrDefault(); 350var yieldNode = (YieldStatementSyntax)tree.GetRoot().DescendantNodes().Where(n => n is YieldStatementSyntax).SingleOrDefault(); 447var node = tree.GetRoot().DescendantNodes().OfType<YieldStatementSyntax>().First();
Semantics\OutVarTests.cs (2)
17093var statement = (YieldStatementSyntax)SyntaxFactory.ParseStatement(@"
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\SemanticModelAPITests.cs (4)
3158var yieldStatement = (YieldStatementSyntax)SyntaxFactory.ParseStatement("yield return 1;"); 3193var yieldStatement = (YieldStatementSyntax)SyntaxFactory.ParseStatement("yield return 1;");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (9)
Generated\Syntax.Test.xml.Generated.cs (5)
10352private static YieldStatementSyntax GenerateYieldStatement() 12149var node = GenerateYieldStatement(); 12156var newNode = node.WithAttributeLists(node.AttributeLists).WithYieldKeyword(node.YieldKeyword).WithReturnOrBreakKeyword(node.ReturnOrBreakKeyword).WithExpression(node.Expression).WithSemicolonToken(node.SemicolonToken); 16921var oldNode = GenerateYieldStatement(); 16937var oldNode = GenerateYieldStatement();
Parsing\StatementParsingTests.cs (4)
1145var ys = (YieldStatementSyntax)statement; 1169var ys = (YieldStatementSyntax)statement;
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
CSharpTypeInferenceService.TypeInferrer.cs (3)
187YieldStatementSyntax yieldStatement => InferTypeInYieldStatement(yieldStatement), 254YieldStatementSyntax yieldStatement => InferTypeInYieldStatement(yieldStatement, token), 2022private IEnumerable<TypeInferenceInfo> InferTypeInYieldStatement(YieldStatementSyntax yieldStatement, SyntaxToken? previousToken = null)
ParenthesizedExpressionSyntaxExtensions.cs (1)
144(nodeParent is YieldStatementSyntax(SyntaxKind.YieldReturnStatement) yieldStatement && yieldStatement.Expression == node) ||
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
546VerifySyntax<YieldStatementSyntax>(Generator.YieldReturnStatement(Generator.LiteralExpression(1)), "yield return 1;"); 547VerifySyntax<YieldStatementSyntax>(Generator.YieldReturnStatement(Generator.IdentifierName("x")), "yield return x;");