244 references to LiteralExpression
ILLink.CodeFixProvider (4)
RequiresHelpers.cs (1)
19
return new[] { syntaxGenerator.AttributeArgument (syntaxGenerator.
LiteralExpression
($"Calls {symbolDisplayName}")) };
UnconditionalSuppressMessageCodeFixProvider.cs (3)
44
syntaxGenerator.
LiteralExpression
(diagnostic.Descriptor.Category));
51
syntaxGenerator.
LiteralExpression
(
56
syntaxGenerator.
LiteralExpression
("<Pending>"));
Microsoft.Analyzers.Extra (2)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
594
gen.
LiteralExpression
(CalcEventId(comp, targetClass, cancellationToken)),
596
gen.
LiteralExpression
(details.Message),
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
47
editor.ReplaceNode(node, editor.Generator.
LiteralExpression
(newDocCommentId).WithTriviaFrom(node));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (3)
92
return [factory.ReturnStatement(factory.
LiteralExpression
(0))];
189
? factory.NegateExpression(factory.
LiteralExpression
(-value))
190
: factory.
LiteralExpression
(value);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
102
var newLiteral = generator.
LiteralExpression
(constant.Value);
Microsoft.CodeAnalysis.CSharp.Features (7)
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
94
EqualsValueClause((ExpressionSyntax)generator.
LiteralExpression
(0)))]),
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
286
: (ExpressionSyntax)generator.SubtractExpression(end, generator.
LiteralExpression
(1));
Snippets\CSharpForLoopSnippetProvider.cs (1)
30
=> (ExpressionSyntax)generator.
LiteralExpression
(0);
Snippets\CSharpIntMainSnippetProvider.cs (1)
35
var returnStatement = (StatementSyntax)generator.ReturnStatement(generator.
LiteralExpression
(0));
Snippets\CSharpReversedForLoopSnippetProvider.cs (2)
32
return (ExpressionSyntax)generator.SubtractExpression(subtractFrom, generator.
LiteralExpression
(1));
36
=> (ExpressionSyntax)generator.
LiteralExpression
(0);
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
102
var newLiteral = generator.
LiteralExpression
(constant.Value);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (81)
CodeGeneration\SyntaxGeneratorTests.cs (81)
66
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0), "0");
67
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1), "1");
68
VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.
LiteralExpression
(-1), "-1");
69
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(int.MinValue), "global::System.Int32.MinValue");
70
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(int.MaxValue), "global::System.Int32.MaxValue");
72
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0L), "0L");
73
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1L), "1L");
74
VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.
LiteralExpression
(-1L), "-1L");
75
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(long.MinValue), "global::System.Int64.MinValue");
76
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(long.MaxValue), "global::System.Int64.MaxValue");
78
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0UL), "0UL");
79
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1UL), "1UL");
80
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(ulong.MinValue), "0UL");
81
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(ulong.MaxValue), "global::System.UInt64.MaxValue");
83
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0.0f), "0F");
84
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1.0f), "1F");
85
VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.
LiteralExpression
(-1.0f), "-1F");
86
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(float.MinValue), "global::System.Single.MinValue");
87
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(float.MaxValue), "global::System.Single.MaxValue");
88
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(float.Epsilon), "global::System.Single.Epsilon");
89
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(float.NaN), "global::System.Single.NaN");
90
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(float.NegativeInfinity), "global::System.Single.NegativeInfinity");
91
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(float.PositiveInfinity), "global::System.Single.PositiveInfinity");
93
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0.0), "0D");
94
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1.0), "1D");
95
VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.
LiteralExpression
(-1.0), "-1D");
96
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(double.MinValue), "global::System.Double.MinValue");
97
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(double.MaxValue), "global::System.Double.MaxValue");
98
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(double.Epsilon), "global::System.Double.Epsilon");
99
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(double.NaN), "global::System.Double.NaN");
100
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(double.NegativeInfinity), "global::System.Double.NegativeInfinity");
101
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(double.PositiveInfinity), "global::System.Double.PositiveInfinity");
103
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0m), "0M");
104
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0.00m), "0.00M");
105
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1.00m), "1.00M");
106
VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.
LiteralExpression
(-1.00m), "-1.00M");
107
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1.0000000000m), "1.0000000000M");
108
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0.000000m), "0.000000M");
109
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0.0000000m), "0.0000000M");
110
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1000000000m), "1000000000M");
111
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(123456789.123456789m), "123456789.123456789M");
112
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1E-28m), "0.0000000000000000000000000001M");
113
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(0E-28m), "0.0000000000000000000000000000M");
114
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(1E-29m), "0.0000000000000000000000000000M");
115
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(-1E-29m), "0.0000000000000000000000000000M");
116
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(decimal.MinValue), "global::System.Decimal.MinValue");
117
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(decimal.MaxValue), "global::System.Decimal.MaxValue");
119
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
('c'), "'c'");
121
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
("str"), "\"str\"");
122
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
("s\"t\"r"), "\"s\\\"t\\\"r\"");
124
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(true), "true");
125
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(false), "false");
131
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
((short)0), "0");
132
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
((short)1), "1");
133
VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.
LiteralExpression
((short)-1), "-1");
134
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(short.MinValue), "global::System.Int16.MinValue");
135
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(short.MaxValue), "global::System.Int16.MaxValue");
141
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
((ushort)0), "0");
142
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
((ushort)1), "1");
143
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(ushort.MinValue), "0");
144
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(ushort.MaxValue), "global::System.UInt16.MaxValue");
150
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
((sbyte)0), "0");
151
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
((sbyte)1), "1");
152
VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.
LiteralExpression
((sbyte)-1), "-1");
153
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(sbyte.MinValue), "global::System.SByte.MinValue");
154
VerifySyntax<MemberAccessExpressionSyntax>(Generator.
LiteralExpression
(sbyte.MaxValue), "global::System.SByte.MaxValue");
160
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
((byte)0), "0");
161
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
((byte)1), "1");
162
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(byte.MinValue), "0");
163
VerifySyntax<LiteralExpressionSyntax>(Generator.
LiteralExpression
(byte.MaxValue), "255");
380
Generator.ArrayCreationExpression(Generator.IdentifierName("x"), Generator.
LiteralExpression
(10)),
545
VerifySyntax<YieldStatementSyntax>(Generator.YieldReturnStatement(Generator.
LiteralExpression
(1)), "yield return 1;");
785
Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), initializer: Generator.
LiteralExpression
(0)),
1692
Generator.EnumDeclaration("e", members: [Generator.EnumMember("a", Generator.
LiteralExpression
(0)), Generator.EnumMember("b"), Generator.EnumMember("c", Generator.
LiteralExpression
(5))]),
1696
Generator.EnumDeclaration("e", members: [Generator.FieldDeclaration("a", Generator.IdentifierName("e"), initializer: Generator.
LiteralExpression
(1))]),
3503
Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(x, Generator.
LiteralExpression
(500))).ToString());
3504
Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(y, Generator.
LiteralExpression
(500))).ToString());
3505
Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(z, Generator.
LiteralExpression
(500))).ToString());
3525
Assert.Null(Generator.GetExpression(Generator.WithExpression(x, Generator.
LiteralExpression
(500))));
3526
Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(y, Generator.
LiteralExpression
(500))).ToString());
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (72)
CodeGeneration\ExpressionGenerationTests.cs (32)
74
f => f.
LiteralExpression
(0),
85
f => f.
LiteralExpression
(1),
96
f => f.
LiteralExpression
(0L),
107
f => f.
LiteralExpression
(1L),
118
f => f.
LiteralExpression
(0.0f),
129
f => f.
LiteralExpression
(0.5F),
140
f => f.
LiteralExpression
(0.0d),
151
f => f.
LiteralExpression
(0.5D),
163
f.
LiteralExpression
(1),
164
f.
LiteralExpression
(2)),
176
f.
LiteralExpression
(1),
178
f.
LiteralExpression
(2),
179
f.
LiteralExpression
(3))),
192
f.
LiteralExpression
(1),
193
f.
LiteralExpression
(2)),
194
f.
LiteralExpression
(3)),
206
f.
LiteralExpression
(1),
207
f.
LiteralExpression
(2)),
219
f.
LiteralExpression
(1),
221
f.
LiteralExpression
(2),
222
f.
LiteralExpression
(3))),
235
f.
LiteralExpression
(1),
236
f.
LiteralExpression
(2)),
237
f.
LiteralExpression
(3)),
249
f.
LiteralExpression
(1),
250
f.
LiteralExpression
(2)),
262
f.
LiteralExpression
(1),
263
f.
LiteralExpression
(2)),
275
f.
LiteralExpression
(1),
276
f.
LiteralExpression
(2)),
288
f.
LiteralExpression
(1),
289
f.
LiteralExpression
(2)),
CodeGeneration\ExpressionPrecedenceGenerationTests.cs (40)
21
f.
LiteralExpression
(1),
22
f.
LiteralExpression
(2)),
23
f.
LiteralExpression
(3)),
36
f.
LiteralExpression
(1),
37
f.
LiteralExpression
(2)),
38
f.
LiteralExpression
(3)),
50
f.
LiteralExpression
(1),
52
f.
LiteralExpression
(2),
53
f.
LiteralExpression
(3))),
65
f.
LiteralExpression
(1),
67
f.
LiteralExpression
(2),
68
f.
LiteralExpression
(3))),
81
f.
LiteralExpression
(1),
82
f.
LiteralExpression
(2)),
83
f.
LiteralExpression
(3)),
96
f.
LiteralExpression
(1),
97
f.
LiteralExpression
(2)),
98
f.
LiteralExpression
(3)),
110
f.
LiteralExpression
(1),
112
f.
LiteralExpression
(2),
113
f.
LiteralExpression
(3))),
125
f.
LiteralExpression
(1),
127
f.
LiteralExpression
(2),
128
f.
LiteralExpression
(3))),
141
f.
LiteralExpression
(1),
142
f.
LiteralExpression
(2)),
143
f.
LiteralExpression
(3)),
156
f.
LiteralExpression
(1),
157
f.
LiteralExpression
(2)),
158
f.
LiteralExpression
(3)),
170
f.
LiteralExpression
(1),
172
f.
LiteralExpression
(2),
173
f.
LiteralExpression
(3))),
185
f.
LiteralExpression
(1),
187
f.
LiteralExpression
(2),
188
f.
LiteralExpression
(3))),
201
f.
LiteralExpression
(1),
202
f.
LiteralExpression
(2)),
251
f.
LiteralExpression
(1),
252
f.
LiteralExpression
(2)),
Microsoft.CodeAnalysis.Features (6)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (3)
139
generator.
LiteralExpression
(DebuggerDisplayPrefix),
141
generator.
LiteralExpression
(DebuggerDisplaySuffix));
146
attributeArgument = generator.
LiteralExpression
(
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
211
var zero = generator.
LiteralExpression
(0);
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
163
var literalOne = replacer.Generator.
LiteralExpression
(1);
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
47
editor.ReplaceNode(node, editor.Generator.
LiteralExpression
(newDocCommentId).WithTriviaFrom(node));
Microsoft.CodeAnalysis.VisualBasic.Features (2)
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (2)
96
DirectCast(generator.
LiteralExpression
(0), ExpressionSyntax),
99
collectionVariable, foreachInfo.CountName), generator.
LiteralExpression
(1)), ExpressionSyntax)),
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (56)
CodeGeneration\SyntaxGeneratorTests.vb (56)
62
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(0), "0")
63
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(1), "1")
64
VerifySyntax(Of UnaryExpressionSyntax)(Generator.
LiteralExpression
(-1), "-1")
65
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Integer.MinValue), "Global.System.Int32.MinValue")
66
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Integer.MaxValue), "Global.System.Int32.MaxValue")
68
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(0L), "0L")
69
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(1L), "1L")
70
VerifySyntax(Of UnaryExpressionSyntax)(Generator.
LiteralExpression
(-1L), "-1L")
71
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Long.MinValue), "Global.System.Int64.MinValue")
72
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Long.MaxValue), "Global.System.Int64.MaxValue")
74
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(0UL), "0UL")
75
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(1UL), "1UL")
76
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(ULong.MinValue), "0UL")
77
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(ULong.MaxValue), "Global.System.UInt64.MaxValue")
79
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(0.0F), "0F")
80
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(1.0F), "1F")
81
VerifySyntax(Of UnaryExpressionSyntax)(Generator.
LiteralExpression
(-1.0F), "-1F")
82
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Single.MinValue), "Global.System.Single.MinValue")
83
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Single.MaxValue), "Global.System.Single.MaxValue")
84
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Single.Epsilon), "Global.System.Single.Epsilon")
85
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Single.NaN), "Global.System.Single.NaN")
86
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Single.NegativeInfinity), "Global.System.Single.NegativeInfinity")
87
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Single.PositiveInfinity), "Global.System.Single.PositiveInfinity")
89
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(0.0), "0R")
90
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(1.0), "1R")
91
VerifySyntax(Of UnaryExpressionSyntax)(Generator.
LiteralExpression
(-1.0), "-1R")
92
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Double.MinValue), "Global.System.Double.MinValue")
93
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Double.MaxValue), "Global.System.Double.MaxValue")
94
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Double.Epsilon), "Global.System.Double.Epsilon")
95
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Double.NaN), "Global.System.Double.NaN")
96
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Double.NegativeInfinity), "Global.System.Double.NegativeInfinity")
97
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Double.PositiveInfinity), "Global.System.Double.PositiveInfinity")
99
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(0D), "0D")
100
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(0.00D), "0.00D")
101
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("1.00", CultureInfo.InvariantCulture)), "1.00D")
102
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("-1.00", CultureInfo.InvariantCulture)), "-1.00D")
103
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("1.0000000000", CultureInfo.InvariantCulture)), "1.0000000000D")
104
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("0.000000", CultureInfo.InvariantCulture)), "0.000000D")
105
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("0.0000000", CultureInfo.InvariantCulture)), "0.0000000D")
106
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(1000000000D), "1000000000D")
107
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(123456789.123456789D), "123456789.123456789D")
108
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("1E-28", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000001D")
109
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("0E-28", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D")
110
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("1E-29", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D")
111
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(Decimal.Parse("-1E-29", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D")
112
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Decimal.MinValue), "Global.System.Decimal.MinValue")
113
VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.
LiteralExpression
(Decimal.MaxValue), "Global.System.Decimal.MaxValue")
115
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
("c"c), """c""c")
117
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
("str"), """str""")
119
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(True), "True")
120
VerifySyntax(Of LiteralExpressionSyntax)(Generator.
LiteralExpression
(False), "False")
350
Generator.ArrayCreationExpression(Generator.IdentifierName("x"), Generator.
LiteralExpression
(10)),
484
VerifySyntax(Of YieldStatementSyntax)(Generator.YieldReturnStatement(Generator.
LiteralExpression
(1)), "Yield 1")
832
Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), initializer:=Generator.
LiteralExpression
(0)),
1620
Generator.EnumDeclaration("e", members:={Generator.EnumMember("a", Generator.
LiteralExpression
(0)), Generator.EnumMember("b"), Generator.EnumMember("c", Generator.
LiteralExpression
(5))}),
Microsoft.CodeAnalysis.Workspaces (6)
Editing\SyntaxGenerator.cs (3)
1813
=>
LiteralExpression
(false);
1819
=>
LiteralExpression
(true);
1825
=>
LiteralExpression
(value: null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (3)
92
return [factory.ReturnStatement(factory.
LiteralExpression
(0))];
189
? factory.NegateExpression(factory.
LiteralExpression
(-value))
190
: factory.
LiteralExpression
(value);
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
544
generator.
LiteralExpression
(AppendSuffix(methodName, entryPointSuffix.Value))));
System.Text.RegularExpressions.Generator (2)
UpgradeToGeneratedRegexCodeFixer.cs (2)
215
cultureNameValue = generator.
LiteralExpression
(CultureInfo.CurrentCulture.Name);
305
return generator.
LiteralExpression
(argument.Value.ConstantValue.Value);