298 references to ParseExpression
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Formatting\FormattingEngineTests.cs (1)
1736
var node = SyntaxFactory.
ParseExpression
(code);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenCheckedTests.cs (2)
2918
var nodeToSpeculate = SyntaxFactory.
ParseExpression
("x + y");
2950
var nodeToSpeculate = SyntaxFactory.
ParseExpression
("x + y");
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
Attributes\AttributeTests_RefReadOnly.cs (2)
1381
var newInvocation = SyntaxFactory.
ParseExpression
("Process((in int x) => x)");
1423
var newInvocation = SyntaxFactory.
ParseExpression
("Process(() => ref x)");
Semantics\OutVarTests.cs (4)
34287
SyntaxFactory.
ParseExpression
($"TakeOutParam(true, out var x{i + 1})"),
34289
SyntaxFactory.
ParseExpression
($"x{i + 1}")
34501
SyntaxFactory.
ParseExpression
($"TakeOutParam(true, out var x{i + 1})"),
34503
SyntaxFactory.
ParseExpression
($"x{i + 1}")
Semantics\PatternMatchingTests.cs (4)
4173
SyntaxFactory.
ParseExpression
("A is B < C, D > E").GetDiagnostics().Verify();
4174
SyntaxFactory.
ParseExpression
("A as B < C, D > E").GetDiagnostics().Verify(
4180
SyntaxFactory.
ParseExpression
("A as B < C, D > ?? string.Empty").GetDiagnostics().Verify();
4181
SyntaxFactory.
ParseExpression
("A is B < C, D > ?? string.Empty").GetDiagnostics().Verify(
Microsoft.CodeAnalysis.CSharp.Features (5)
ChangeSignature\CSharpChangeSignatureService.cs (1)
648
? EqualsValueClause(
ParseExpression
(addedParameter.DefaultValue))
ConvertToInterpolatedString\CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
31
=> SyntaxFactory.
ParseExpression
(text);
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
247
var parsed = (InterpolatedStringExpressionSyntax)
ParseExpression
(indentedText.ToString(), options: stringExpression.SyntaxTree.Options);
Debugging\CSharpProximityExpressionsService.cs (1)
55
var expression = SyntaxFactory.
ParseExpression
(expressionValue);
ReplaceDocCommentTextWithTag\CSharpReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
33
=> SyntaxFactory.
ParseExpression
(text);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (3)
IOperation\IOperationTests_IVariableDeclaration.cs (3)
2303
.WithSizes(SyntaxFactory.SeparatedList<ExpressionSyntax>(SyntaxFactory.NodeOrTokenList(SyntaxFactory.
ParseExpression
("y switch { int z => 42 }"))));
2364
.WithSizes(SyntaxFactory.SeparatedList<ExpressionSyntax>(SyntaxFactory.NodeOrTokenList(SyntaxFactory.
ParseExpression
("y switch { int z => 42 }"))));
2832
.WithSizes(SyntaxFactory.SeparatedList<ExpressionSyntax>(SyntaxFactory.NodeOrTokenList(SyntaxFactory.
ParseExpression
("y switch { int z => 42 }"))));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\ImplicitObjectCreationTests.cs (1)
4160
var newExpression = SyntaxFactory.
ParseExpression
("new()");
Semantics\LambdaTests.cs (1)
946
SyntaxFactory.
ParseExpression
("Goo(() => () => { var x = null; return x; })"), // cast removed
Semantics\QueryTests.cs (1)
2300
var info = semanticModel.GetSpeculativeTypeInfo(selectExpression.SpanStart, SyntaxFactory.
ParseExpression
("x"), SpeculativeBindingOption.BindAsExpression);
Semantics\SuppressAccessibilityChecksTests.cs (3)
75
var exp = SyntaxFactory.
ParseExpression
("new A().M()._num");
126
SyntaxFactory.
ParseExpression
("a._p"),
174
var speculativeInvocation = SyntaxFactory.
ParseExpression
("new A().InternalExtension(67)");
Semantics\TargetTypedDefaultTests.cs (1)
2484
var expressionSyntax = SyntaxFactory.
ParseExpression
("default");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (40)
Compilation\CompilationAPITests.cs (1)
787
SyntaxTree withExpressionRootTree = SyntaxFactory.
ParseExpression
(s3).SyntaxTree;
Compilation\GetSemanticInfoTests.cs (8)
3786
var syntax = SyntaxFactory.
ParseExpression
(" C.M"); //Leading trivia was significant for triggering an assert before the fix.
3819
var syntax = SyntaxFactory.
ParseExpression
(" C.M"); //Leading trivia was significant for triggering an assert before the fix.
3913
var syntax = SyntaxFactory.
ParseExpression
(" a.P"); //Leading trivia was significant for triggering an assert before the fix.
3953
var syntax = SyntaxFactory.
ParseExpression
(" a.P"); //Leading trivia was significant for triggering an assert before the fix.
4066
var speculativeSyntax = SyntaxFactory.
ParseExpression
("fields.Any((field => field.IsStatic))"); //cast removed
4322
var speculativeSyntax = SyntaxFactory.
ParseExpression
("new List { 1, 2 }");
4876
var newSyntax = SyntaxFactory.
ParseExpression
("Instance.GetList().OfType<D>().Any()");
6012
var syntax = SyntaxFactory.
ParseExpression
("base");
Compilation\SemanticModelAPITests.cs (14)
1420
var equalsValue = SyntaxFactory.EqualsValueClause(SyntaxFactory.
ParseExpression
(@"(string)""Hello"""));
1462
var newEqualsValue = SyntaxFactory.EqualsValueClause(SyntaxFactory.
ParseExpression
("(short)0"));
1510
var newEqualsValue = SyntaxFactory.EqualsValueClause(SyntaxFactory.
ParseExpression
("(short)0"));
1557
var newEqualsValue = SyntaxFactory.EqualsValueClause(SyntaxFactory.
ParseExpression
("E.B | E.A"));
1598
var newEqualsValue = SyntaxFactory.EqualsValueClause(SyntaxFactory.
ParseExpression
("(short)0"));
1679
var newExpressionBody = SyntaxFactory.ArrowExpressionClause(SyntaxFactory.
ParseExpression
(@"(string)""Hello"""));
2030
SyntaxFactory.
ParseExpression
("this.y"));
2091
var newArgument = SyntaxFactory.
ParseExpression
("1");
2108
newArgument = SyntaxFactory.
ParseExpression
("(string) 1");
2191
var speculatedStatement = statement.ReplaceNode(initializer.Value, SyntaxFactory.
ParseExpression
("0"));
2225
var speculatedStatement = statement.ReplaceNode(expression, SyntaxFactory.
ParseExpression
("0"));
2233
var newSpeculatedStatement = statement.ReplaceNode(expression, SyntaxFactory.
ParseExpression
("1.1"));
3346
var statementSyntax = SyntaxFactory.
ParseExpression
("TakesOut(out int x)");
3504
var statementSyntax = SyntaxFactory.
ParseExpression
("Method(o is string s)");
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
4089
var expression = SyntaxFactory.
ParseExpression
("B");
Symbols\AnonymousTypesSymbolTests.cs (1)
1478
var expr1 = SyntaxFactory.
ParseExpression
("new { x = 1, y" + i.ToString() + " = \"---\" }");
Symbols\CheckedUserDefinedOperatorsTests.cs (4)
7432
var xNodeToSpeculate = SyntaxFactory.
ParseExpression
("-x");
7433
var yNodeToSpeculate = SyntaxFactory.
ParseExpression
("-y");
7496
var xNodeToSpeculate = SyntaxFactory.
ParseExpression
("-x");
7497
var yNodeToSpeculate = SyntaxFactory.
ParseExpression
("-y");
Symbols\ConversionTests.cs (1)
422
ExpressionSyntax sourceExpression5 = SyntaxFactory.
ParseExpression
("100L");
Symbols\Source\NullablePublicAPITests.cs (10)
1372
var newReference = (IdentifierNameSyntax)SyntaxFactory.
ParseExpression
(@"s1");
1373
var newCoalesce = (AssignmentExpressionSyntax)SyntaxFactory.
ParseExpression
(@"s3 ??= s1", options: TestOptions.Regular8);
1517
var newReference = (IdentifierNameSyntax)SyntaxFactory.
ParseExpression
(@"s1");
1518
var newCoalesce = (AssignmentExpressionSyntax)SyntaxFactory.
ParseExpression
(@"s1 ??= """"");
1573
var newReference = (IdentifierNameSyntax)SyntaxFactory.
ParseExpression
(@"Prop");
1574
var newCoalesce = (AssignmentExpressionSyntax)SyntaxFactory.
ParseExpression
(@"Prop ??= """"");
4069
var speculativeInitializer = SyntaxFactory.EqualsValueClause(SyntaxFactory.
ParseExpression
("o1"));
4578
var arrow = SyntaxFactory.ArrowExpressionClause(SyntaxFactory.
ParseExpression
(" M(out C c)"));
4606
var arrow = SyntaxFactory.ArrowExpressionClause(SyntaxFactory.
ParseExpression
(@"
4701
var expression = SyntaxFactory.
ParseExpression
(@"M(out C c)");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (203)
Parsing\AsyncParsingTests.cs (1)
26
return SyntaxFactory.
ParseExpression
(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp5));
Parsing\AsyncStreamsParsingTests.cs (1)
27
return SyntaxFactory.
ParseExpression
(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp8));
Parsing\AwaitParsingTests.cs (1)
24
return SyntaxFactory.
ParseExpression
(text);
Parsing\ExpressionParsingTests.cs (2)
27
return SyntaxFactory.
ParseExpression
(text, options: options);
2988
var expr = SyntaxFactory.
ParseExpression
(text);
Parsing\LambdaAttributeParsingTests.cs (1)
29
return SyntaxFactory.
ParseExpression
(text, options: options);
Parsing\LambdaParameterParsingTests.cs (1)
27
return SyntaxFactory.
ParseExpression
(text, options: options);
Parsing\LambdaReturnTypeParsingTests.cs (1)
23
return SyntaxFactory.
ParseExpression
(text, options: options);
Parsing\LineSpanDirectiveParsingTests.cs (1)
25
return SyntaxFactory.
ParseExpression
(text, options: options);
Parsing\ParserErrorMessageTests.cs (1)
6579
var expr = SyntaxFactory.
ParseExpression
(builder.ToString());
Parsing\ParserRegressionTests.cs (1)
178
SyntaxFactory.
ParseExpression
(code);
Parsing\ParsingTests.cs (1)
123
UsingNode(text, SyntaxFactory.
ParseExpression
(text, options: options), expectedErrors);
Parsing\PatternParsingTests.cs (16)
229
UsingNode(SyntaxFactory.
ParseExpression
("A is B < C, D > [ ]"));
274
UsingNode(SyntaxFactory.
ParseExpression
("A < B > C"));
302
SyntaxFactory.
ParseExpression
("e is A<B> && e").GetDiagnostics().Verify();
303
SyntaxFactory.
ParseExpression
("e is A<B> || e").GetDiagnostics().Verify();
304
SyntaxFactory.
ParseExpression
("e is A<B> ^ e").GetDiagnostics().Verify();
305
SyntaxFactory.
ParseExpression
("e is A<B> | e").GetDiagnostics().Verify();
306
SyntaxFactory.
ParseExpression
("e is A<B> & e").GetDiagnostics().Verify();
307
SyntaxFactory.
ParseExpression
("e is A<B>[]").GetDiagnostics().Verify();
308
SyntaxFactory.
ParseExpression
("new { X = e is A<B> }").GetDiagnostics().Verify();
309
SyntaxFactory.
ParseExpression
("e is A<B>").GetDiagnostics().Verify();
311
SyntaxFactory.
ParseExpression
("(item is Dictionary<string, object>[])").GetDiagnostics().Verify();
312
SyntaxFactory.
ParseExpression
("A is B < C, D > [ ]").GetDiagnostics().Verify();
313
SyntaxFactory.
ParseExpression
("A is B < C, D > [ ] E").GetDiagnostics().Verify();
314
SyntaxFactory.
ParseExpression
("A < B > C").GetDiagnostics().Verify();
320
SyntaxFactory.
ParseExpression
("from s in a where s is string where s.Length > 1 select s").GetDiagnostics().Verify();
321
SyntaxFactory.
ParseExpression
("M(out int? x)").GetDiagnostics().Verify();
Parsing\RoundTrippingTests.cs (2)
1592
var typeOfExpression = SyntaxFactory.
ParseExpression
(text, consumeFullText: true);
1596
typeOfExpression = SyntaxFactory.
ParseExpression
(text, consumeFullText: false);
Parsing\SuppressNullableWarningExpressionParsingTests.cs (1)
23
return SyntaxFactory.
ParseExpression
(text, options: options);
Syntax\GreenNodeTests.cs (3)
44
var expression = SyntaxFactory.
ParseExpression
("x");
56
var expression = SyntaxFactory.
ParseExpression
("(x)");
68
var expression = SyntaxFactory.
ParseExpression
("(1, 2)");
Syntax\LambdaUtilitiesTests.cs (46)
204
SyntaxFactory.
ParseExpression
("F(1)"),
205
SyntaxFactory.
ParseExpression
("F(1)")));
208
SyntaxFactory.
ParseExpression
("F(1)"),
209
SyntaxFactory.
ParseExpression
("F(2)")));
212
SyntaxFactory.
ParseExpression
("F(a => 1)"),
213
SyntaxFactory.
ParseExpression
("F(a => 2)")));
216
SyntaxFactory.
ParseExpression
("F(() => 1)"),
217
SyntaxFactory.
ParseExpression
("F(() => 2)")));
220
SyntaxFactory.
ParseExpression
("F(delegate { return 1; })"),
221
SyntaxFactory.
ParseExpression
("F(delegate { return 2; })")));
224
SyntaxFactory.
ParseExpression
("F(delegate (int a) { return 1; })"),
225
SyntaxFactory.
ParseExpression
("F(delegate (bool a) { return 1; })")));
228
SyntaxFactory.
ParseExpression
("F(delegate (int a) { return 1; })"),
229
SyntaxFactory.
ParseExpression
("F(delegate (int a) { return 2; })")));
232
SyntaxFactory.
ParseExpression
("F(() => { return 1; })"),
233
SyntaxFactory.
ParseExpression
("F(() => { return 1; })")));
236
SyntaxFactory.
ParseExpression
("F(() => { return 1; })"),
237
SyntaxFactory.
ParseExpression
("F((a) => { return 1; })")));
240
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } select a)"),
241
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } select a + 1)")));
244
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } where a > 0 select a)"),
245
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } where a > 0 select a + 1)")));
248
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } orderby a select a)"),
249
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } orderby a select a + 1)")));
252
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } let b = 1 select a)"),
253
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } let b = 1 select a + 1)")));
256
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } select a)"),
257
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } where b > 0 select a)")));
260
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } from b in new[] { 3, 4 } where b > 0 select a)"),
261
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } from b in new[] { 3, 4, 5 } where b > 1 select a + 1)")));
264
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } join b in new[] { 3, 4 } on a equals b select a)"),
265
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } join b in new[] { 3, 4, 5 } on a equals b select a)")));
268
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } join b in new[] { 3, 4 } on a equals b select a)"),
269
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } join b in new[] { 3, 4 } on a + 1 equals b + 1 select a)")));
272
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } select a)"),
273
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } join b in new[] { 3, 4 } on a equals b select a)")));
276
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } group a by a into g select g)"),
277
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } group a + 1 by a into g select g)")));
280
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } group a by a into g select g)"),
281
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } group a by a + 1 into g select g)")));
284
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } group a by a into g select g)"),
285
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } group a by a into q select q)")));
288
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } orderby a, a descending, a ascending select a)"),
289
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } orderby a + 1, a - 1 descending, a + 1 ascending select a)")));
292
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } orderby a, a descending, a ascending select a)"),
293
SyntaxFactory.
ParseExpression
("F(from a in new[] { 1, 2 } orderby a, a descending, a descending select a)")));
Syntax\SeparatedSyntaxListTests.cs (21)
53
var addList = list.Insert(0, SyntaxFactory.
ParseExpression
("x"));
56
var insertBefore = addList.Insert(0, SyntaxFactory.
ParseExpression
("y"));
59
var insertAfter = addList.Insert(1, SyntaxFactory.
ParseExpression
("y"));
62
var insertBetween = insertAfter.InsertRange(1, new[] { SyntaxFactory.
ParseExpression
("a"), SyntaxFactory.
ParseExpression
("b"), SyntaxFactory.
ParseExpression
("c") });
69
var insertAfterComment = argsWithComment.Insert(1, SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("c")));
77
var insertAfterEOL = argsWithEOL.Insert(1, SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("c")));
83
var insertBeforeMultiLineComment = argsWithMultiLineComment.Insert(1, SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("c")));
92
SyntaxFactory.
ParseExpression
("A"),
93
SyntaxFactory.
ParseExpression
("B"),
94
SyntaxFactory.
ParseExpression
("C")]
97
SyntaxFactory.
ParseExpression
("A"),
98
SyntaxFactory.
ParseExpression
("B"),
99
SyntaxFactory.
ParseExpression
("C") });
115
SyntaxNode nodeD = SyntaxFactory.
ParseExpression
("D");
116
SyntaxNode nodeE = SyntaxFactory.
ParseExpression
("E");
244
SyntaxNode nodeD = SyntaxFactory.
ParseExpression
("D");
245
SyntaxNode nodeE = SyntaxFactory.
ParseExpression
("E");
283
SyntaxFactory.
ParseExpression
("A+B"),
285
SyntaxFactory.
ParseExpression
("1") });
Syntax\SyntaxFactoryTests.cs (7)
448
var expression = (LiteralExpressionSyntax)SyntaxFactory.
ParseExpression
("1l");
462
var expression = (LiteralExpressionSyntax)SyntaxFactory.
ParseExpression
("1L");
532
var syntaxNode = SyntaxFactory.
ParseExpression
("x is int? y: z").NormalizeWhitespace();
537
var syntaxNode2 = SyntaxFactory.
ParseExpression
("x is DateTime? y: z").NormalizeWhitespace();
547
var syntaxNode = SyntaxFactory.
ParseExpression
("x is int??y").NormalizeWhitespace();
550
var syntaxNode2 = SyntaxFactory.
ParseExpression
("x is DateTime??y").NormalizeWhitespace();
553
var syntaxNode3 = SyntaxFactory.
ParseExpression
("x is object??y").NormalizeWhitespace();
Syntax\SyntaxListTests.cs (12)
48
SyntaxFactory.
ParseExpression
("A "),
49
SyntaxFactory.
ParseExpression
("B "),
50
SyntaxFactory.
ParseExpression
("C ")]
53
SyntaxFactory.
ParseExpression
("A "),
54
SyntaxFactory.
ParseExpression
("B "),
55
SyntaxFactory.
ParseExpression
("C ") });
71
SyntaxNode nodeD = SyntaxFactory.
ParseExpression
("D ");
72
SyntaxNode nodeE = SyntaxFactory.
ParseExpression
("E ");
196
SyntaxNode nodeD = SyntaxFactory.
ParseExpression
("D ");
197
SyntaxNode nodeE = SyntaxFactory.
ParseExpression
("E ");
270
SyntaxFactory.
ParseExpression
("A+B"),
272
SyntaxFactory.
ParseExpression
("1") });
Syntax\SyntaxNodeOrTokenListTests.cs (2)
59
SyntaxNodeOrToken nameE = SyntaxFactory.
ParseExpression
("E ");
186
SyntaxNodeOrToken nodeE = SyntaxFactory.
ParseExpression
("E ");
Syntax\SyntaxNodeTests.cs (58)
72
var expression = SyntaxFactory.
ParseExpression
(text);
84
var expression = SyntaxFactory.
ParseExpression
(text);
102
var expression = SyntaxFactory.
ParseExpression
(text);
121
var expression = SyntaxFactory.
ParseExpression
(text);
317
var expr = SyntaxFactory.
ParseExpression
(text);
334
var expr = SyntaxFactory.
ParseExpression
(text);
490
var expr = SyntaxFactory.
ParseExpression
(text);
604
var expr = SyntaxFactory.
ParseExpression
(text);
621
var expr = SyntaxFactory.
ParseExpression
(text);
2079
var expr = SyntaxFactory.
ParseExpression
("a + b");
2081
var expr2 = bex.ReplaceNode(bex.Right, SyntaxFactory.
ParseExpression
("c"));
2088
var expr = SyntaxFactory.
ParseExpression
("a + b + c + d");
2102
var invocation = (InvocationExpressionSyntax)SyntaxFactory.
ParseExpression
("m(a, b)");
2103
var argC = SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("c"));
2104
var argD = SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("d"));
2142
var invocation = (InvocationExpressionSyntax)SyntaxFactory.
ParseExpression
("m(a, b)");
2143
var argC = SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("c"));
2144
var argD = SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("d"));
2230
var expr = SyntaxFactory.
ParseExpression
("a + b");
2239
var expr = SyntaxFactory.
ParseExpression
("a + b + c");
2356
var expr = SyntaxFactory.
ParseExpression
("#if true\r\na + \r\n#endif\r\n + b");
2371
var expr = SyntaxFactory.
ParseExpression
("a + b");
2381
var expr = SyntaxFactory.
ParseExpression
("a + b");
2391
var ex = SyntaxFactory.
ParseExpression
("/* c */ identifier");
2413
var ex = SyntaxFactory.
ParseExpression
("/* c */ identifier");
2454
var expr = SyntaxFactory.
ParseExpression
("m(a, b, /* trivia */ c)");
2468
var expr = SyntaxFactory.
ParseExpression
(@"m(a, b, /* trivia */
2484
var expr = SyntaxFactory.
ParseExpression
(@"m(a, b,
2500
var expr = SyntaxFactory.
ParseExpression
(@"SomeMethod(/*arg1:*/ a,
2518
var expr = SyntaxFactory.
ParseExpression
(@"SomeMethod(// comment about a
2542
var expr = SyntaxFactory.
ParseExpression
("m(a, b, /* trivia */ c)");
2556
var expr = SyntaxFactory.
ParseExpression
(
2572
var expr = SyntaxFactory.
ParseExpression
(
2588
var expr = SyntaxFactory.
ParseExpression
(@"SomeMethod(/*arg1:*/ a,
2605
var expr = SyntaxFactory.
ParseExpression
(@"SomeMethod(// comment about a
2627
var expr = SyntaxFactory.
ParseExpression
("m(/* before */ a /* after */)");
2641
var expr = SyntaxFactory.
ParseExpression
("m(/* before */ a /* after */, b, c)");
2655
var expr = SyntaxFactory.
ParseExpression
("m(a, b, /* before */ c /* after */)");
3724
namedNode = SyntaxFactory.
ParseExpression
("goo");
3731
namedNode = SyntaxFactory.
ParseExpression
(" goo ");
3765
nodeOrToken = SyntaxFactory.
ParseExpression
("goo");
3781
nodeOrToken = SyntaxFactory.
ParseExpression
(" goo ");
3818
var expression = SyntaxFactory.
ParseExpression
(text);
3832
var expression = (AnonymousMethodExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3841
var expression = (ParenthesizedLambdaExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3850
var expression = (SimpleLambdaExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3859
var expression = (AnonymousMethodExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3868
var expression = (ParenthesizedLambdaExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3877
var expression = (SimpleLambdaExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3886
var expression = (AnonymousMethodExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3895
var expression = (ParenthesizedLambdaExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3904
var expression = (SimpleLambdaExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3913
var expression = (AnonymousMethodExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3922
var expression = (ParenthesizedLambdaExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3931
var expression = (SimpleLambdaExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3940
var expression = (AnonymousMethodExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3950
var expression = (AnonymousMethodExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
3978
var expression = (StackAllocArrayCreationExpressionSyntax)SyntaxFactory.
ParseExpression
(text);
Syntax\SyntaxNormalizerTests.cs (2)
412
var node = SyntaxFactory.
ParseExpression
(text.NormalizeLineEndings());
5979
var syntaxNode = SyntaxFactory.
ParseExpression
(expression).NormalizeWhitespace();
Syntax\SyntaxRewriterTests.cs (7)
327
var node2 = SyntaxFactory.
ParseExpression
("2 + 2");
379
var argC = SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("c"));
380
var argD = SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("d"));
398
var argC = SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("c"));
399
var argD = SyntaxFactory.Argument(SyntaxFactory.
ParseExpression
("d"));
695
var red = isExpr ? (CSharpSyntaxNode)SyntaxFactory.
ParseExpression
(input) : SyntaxFactory.ParseStatement(input);
708
var red = isExpr ? (CSharpSyntaxNode)SyntaxFactory.
ParseExpression
(input) : SyntaxFactory.ParseStatement(input);
Syntax\SyntaxTests.cs (1)
182
var expr = SyntaxFactory.
ParseExpression
(source, options: TestOptions.Regular);
Syntax\TrackNodeTests.cs (13)
23
var expr = SyntaxFactory.
ParseExpression
("a + b");
34
var expr = SyntaxFactory.
ParseExpression
("a + b");
46
var expr = SyntaxFactory.
ParseExpression
("a + b");
55
var expr = SyntaxFactory.
ParseExpression
("a + b");
65
var expr = SyntaxFactory.
ParseExpression
("a + b");
80
var expr = SyntaxFactory.
ParseExpression
("a + b");
96
var expr = SyntaxFactory.
ParseExpression
("a + b");
108
var expr = SyntaxFactory.
ParseExpression
("a + b");
121
var expr = SyntaxFactory.
ParseExpression
("a + b");
133
var expr = SyntaxFactory.
ParseExpression
("a + b");
148
var expr = SyntaxFactory.
ParseExpression
("a + b + c");
166
var expr = SyntaxFactory.
ParseExpression
("a + b + c");
183
var expr = SyntaxFactory.
ParseExpression
("a + b");
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3672
=> SyntaxFactory.
ParseExpression
(stringToParse);
Simplification\CSharpSimplificationService.Expander.cs (1)
1102
var containingTypeSyntax =
ParseExpression
(containingTypeString);
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
61
var reparsedAncestor = SyntaxFactory.
ParseExpression
(reducedAncestor.ToFullString());
Simplification\Simplifiers\NameSimplifier.cs (1)
667
var reparsedCastExpression =
ParseExpression
(newCastExpression.ToString());
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.CSharp.cs (1)
153
thisArguments: ImmutableArray.Create<SyntaxNode>(CS.SyntaxFactory.
ParseExpression
("42")));
Microsoft.CodeAnalysis.UnitTests (3)
CommonSyntaxTests.cs (3)
112
var csharpToken = CSharp.SyntaxFactory.
ParseExpression
("1 + 123 /*hello*/").GetLastToken();
208
var expr = CSharp.SyntaxFactory.
ParseExpression
("a + b + c + d");
229
var expr = CSharp.SyntaxFactory.
ParseExpression
("a + b + c + d");
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
SyntaxPathTests.cs (7)
34
Assert.False(path.TryResolve(SyntaxFactory.
ParseExpression
("Goo()"), out SyntaxNode _));
40
var node = SyntaxFactory.
ParseExpression
("Goo()");
50
var root = SyntaxFactory.
ParseExpression
("Goo(a, b)");
53
var root2 = SyntaxFactory.
ParseExpression
("Goo(a)");
60
var root = SyntaxFactory.
ParseExpression
("Goo(a)");
63
var root2 = SyntaxFactory.
ParseExpression
("Goo(3)");
70
var root = SyntaxFactory.
ParseExpression
("Goo()");
Microsoft.Interop.ComInterfaceGenerator (1)
AttributeInfo.cs (1)
19
return Attribute((NameSyntax)Type.Syntax, AttributeArgumentList(SeparatedList(Arguments.Select(arg => AttributeArgument(
ParseExpression
(arg))))));
Microsoft.ML.AutoML (1)
Utils\Entity.cs (1)
109
var exp = SyntaxFactory.
ParseExpression
(expression);
Microsoft.ML.InternalCodeAnalyzer (3)
ContractsCheckNameofFixProvider.cs (3)
89
candidate = SyntaxFactory.
ParseExpression
(node.Parent.ToString());
169
var nameofExp = SyntaxFactory.
ParseExpression
($"nameof({name})").WithTriviaFrom(nameArg);
178
var nameofExp = (InvocationExpressionSyntax)SyntaxFactory.
ParseExpression
($"nameof(a)").WithTriviaFrom(nameArg);
Microsoft.VisualStudio.LanguageServices.CSharp (5)
CodeModel\CSharpCodeModelService.cs (5)
1784
expression: SyntaxFactory.
ParseExpression
(value));
1788
return SyntaxFactory.AttributeArgument(SyntaxFactory.
ParseExpression
(value));
2934
var expression = SyntaxFactory.
ParseExpression
(value);
2951
var expression = SyntaxFactory.
ParseExpression
(value);
2968
var expression = SyntaxFactory.
ParseExpression
(value);
System.Text.RegularExpressions.Generator (2)
UpgradeToGeneratedRegexCodeFixer.cs (2)
288
return SyntaxFactory.
ParseExpression
(optionsLiteral);
301
return SyntaxFactory.
ParseExpression
($"@\"{str}\"");