138 references to RoutePatternKind
Microsoft.AspNetCore.App.Analyzers (138)
Infrastructure\AmbiguousRoutePatternComparer.cs (2)
103
var xParameterPolicies = x.ParameterParts.Where(p => p.Kind ==
RoutePatternKind
.ParameterPolicy).OfType<RoutePatternPolicyParameterPartNode>().ToList();
104
var yParameterPolicies = y.ParameterParts.Where(p => p.Kind ==
RoutePatternKind
.ParameterPolicy).OfType<RoutePatternPolicyParameterPartNode>().ToList();
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxHelpers.cs (1)
28
public static RoutePatternNode? GetChildNode(this RoutePatternNode node,
RoutePatternKind
kind)
Infrastructure\RoutePattern\RoutePatternHelpers.cs (3)
12
using RoutePatternToken = EmbeddedSyntaxToken<
RoutePatternKind
>;
16
public static RoutePatternToken CreateToken(
RoutePatternKind
kind, VirtualCharSequence virtualChars)
19
public static RoutePatternToken CreateMissingToken(
RoutePatternKind
kind)
Infrastructure\RoutePattern\RoutePatternLexer.cs (24)
12
using RoutePatternToken = EmbeddedSyntaxToken<
RoutePatternKind
>;
38
return CreateToken(
RoutePatternKind
.EndOfFile, VirtualCharSequence.Empty);
47
private static
RoutePatternKind
GetKind(VirtualChar ch)
50
'/' =>
RoutePatternKind
.SlashToken,
51
'~' =>
RoutePatternKind
.TildeToken,
52
'{' =>
RoutePatternKind
.OpenBraceToken,
53
'}' =>
RoutePatternKind
.CloseBraceToken,
54
'[' =>
RoutePatternKind
.OpenBracketToken,
55
']' =>
RoutePatternKind
.CloseBracketToken,
56
'.' =>
RoutePatternKind
.DotToken,
57
'=' =>
RoutePatternKind
.EqualsToken,
58
':' =>
RoutePatternKind
.ColonToken,
59
'*' =>
RoutePatternKind
.AsteriskToken,
60
'(' =>
RoutePatternKind
.OpenParenToken,
61
')' =>
RoutePatternKind
.CloseParenToken,
62
'?' =>
RoutePatternKind
.QuestionMarkToken,
63
',' =>
RoutePatternKind
.CommaToken,
64
_ =>
RoutePatternKind
.TextToken,
140
var token = CreateToken(
RoutePatternKind
.Literal, GetSubPatternToCurrentPos(start));
218
var token = CreateToken(
RoutePatternKind
.ParameterNameToken, GetSubPatternToCurrentPos(start));
291
var token = CreateToken(
RoutePatternKind
.PolicyFragmentToken, GetSubPatternToCurrentPos(start));
381
var token = CreateToken(
RoutePatternKind
.PolicyFragmentToken, GetSubPatternToCurrentPos(start));
424
var token = CreateToken(
RoutePatternKind
.ReplacementToken, GetSubPatternToCurrentPos(start));
465
var token = CreateToken(
RoutePatternKind
.DefaultValueToken, GetSubPatternToCurrentPos(start));
Infrastructure\RoutePattern\RoutePatternNode.cs (2)
9
internal abstract class RoutePatternNode : EmbeddedSyntaxNode<
RoutePatternKind
, RoutePatternNode>
11
protected RoutePatternNode(
RoutePatternKind
kind) : base(kind)
Infrastructure\RoutePattern\RoutePatternNodes.cs (38)
11
using RoutePatternNodeOrToken = EmbeddedSyntaxNodeOrToken<
RoutePatternKind
, RoutePatternNode>;
12
using RoutePatternToken = EmbeddedSyntaxToken<
RoutePatternKind
>;
17
: base(
RoutePatternKind
.CompilationUnit)
20
Debug.Assert(endOfFileToken.Kind ==
RoutePatternKind
.EndOfFile);
51
: base(
RoutePatternKind
.Segment)
70
: base(
RoutePatternKind
.Replacement)
72
Debug.Assert(openBracketToken.Kind ==
RoutePatternKind
.OpenBracketToken);
73
Debug.Assert(textToken.Kind ==
RoutePatternKind
.ReplacementToken);
74
Debug.Assert(closeBracketToken.Kind ==
RoutePatternKind
.CloseBracketToken);
106
: base(
RoutePatternKind
.Parameter)
108
Debug.Assert(openBraceToken.Kind ==
RoutePatternKind
.OpenBraceToken);
109
Debug.Assert(closeBraceToken.Kind ==
RoutePatternKind
.CloseBraceToken);
144
: base(
RoutePatternKind
.Literal)
146
Debug.Assert(literalToken.Kind ==
RoutePatternKind
.Literal);
168
: base(
RoutePatternKind
.Separator)
170
Debug.Assert(separatorToken.Kind ==
RoutePatternKind
.DotToken);
192
: base(
RoutePatternKind
.Separator)
194
Debug.Assert(separatorToken.Kind ==
RoutePatternKind
.SlashToken);
216
: base(
RoutePatternKind
.CatchAll)
218
Debug.Assert(asteriskToken.Kind ==
RoutePatternKind
.AsteriskToken);
240
: base(
RoutePatternKind
.Optional)
242
Debug.Assert(questionMarkToken.Kind ==
RoutePatternKind
.QuestionMarkToken);
264
: base(
RoutePatternKind
.DefaultValue)
266
Debug.Assert(equalsToken.Kind ==
RoutePatternKind
.EqualsToken);
267
Debug.Assert(defaultValueToken.Kind ==
RoutePatternKind
.DefaultValueToken);
292
: base(
RoutePatternKind
.ParameterName)
294
Debug.Assert(parameterNameToken.Kind ==
RoutePatternKind
.ParameterNameToken);
316
: base(
RoutePatternKind
.ParameterPolicy)
318
Debug.Assert(colonToken.Kind ==
RoutePatternKind
.ColonToken);
343
: base(
RoutePatternKind
.PolicyFragmentEscaped)
345
Debug.Assert(openParenToken.Kind ==
RoutePatternKind
.OpenParenToken);
346
Debug.Assert(argumentToken.Kind ==
RoutePatternKind
.PolicyFragmentToken);
347
Debug.Assert(closeParenToken.Kind ==
RoutePatternKind
.CloseParenToken);
375
: base(
RoutePatternKind
.PolicyFragment)
377
Debug.Assert(argumentToken.Kind ==
RoutePatternKind
.PolicyFragmentToken);
398
protected RoutePatternRootPartNode(
RoutePatternKind
kind)
406
protected RoutePatternSegmentPartNode(
RoutePatternKind
kind)
414
protected RoutePatternParameterPartNode(
RoutePatternKind
kind)
Infrastructure\RoutePattern\RoutePatternParser.cs (59)
17
using RoutePatternToken = EmbeddedSyntaxToken<
RoutePatternKind
>;
66
Debug.Assert(_currentToken.Kind ==
RoutePatternKind
.EndOfFile);
88
firstNode?.Kind ==
RoutePatternKind
.Segment)
92
segmentPart?.Kind ==
RoutePatternKind
.Literal)
113
secondNode?.Kind ==
RoutePatternKind
.Separator)
130
if (part.TryGetNode(
RoutePatternKind
.Segment, out var segmentNode))
142
if (segmentPart.TryGetNode(
RoutePatternKind
.Parameter, out var parameterNode))
144
var catchAllParameterPart = parameterNode.GetChildNode(
RoutePatternKind
.CatchAll);
164
if (part.TryGetNode(
RoutePatternKind
.Segment, out var segmentNode))
168
if (previousNode != null && previousNode.Kind ==
RoutePatternKind
.Parameter)
171
var isOptional = previousParameterNode.GetChildNode(
RoutePatternKind
.Optional) != null;
176
previousParameterNode.GetChildNode(
RoutePatternKind
.ParameterName)!.ToString(),
182
if (previousNode != null && segmentPart.TryGetNode(
RoutePatternKind
.Parameter, out var parameterNode))
184
var isOptional = parameterNode.GetChildNode(
RoutePatternKind
.Optional) != null;
189
if (previousNode.Kind !=
RoutePatternKind
.Literal || ((RoutePatternLiteralNode)previousNode).LiteralToken.Value!.ToString() != ".")
193
parameterNode.GetChildNode(
RoutePatternKind
.ParameterName)!.ToString(),
200
if (previousNode.Kind ==
RoutePatternKind
.Parameter)
217
if (part.TryGetNode(
RoutePatternKind
.Segment, out var segmentNode))
221
if (segmentPart.TryGetNode(
RoutePatternKind
.Parameter, out var parameterNode))
235
case
RoutePatternKind
.ParameterName:
242
case
RoutePatternKind
.Optional:
245
case
RoutePatternKind
.DefaultValue:
252
case
RoutePatternKind
.CatchAll:
257
case
RoutePatternKind
.ParameterPolicy:
296
if (part.TryGetNode(
RoutePatternKind
.Separator, out var separatorNode))
352
while (_currentToken.Kind !=
RoutePatternKind
.EndOfFile)
363
RoutePatternKind
.SlashToken => ParseSegmentSeparator(),
371
while (_currentToken.Kind !=
RoutePatternKind
.EndOfFile &&
372
_currentToken.Kind !=
RoutePatternKind
.SlashToken)
382
if (_currentToken.Kind ==
RoutePatternKind
.OpenBraceToken)
388
if (_currentToken.Kind !=
RoutePatternKind
.OpenBraceToken)
397
else if (_currentToken.Kind ==
RoutePatternKind
.OpenBracketToken && _routePatternOptions.SupportTokenReplacement)
403
if (_currentToken.Kind !=
RoutePatternKind
.OpenBracketToken)
430
if (_currentToken.Kind !=
RoutePatternKind
.EndOfFile)
450
replacementToken = CreateMissingToken(
RoutePatternKind
.ReplacementToken);
451
if (_currentToken.Kind !=
RoutePatternKind
.EndOfFile)
463
ConsumeToken(
RoutePatternKind
.CloseBracketToken, Resources.AttributeRoute_TokenReplacement_UnclosedToken));
471
ConsumeToken(
RoutePatternKind
.CloseBraceToken, Resources.TemplateRoute_MismatchedParameter));
476
private RoutePatternToken ConsumeToken(
RoutePatternKind
kind, string? error)
497
if (_currentToken.Kind ==
RoutePatternKind
.AsteriskToken)
503
if (_currentToken.Kind ==
RoutePatternKind
.AsteriskToken)
506
RoutePatternKind
.AsteriskToken,
527
if (_currentToken.Kind !=
RoutePatternKind
.EndOfFile)
530
CreateMissingToken(
RoutePatternKind
.ParameterNameToken).AddDiagnosticIfNone(
538
while (_currentToken.Kind !=
RoutePatternKind
.EndOfFile)
542
case
RoutePatternKind
.ColonToken:
545
case
RoutePatternKind
.QuestionMarkToken:
548
case
RoutePatternKind
.EqualsToken:
551
case
RoutePatternKind
.CloseBraceToken:
563
var defaultValue = _lexer.TryScanDefaultValue() ?? CreateMissingToken(
RoutePatternKind
.DefaultValueToken);
575
while (_currentToken.Kind !=
RoutePatternKind
.EndOfFile &&
576
_currentToken.Kind !=
RoutePatternKind
.CloseBraceToken &&
577
_currentToken.Kind !=
RoutePatternKind
.ColonToken &&
578
_currentToken.Kind !=
RoutePatternKind
.QuestionMarkToken &&
579
_currentToken.Kind !=
RoutePatternKind
.EqualsToken)
583
if (_currentToken.Kind ==
RoutePatternKind
.OpenParenToken)
594
_currentToken.Kind ==
RoutePatternKind
.EndOfFile
595
? CreateMissingToken(
RoutePatternKind
.CloseParenToken)
619
return token.Kind ==
RoutePatternKind
.EndOfFile
Infrastructure\RoutePattern\RoutePatternTree.cs (1)
13
internal sealed class RoutePatternTree : EmbeddedSyntaxTree<
RoutePatternKind
, RoutePatternNode, RoutePatternCompilationUnit>
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
26
using RoutePatternToken = Microsoft.AspNetCore.Analyzers.Infrastructure.EmbeddedSyntax.EmbeddedSyntaxToken<Microsoft.AspNetCore.Analyzers.Infrastructure.RoutePattern.
RoutePatternKind
>;
RouteEmbeddedLanguage\RoutePatternBraceMatcher.cs (1)
12
using RoutePatternToken = Microsoft.AspNetCore.Analyzers.Infrastructure.EmbeddedSyntax.EmbeddedSyntaxToken<Microsoft.AspNetCore.Analyzers.Infrastructure.RoutePattern.
RoutePatternKind
>;
RouteEmbeddedLanguage\RoutePatternClassifier.cs (1)
10
using RoutePatternToken = Microsoft.AspNetCore.Analyzers.Infrastructure.EmbeddedSyntax.EmbeddedSyntaxToken<Microsoft.AspNetCore.Analyzers.Infrastructure.RoutePattern.
RoutePatternKind
>;
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (5)
22
using RoutePatternToken = Microsoft.AspNetCore.Analyzers.Infrastructure.EmbeddedSyntax.EmbeddedSyntaxToken<Microsoft.AspNetCore.Analyzers.Infrastructure.RoutePattern.
RoutePatternKind
>;
183
case
RoutePatternKind
.ColonToken:
186
case
RoutePatternKind
.OpenBraceToken:
208
case
RoutePatternKind
.PolicyFragmentToken:
212
case
RoutePatternKind
.ParameterNameToken: