149 references to ParseStatement
Microsoft.AspNetCore.App.Analyzers.Test (2)
Infrastructure\AmbiguousRoutePatternComparerTests.cs (1)
81var parsedStatement = SyntaxFactory.ParseStatement(statement);
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
35var parsedStatement = SyntaxFactory.ParseStatement(statement);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
95var parsed = SyntaxFactory.ParseStatement(nextTrivia.ToFullString());
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
179StatementSyntax => SyntaxFactory.ParseStatement(textToParse, options: (CSharpParseOptions)tree.Options),
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (2)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (1)
35var parsedStatement = SyntaxFactory.ParseStatement(statement);
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
33var parsedStatement = SyntaxFactory.ParseStatement(statement);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (29)
Attributes\AttributeTests_RefReadOnly.cs (2)
1452var localfunction = SyntaxFactory.ParseStatement("int localFunction(in int x) { return x; }"); 1479var localfunction = SyntaxFactory.ParseStatement("ref readonly int localFunction(int x) { return ref x; }");
Semantics\OutVarTests.cs (14)
4000var statement = (DoStatementSyntax)SyntaxFactory.ParseStatement(@" 5106var statement = (ExpressionStatementSyntax)SyntaxFactory.ParseStatement(@" 8800var statement = (IfStatementSyntax)SyntaxFactory.ParseStatement(@" 9639var statement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(@" 10207var statement = (ExpressionStatementSyntax)SyntaxFactory.ParseStatement(@" 10856var statement = (LockStatementSyntax)SyntaxFactory.ParseStatement(@" 13336var statement = (ReturnStatementSyntax)SyntaxFactory.ParseStatement(@" 13735var statement = (SwitchStatementSyntax)SyntaxFactory.ParseStatement(@" 15256var statement = (ThrowStatementSyntax)SyntaxFactory.ParseStatement(@" 16534var statement = (WhileStatementSyntax)SyntaxFactory.ParseStatement(@" 17093var statement = (YieldStatementSyntax)SyntaxFactory.ParseStatement(@" 17529var statement = (LabeledStatementSyntax)SyntaxFactory.ParseStatement(@" 21295var statement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(@" 35665var statementAfter = SyntaxFactory.ParseStatement(@"G(out _);");
Semantics\PatternMatchingTests_Scope.cs (13)
403var statement = (ExpressionStatementSyntax)SyntaxFactory.ParseStatement(@" 708var statement = (ReturnStatementSyntax)SyntaxFactory.ParseStatement(@" 977var statement = (ThrowStatementSyntax)SyntaxFactory.ParseStatement(@" 1281var statement = (IfStatementSyntax)SyntaxFactory.ParseStatement(@" 5337var statement = (SwitchStatementSyntax)SyntaxFactory.ParseStatement(@" 6467var statement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(@" 6880var statement = (ExpressionStatementSyntax)SyntaxFactory.ParseStatement(@" 7207var statement = (WhileStatementSyntax)SyntaxFactory.ParseStatement(@" 7530var statement = (DoStatementSyntax)SyntaxFactory.ParseStatement(@" 9636var statement = (LockStatementSyntax)SyntaxFactory.ParseStatement(@" 10199var statement = (YieldStatementSyntax)SyntaxFactory.ParseStatement(@" 10715var statement = (LabeledStatementSyntax)SyntaxFactory.ParseStatement(@" 12142var statement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(@"
Microsoft.CodeAnalysis.CSharp.Features (1)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
348var newLabeledStatement = labeledStatement.ReplaceNode(newLocalDeclaration, SyntaxFactory.ParseStatement(""));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests.cs (1)
608var speculatedBlock = (BlockSyntax)SyntaxFactory.ParseStatement(@"
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (12)
Semantics\DelegateTypeTests.cs (1)
12119var stmt = SyntaxFactory.ParseStatement(text);
Semantics\ImplicitObjectCreationTests.cs (1)
4187var modifiedNode = (ExpressionStatementSyntax)SyntaxFactory.ParseStatement("M(new());", options: ImplicitObjectCreationTestOptions);
Semantics\InitOnlyMemberTests.cs (1)
3128var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@"
Semantics\LambdaTests.cs (1)
8084var newStmt = SyntaxFactory.ParseStatement("var lam = (int b = M1(4)) => b;");
Semantics\QueryTests.cs (5)
3414var queryStatement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(speculatedSource); 3458var queryStatement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(speculatedSource); 3505var queryStatement = SyntaxFactory.ParseStatement(speculatedSource); 3544var queryStatement = SyntaxFactory.ParseStatement(speculatedSource); 3588var queryStatement = SyntaxFactory.ParseStatement(speculatedSource);
Semantics\SuppressAccessibilityChecksTests.cs (2)
91var statement = SyntaxFactory.ParseStatement("var goo = new A().M();"); 203var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@"
Semantics\TopLevelStatementsTests.cs (1)
9704var nodeToSpeculate = SyntaxFactory.ParseStatement("int y = x;");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (44)
Compilation\SemanticModelAPITests.cs (29)
1766var statement = (BlockSyntax)SyntaxFactory.ParseStatement(@" 1832var statement = SyntaxFactory.ParseStatement(@"int z = 0;"); 1847statement = SyntaxFactory.ParseStatement(@"string y = null;"); 1873var labeledStatement = SyntaxFactory.ParseStatement(@"label: y++;"); 1905var switchStatement = (SwitchStatementSyntax)SyntaxFactory.ParseStatement(@" 1949var speculatedStatement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(@"Func<int, int> var = (z) => x + z;"); 1982var statement = (ForEachStatementSyntax)SyntaxFactory.ParseStatement(@" 2238newSpeculatedStatement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(@"int z = 0;"); 2261var unsafeStatement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement("int *p = &x;"); 2317var speculativeSyntax = SyntaxFactory.ParseStatement("return default(C);"); 2338var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@" 2433var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@" 2475var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@" 2520var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@" 2566var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@"{ int z = 0; }"); 2583blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@"{ string y = null; }"); 2597blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@"{ var y = x; }"); 2637var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@"{ label: y++; }"); 2674var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@"{ Func<int, int> var = (z) => x + z; }"); 2765var blockStatement = (BlockSyntax)SyntaxFactory.ParseStatement(@"{ 3158var yieldStatement = (YieldStatementSyntax)SyntaxFactory.ParseStatement("yield return 1;"); 3193var yieldStatement = (YieldStatementSyntax)SyntaxFactory.ParseStatement("yield return 1;"); 3264var statementSyntax = SyntaxFactory.ParseStatement("TakesOut(out int x);"); 3305var statementSyntax = SyntaxFactory.ParseStatement("TakesOut(out int x);"); 3380var statementSyntax = SyntaxFactory.ParseStatement("{ TakesOut(out int x); }"); 3422var statementSyntax = SyntaxFactory.ParseStatement("Method(o is string s);"); 3463var statementSyntax = SyntaxFactory.ParseStatement("Method(o is string s);"); 3788var @return = (ReturnStatementSyntax)SyntaxFactory.ParseStatement("return s;"); 4428var replacementIfStatement = (IfStatementSyntax)SyntaxFactory.ParseStatement(replacementSource);
Symbols\Source\FileModifierTests.cs (2)
3777var newBody = body.AddStatements(SyntaxFactory.ParseStatement("C.M();")); 3818var newBody = body.AddStatements(SyntaxFactory.ParseStatement("C.M();"));
Symbols\Source\NullablePublicAPITests.cs (13)
1162var newSource = (ExpressionStatementSyntax)SyntaxFactory.ParseStatement("_ = o;"); 1365var newSource = (BlockSyntax)SyntaxFactory.ParseStatement(@"{ string? s3 = null; _ = s1 == """" ? s1 : s1; }"); 1442var newSource = (BlockSyntax)SyntaxFactory.ParseStatement("{ var y = x ?? new object(); y.ToString(); }"); 2135var newDeclaration = SyntaxFactory.ParseStatement("var o5 = s2;"); 3700var @return = (ReturnStatementSyntax)SyntaxFactory.ParseStatement("return s;"); 3735var @return = (ReturnStatementSyntax)SyntaxFactory.ParseStatement("return s;"); 3778var newStatement = (ExpressionStatementSyntax)SyntaxFactory.ParseStatement("_ = o1;"); 4367var statement = SyntaxFactory.ParseStatement(@"M(out C c);"); 4395var statement = SyntaxFactory.ParseStatement(@"M(out C c);"); 4423var statement = SyntaxFactory.ParseStatement(@" 4453var statement = SyntaxFactory.ParseStatement(@" 4483var statement = SyntaxFactory.ParseStatement(@" 4911var newBody = SyntaxFactory.ParseStatement("Prop.ToString();");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (44)
Parsing\DeconstructionTests.cs (14)
1878var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 1891var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 1903var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 1915var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 1927var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 1944var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 1961var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 1975var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 1989var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 2005var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 2016var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 2027var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 2036var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature()); 2046var statement = SyntaxFactory.ParseStatement(text, offset: 0, options: TestOptions.Regular.WithTuplesFeature());
Parsing\ParserErrorMessageTests.cs (1)
6606var stmt = SyntaxFactory.ParseStatement(builder.ToString());
Parsing\ParsingTests.cs (1)
96var node = SyntaxFactory.ParseStatement(text, options: options);
Parsing\StatementParsingTests.cs (2)
23return SyntaxFactory.ParseStatement(text, offset, options); 3360var tree = SyntaxFactory.ParseStatement(text);
Syntax\SyntaxFactoryTests.cs (1)
570body: (BlockSyntax)SyntaxFactory.ParseStatement("{}"),
Syntax\SyntaxNodeTests.cs (20)
133var statement = SyntaxFactory.ParseStatement(text); 179var statement = SyntaxFactory.ParseStatement(text); 233var statement = SyntaxFactory.ParseStatement(text); 268var statement = SyntaxFactory.ParseStatement(text); 2149var ifstatement = (IfStatementSyntax)SyntaxFactory.ParseStatement("if (a < b) m(c)"); 2152var stat1 = SyntaxFactory.ParseStatement("m1(x)"); 2153var stat2 = SyntaxFactory.ParseStatement("m2(y)"); 2189var ifstatement = (IfStatementSyntax)SyntaxFactory.ParseStatement("if (a < b) m(c)"); 2192var stat1 = SyntaxFactory.ParseStatement("m1(x)"); 2193var stat2 = SyntaxFactory.ParseStatement("m2(y)"); 2205var block = (BlockSyntax)SyntaxFactory.ParseStatement("{ var x = 10; var y = 20; }"); 2206var stmt1 = SyntaxFactory.ParseStatement("var z = 30; "); 2207var stmt2 = SyntaxFactory.ParseStatement("var q = 40; "); 2229var block = (BlockSyntax)SyntaxFactory.ParseStatement("{ var x = 10; var y = 20; }"); 2230var stmt1 = SyntaxFactory.ParseStatement("var z = 30; "); 2231var stmt2 = SyntaxFactory.ParseStatement("var q = 40; "); 2338var expr = SyntaxFactory.ParseStatement(text); 2352var expr = SyntaxFactory.ParseStatement(text); 2692var expr = SyntaxFactory.ParseStatement("{ a; b; /* trivia */ c }"); 2706var expr = SyntaxFactory.ParseStatement("{ a; b; /* trivia */ c }");
Syntax\SyntaxNormalizerTests.cs (2)
941var node = SyntaxFactory.ParseStatement(text.NormalizeLineEndings()); 5966var syntaxNode = SyntaxFactory.ParseStatement(expression).NormalizeWhitespace();
Syntax\SyntaxRewriterTests.cs (3)
553var ifStmt1 = (IfStatementSyntax)SyntaxFactory.ParseStatement("if (true)"); 695var red = isExpr ? (CSharpSyntaxNode)SyntaxFactory.ParseExpression(input) : SyntaxFactory.ParseStatement(input); 708var red = isExpr ? (CSharpSyntaxNode)SyntaxFactory.ParseExpression(input) : SyntaxFactory.ParseStatement(input);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
95var parsed = SyntaxFactory.ParseStatement(nextTrivia.ToFullString());
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
26var parsedStatement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(statement, options: options);
Formatting\FormattingTests.cs (2)
4648SyntaxFactory.Block(SyntaxFactory.ParseStatement("return c;"))), 4651SyntaxFactory.Block(SyntaxFactory.ParseStatement("c = value;")))]));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
941list.Add(CS.SyntaxFactory.ParseStatement(p + delimiter));
Microsoft.DotNet.GenFacades (7)
NotSupportedAssemblyGenerator.cs (7)
124block = (BlockSyntax)SyntaxFactory.ParseStatement(emptyBody); 128block = (BlockSyntax)SyntaxFactory.ParseStatement(GetDefaultMessage()); 159BlockSyntax block = (BlockSyntax)SyntaxFactory.ParseStatement(GetDefaultMessage()); 165BlockSyntax block = (BlockSyntax)SyntaxFactory.ParseStatement(emptyBody); 175BlockSyntax block = (BlockSyntax)SyntaxFactory.ParseStatement(message); 185BlockSyntax block = (BlockSyntax)SyntaxFactory.ParseStatement(GetDefaultMessage()); 194BlockSyntax block = (BlockSyntax)SyntaxFactory.ParseStatement(GetDefaultMessage());