70 references to YieldStatementSyntax
Microsoft.CodeAnalysis.CSharp (15)
Binder\Binder_Statements.cs (6)
134result = BindYieldBreakStatement((YieldStatementSyntax)node, diagnostics); 137result = BindYieldReturnStatement((YieldStatementSyntax)node, diagnostics); 215private void CheckRequiredLangVersionForIteratorMethods(YieldStatementSyntax statement, BindingDiagnosticBag diagnostics) 229protected virtual void ValidateYield(YieldStatementSyntax node, BindingDiagnosticBag diagnostics) 234private BoundStatement BindYieldReturnStatement(YieldStatementSyntax node, BindingDiagnosticBag diagnostics) 279private BoundStatement BindYieldBreakStatement(YieldStatementSyntax node, BindingDiagnosticBag diagnostics)
Binder\ExpressionVariableFinder.cs (1)
188public override void VisitYieldStatement(YieldStatementSyntax node)
Binder\InMethodBinder.cs (1)
121protected override void ValidateYield(YieldStatementSyntax node, BindingDiagnosticBag diagnostics)
Binder\LocalBinderFactory.cs (1)
923public override void VisitYieldStatement(YieldStatementSyntax node)
Binder\WithLambdaParametersBinder.cs (1)
78protected override void ValidateYield(YieldStatementSyntax node, BindingDiagnosticBag diagnostics)
Parser\LanguageParser.cs (1)
9624private YieldStatementSyntax ParseYieldStatement(SyntaxList<AttributeListSyntax> attributes)
Syntax\LookupPosition.cs (2)
364return ((YieldStatementSyntax)statement).YieldKeyword; 440return ((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 (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
138(nodeParent is YieldStatementSyntax(SyntaxKind.YieldReturnStatement) yieldStatement && yieldStatement.Expression == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
449=> node.DescendantNodes(n => n == node || !n.IsReturnableConstruct()).Any(n => n is YieldStatementSyntax);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
74var yieldStatement = SyntaxFactory.YieldStatement(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
185YieldStatementSyntax yieldStatement => InferTypeInYieldStatement(yieldStatement), 252YieldStatementSyntax yieldStatement => InferTypeInYieldStatement(yieldStatement, token), 1965private IEnumerable<TypeInferenceInfo> InferTypeInYieldStatement(YieldStatementSyntax yieldStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\OutVarTests.cs (2)
17093var statement = (YieldStatementSyntax)SyntaxFactory.ParseStatement(@"
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)
17YieldStatementSyntax yieldReturnStatement, 18YieldStatementSyntax yieldBreakStatement) : AbstractConverter(forEachInfo) 20private readonly YieldStatementSyntax _yieldReturnStatement = yieldReturnStatement; 21private readonly YieldStatementSyntax _yieldBreakStatement = yieldBreakStatement;
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
768var yieldBreakStatement = YieldStatement(SyntaxKind.YieldBreakStatement);
EditAndContinue\SyntaxUtilities.cs (2)
235/// <see cref="YieldStatementSyntax"/> for yield return statements, 245=> 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:
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
74var yieldStatement = SyntaxFactory.YieldStatement(
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 (8)
Semantics\IteratorTests.cs (8)
458var yieldNode = (YieldStatementSyntax)tree.GetRoot().DescendantNodes().Where(n => n is YieldStatementSyntax).SingleOrDefault(); 481var yieldNode = (YieldStatementSyntax)tree.GetRoot().DescendantNodes().Where(n => n is YieldStatementSyntax).SingleOrDefault(); 578var node = tree.GetRoot().DescendantNodes().OfType<YieldStatementSyntax>().First();
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)
10604private static YieldStatementSyntax GenerateYieldStatement() 12450var node = GenerateYieldStatement(); 12457var newNode = node.WithAttributeLists(node.AttributeLists).WithYieldKeyword(node.YieldKeyword).WithReturnOrBreakKeyword(node.ReturnOrBreakKeyword).WithExpression(node.Expression).WithSemicolonToken(node.SemicolonToken); 17349var oldNode = GenerateYieldStatement(); 17365var oldNode = GenerateYieldStatement();
Parsing\StatementParsingTests.cs (4)
1145var ys = (YieldStatementSyntax)statement; 1169var ys = (YieldStatementSyntax)statement;
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
138(nodeParent is YieldStatementSyntax(SyntaxKind.YieldReturnStatement) yieldStatement && yieldStatement.Expression == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
449=> node.DescendantNodes(n => n == node || !n.IsReturnableConstruct()).Any(n => n is YieldStatementSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
185YieldStatementSyntax yieldStatement => InferTypeInYieldStatement(yieldStatement), 252YieldStatementSyntax yieldStatement => InferTypeInYieldStatement(yieldStatement, token), 1965private IEnumerable<TypeInferenceInfo> InferTypeInYieldStatement(YieldStatementSyntax yieldStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
545VerifySyntax<YieldStatementSyntax>(Generator.YieldReturnStatement(Generator.LiteralExpression(1)), "yield return 1;"); 546VerifySyntax<YieldStatementSyntax>(Generator.YieldReturnStatement(Generator.IdentifierName("x")), "yield return x;");