25 instantiations of CSharpIntermediateToken
Microsoft.CodeAnalysis.Razor.Compiler (25)
Language\DefaultTagHelperResolutionPhase.ComponentTagHelperResolver.cs (3)
441innerExpr.Children[0] = new CSharpIntermediateToken( 455expr.Children.Add(new CSharpIntermediateToken( 591node.Children.Add(new CSharpIntermediateToken(content, mergedSpan));
Language\DefaultTagHelperResolutionPhase.cs (3)
704target.Children.Add(new CSharpIntermediateToken(token.Content, token.Source)); 957: new CSharpIntermediateToken(htmlToken.Content, htmlToken.Source); 1284target.Children.Add(new CSharpIntermediateToken(mergedContent, mergedSpan));
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (16)
464targetNode.Children.Add(new CSharpIntermediateToken(string.Empty, emptySource)); 509targetNode.Children.Add(new CSharpIntermediateToken(content, source)); 601targetNode.Children.Add(new CSharpIntermediateToken(sourceText, valueSource)); 633targetNode.Children.Add(new CSharpIntermediateToken(intermediateToken.Content, intermediateToken.Source)); 638targetNode.Children.Add(new CSharpIntermediateToken(intermediateToken.Content, intermediateToken.Source)); 664targetNode.Children.Add(new CSharpIntermediateToken(attrContent, tokenSource)); 677targetNode.Children.Add(new CSharpIntermediateToken(string.Empty, emptySource)); 680targetNode.Children.Add(new CSharpIntermediateToken("@", transSource)); 692targetNode.Children.Add(new CSharpIntermediateToken("(", openSource)); 705targetNode.Children.Add(new CSharpIntermediateToken(")", closeSource)); 743targetNode.Children.Add(new CSharpIntermediateToken("(", openParenSource)); 754targetNode.Children.Add(new CSharpIntermediateToken(innerToken.Content, innerToken.Source)); 769targetNode.Children.Add(new CSharpIntermediateToken(")", closeParenSource)); 1336expr.Children.Add(new CSharpIntermediateToken(text, contentSpan)); 1366expr.Children.Add(new CSharpIntermediateToken(mergedContent, tokenSpan)); 1396target.Children.Add(new CSharpIntermediateToken(text, vss));
Language\Intermediate\ComponentTypeArgumentIntermediateNode.cs (1)
36: new CSharpIntermediateToken(t.Content, t.Source),
Language\Intermediate\IntermediateNodeFactory.cs (2)
11=> new(content, source); 14=> new(LazyContent.Create(arg, contentFactory), source);
99 references to CSharpIntermediateToken
Microsoft.AspNetCore.Mvc.Razor.Extensions.UnitTests (6)
ModelExpressionPassTest.cs (6)
53var token = Assert.IsAssignableFrom<CSharpIntermediateToken>(Assert.Single(setProperty.Children)); 87var originalNode = Assert.IsAssignableFrom<CSharpIntermediateToken>(expression.Children[2]); 123var originalNode = Assert.IsAssignableFrom<CSharpIntermediateToken>(expression.Children[1]);
Microsoft.AspNetCore.Razor.Language.UnitTests (2)
Components\NodeAssert.cs (2)
74var token = Assert.IsAssignableFrom<CSharpIntermediateToken>(attributeValueNode.Children[i]);
Microsoft.AspNetCore.Razor.Test.Common (12)
Language\IntegrationTests\IntermediateNodeWriter.cs (1)
72CSharpIntermediateToken => "CSharp",
Language\Intermediate\IntermediateNodeAssert.cs (10)
95var token = Assert.IsAssignableFrom<CSharpIntermediateToken>(statement.Children[i]); 181var token = Assert.IsAssignableFrom<CSharpIntermediateToken>(attributeValue.Children[i]); 225var token = Assert.IsAssignableFrom<CSharpIntermediateToken>(cSharp.Children[i]); 245var token = Assert.IsAssignableFrom<CSharpIntermediateToken>(beginNode.Children[i]); 265var token = Assert.IsAssignableFrom<CSharpIntermediateToken>(endNode.Children[i]);
Language\Intermediate\IntermediateNodeExtensions.cs (1)
18if (child is CSharpIntermediateToken csharpToken)
Microsoft.CodeAnalysis.Razor.Compiler (79)
Language\CodeGeneration\DesignTimeNodeWriter.cs (5)
68if (child is CSharpIntermediateToken token) 89if (child is CSharpIntermediateToken token) 161if (child is CSharpIntermediateToken token) 181if (node.Children[i] is CSharpIntermediateToken token) 206if (child is CSharpIntermediateToken token)
Language\CodeGeneration\IntermediateNodeWriter.cs (1)
97if (child is CSharpIntermediateToken token)
Language\CodeGeneration\RuntimeNodeWriter.cs (4)
93var firstCSharpChild = node.Children.OfType<CSharpIntermediateToken>().FirstOrDefault(); 113if (child is CSharpIntermediateToken csharpToken) 156if (children[i] is CSharpIntermediateToken token)
Language\Components\ComponentBindLoweringPass.cs (1)
844var startToken = awaitable
Language\Components\ComponentDesignTimeNodeWriter.cs (14)
135if (child is CSharpIntermediateToken token) 156if (child is CSharpIntermediateToken token) 177if (child is not CSharpIntermediateToken token || !token.Content.IsNullOrWhiteSpace()) 267if (child is CSharpIntermediateToken token) 893private static ImmutableArray<CSharpIntermediateToken> GetCSharpTokens(IntermediateNode node) 896return node.FindDescendantNodes<CSharpIntermediateToken>(); 1037using var tokens = new PooledArrayBuilder<CSharpIntermediateToken>(); 1055foreach (var token in GetCSharpTokens(node)) 1098var assignmentToken = IntermediateNodeFactory.CSharpToken(assignmentText); 1146private static void WriteCSharpTokens(CodeRenderingContext context, ImmutableArray<CSharpIntermediateToken> tokens) 1148foreach (var token in tokens) 1154private static void WriteCSharpTokens(CodeRenderingContext context, ref readonly PooledArrayBuilder<CSharpIntermediateToken> tokens) 1156foreach (var token in tokens) 1162private static void WriteCSharpToken(CodeRenderingContext context, CSharpIntermediateToken token)
Language\Components\ComponentGenericTypePass.cs (1)
294return string.Join(string.Empty, node.FindDescendantNodes<CSharpIntermediateToken>().Select(t => t.Content));
Language\Components\ComponentMarkupBlockPass.cs (1)
258if (node is CSharpIntermediateToken)
Language\Components\ComponentRuntimeNodeWriter.cs (16)
49if (child is CSharpIntermediateToken token) 90var firstCSharpChild = node.Children.OfType<CSharpIntermediateToken>().FirstOrDefault(); 114if (child is CSharpIntermediateToken csharpToken) 806private static ImmutableArray<CSharpIntermediateToken> GetCSharpTokens(IntermediateNode node) 809return node.FindDescendantNodes<CSharpIntermediateToken>(); 930using var tokens = new PooledArrayBuilder<CSharpIntermediateToken>(); 990var assignmentToken = shouldTypeCheck 1110if (token is CSharpIntermediateToken) 1131WriteCSharpToken(context, (CSharpIntermediateToken)token); 1160if (token is CSharpIntermediateToken csharpToken) 1205private static void WriteCSharpTokens(CodeRenderingContext context, ImmutableArray<CSharpIntermediateToken> tokens) 1207foreach (var token in tokens) 1213private static void WriteCSharpTokens(CodeRenderingContext context, ref readonly PooledArrayBuilder<CSharpIntermediateToken> tokens) 1215foreach (var token in tokens) 1221private static void WriteCSharpToken(CodeRenderingContext context, CSharpIntermediateToken token)
Language\Components\ComponentSplatLoweringPass.cs (1)
42result.Children.AddRange(node.FindDescendantNodes<CSharpIntermediateToken>());
Language\DefaultTagHelperResolutionPhase.ComponentTagHelperResolver.cs (8)
418/// When false (regular bound properties), literals become direct <see cref="CSharpIntermediateToken"/>s. 439if (innerExpr.Children is [CSharpIntermediateToken firstToken, ..]) 453if (!prefixedFirst && token is CSharpIntermediateToken csharpToken) 518/// Merges <see cref="CSharpIntermediateToken"/> children (and content from 530if (child is CSharpIntermediateToken) 536&& expr.Children.All(static inner => inner is CSharpIntermediateToken)) 557if (child is CSharpIntermediateToken csharpToken) 570if (inner is CSharpIntermediateToken innerToken)
Language\DefaultTagHelperResolutionPhase.cs (6)
694if (source is CSharpIntermediateToken csharpToken) 835/// structured <see cref="CSharpIntermediateToken"/> children: <c>@</c>, <c>(</c>, 950/// Converts an <see cref="HtmlIntermediateToken"/> to a <see cref="CSharpIntermediateToken"/>, 953private static CSharpIntermediateToken ToCSharpToken(HtmlIntermediateToken htmlToken) 973/// Creates an empty <see cref="CSharpIntermediateToken"/> with an empty string. 975private static CSharpIntermediateToken CreateEmptyCSharpToken(SourceSpan? source)
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (7)
752if (innerChild is CSharpIntermediateToken innerToken) 818Func<CSharpIntermediateToken, IntermediateNode> createCSharpWrapper) 829if (innerChild is CSharpIntermediateToken csharpToken) 1091if (innerChild is CSharpIntermediateToken csharpToken) 1282/// For implicit expressions, produces a single <see cref="CSharpIntermediateToken"/>. 1387/// Produces a single <see cref="CSharpIntermediateToken"/> with the raw source text. 1401/// flat <see cref="CSharpIntermediateToken"/>s for literals, <see cref="CSharpExpressionIntermediateNode"/>
Language\Extensions\DefaultTagHelperTargetExtension.cs (2)
373node.Children is [CSharpIntermediateToken token]) 415node.Children is [CSharpIntermediateToken token])
Language\Intermediate\ComponentTypeArgumentIntermediateNode.cs (6)
7BoundAttributeDescriptor boundAttribute, CSharpIntermediateToken value) : IntermediateNode 14public CSharpIntermediateToken Value { get; } = value; 25private static CSharpIntermediateToken GetValue(TagHelperPropertyIntermediateNode node) 28[CSharpIntermediateToken t] => t, 29[CSharpExpressionIntermediateNode { Children: [CSharpIntermediateToken t] }] => t, 37_ => Assumed.Unreachable<CSharpIntermediateToken>()
Language\Intermediate\IntermediateNodeFactory.cs (2)
10public static CSharpIntermediateToken CSharpToken(string content, SourceSpan? source = null) 13public static CSharpIntermediateToken CSharpToken<T>(T arg, Func<T, string> contentFactory, SourceSpan? source = null)
Language\Intermediate\UnresolvedAttributeValueIntermediateNode.cs (1)
14/// <item>A <see cref="CSharpIntermediateToken"/> (for bound non-string tag helper properties)</item>
Language\Intermediate\UnresolvedExpressionAttributeValueIntermediateNode.cs (1)
14/// <item>Direct <see cref="CSharpIntermediateToken"/> children (for bound non-string tag helper properties)</item>
Mvc\ModelExpressionPass.cs (2)
46if (node.Children.Count == 1 && node.Children[0] is CSharpIntermediateToken token) 62if (nestedExpression.Children[j] is CSharpIntermediateToken csharpToken)