diff --git a/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorIntermediateNodeLoweringPhase.cs b/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorIntermediateNodeLoweringPhase.cs index a711567547..762fd61d63 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorIntermediateNodeLoweringPhase.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorIntermediateNodeLoweringPhase.cs @@ -595,9 +595,9 @@ namespace Microsoft.AspNetCore.Razor.Language { if (span.Tokens.Count == 1) { - var token = span.Tokens[0] as HtmlToken; + var token = span.Tokens[0]; if (token != null && - token.Type == HtmlTokenType.Unknown && + token.Kind == SyntaxKind.Unknown && token.Content.Length == 0) { // We don't want to create IR nodes for marker tokens. diff --git a/src/Microsoft.AspNetCore.Razor.Language/DirectiveTokenEditHandler.cs b/src/Microsoft.AspNetCore.Razor.Language/DirectiveTokenEditHandler.cs index 308c274518..b6e2c5f2cd 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/DirectiveTokenEditHandler.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/DirectiveTokenEditHandler.cs @@ -4,12 +4,13 @@ using System; using System.Collections.Generic; using Microsoft.AspNetCore.Razor.Language.Legacy; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language { internal class DirectiveTokenEditHandler : SpanEditHandler { - public DirectiveTokenEditHandler(Func> tokenizer) : base(tokenizer) + public DirectiveTokenEditHandler(Func> tokenizer) : base(tokenizer) { } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/AutoCompleteEditHandler.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/AutoCompleteEditHandler.cs index 3aecb29a52..a20dbddfb9 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/AutoCompleteEditHandler.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/AutoCompleteEditHandler.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -11,18 +12,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { private static readonly int TypeHashCode = typeof(AutoCompleteEditHandler).GetHashCode(); - public AutoCompleteEditHandler(Func> tokenizer) + public AutoCompleteEditHandler(Func> tokenizer) : base(tokenizer) { } - public AutoCompleteEditHandler(Func> tokenizer, bool autoCompleteAtEndOfSpan) + public AutoCompleteEditHandler(Func> tokenizer, bool autoCompleteAtEndOfSpan) : this(tokenizer) { AutoCompleteAtEndOfSpan = autoCompleteAtEndOfSpan; } - public AutoCompleteEditHandler(Func> tokenizer, AcceptedCharactersInternal accepted) + public AutoCompleteEditHandler(Func> tokenizer, AcceptedCharactersInternal accepted) : base(tokenizer, accepted) { } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpCodeParser.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpCodeParser.cs index a75c983fec..73bd432faf 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpCodeParser.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpCodeParser.cs @@ -5,17 +5,18 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { - internal class CSharpCodeParser : TokenizerBackedParser + internal class CSharpCodeParser : TokenizerBackedParser { private static HashSet InvalidNonWhitespaceNameCharacters = new HashSet(new[] { '@', '!', '<', '/', '?', '[', '>', ']', '=', '"', '\'', '*' }); - private static readonly Func IsValidStatementSpacingToken = + private static readonly Func IsValidStatementSpacingToken = IsSpacingToken(includeNewLines: true, includeComments: true); internal static readonly DirectiveDescriptor AddTagHelperDirectiveDescriptor = DirectiveDescriptor.CreateDirective( @@ -102,7 +103,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public bool IsNested { get; set; } - protected override bool TokenTypeEquals(CSharpTokenType x, CSharpTokenType y) => x == y; + protected override bool TokenKindEquals(SyntaxKind x, SyntaxKind y) => x == y; protected void MapDirectives(Action handler, params string[] directives) { @@ -161,16 +162,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Conditional("DEBUG")] internal void Assert(CSharpKeyword expectedKeyword) { - Debug.Assert(CurrentToken.Type == CSharpTokenType.Keyword && - CurrentToken.Keyword.HasValue && - CurrentToken.Keyword.Value == expectedKeyword); + var result = CSharpTokenizer.GetTokenKeyword(CurrentToken); + Debug.Assert(CurrentToken.Kind == SyntaxKind.Keyword && + result.HasValue && + result.Value == expectedKeyword); } protected internal bool At(CSharpKeyword keyword) { - return At(CSharpTokenType.Keyword) && - CurrentToken.Keyword.HasValue && - CurrentToken.Keyword.Value == keyword; + var result = CSharpTokenizer.GetTokenKeyword(CurrentToken); + return At(SyntaxKind.Keyword) && + result.HasValue && + result.Value == keyword; } protected internal bool AcceptIf(CSharpKeyword keyword) @@ -183,11 +186,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return false; } - protected static Func IsSpacingToken(bool includeNewLines, bool includeComments) + protected static Func IsSpacingToken(bool includeNewLines, bool includeComments) { - return token => token.Type == CSharpTokenType.WhiteSpace || - (includeNewLines && token.Type == CSharpTokenType.NewLine) || - (includeComments && token.Type == CSharpTokenType.Comment); + return token => token.Kind == SyntaxKind.Whitespace || + (includeNewLines && token.Kind == SyntaxKind.NewLine) || + (includeComments && token.Kind == SyntaxKind.CSharpComment); } public override void ParseBlock() @@ -209,24 +212,24 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy AcceptWhile(IsSpacingToken(includeNewLines: true, includeComments: true)); var current = CurrentToken; - if (At(CSharpTokenType.StringLiteral) && + if (At(SyntaxKind.StringLiteral) && CurrentToken.Content.Length > 0 && CurrentToken.Content[0] == SyntaxConstants.TransitionCharacter) { - var split = Language.SplitToken(CurrentToken, 1, CSharpTokenType.Transition); + var split = Language.SplitToken(CurrentToken, 1, SyntaxKind.Transition); current = split.Item1; // Back up to the end of the transition Context.Source.Position -= split.Item2.Content.Length; NextToken(); } - else if (At(CSharpTokenType.Transition)) + else if (At(SyntaxKind.Transition)) { NextToken(); } // Accept "@" if we see it, but if we don't, that's OK. We assume we were started for a good reason - if (current.Type == CSharpTokenType.Transition) + if (current.Kind == SyntaxKind.Transition) { if (Span.Tokens.Count > 0) { @@ -251,9 +254,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy span.ChunkGenerator = new StatementChunkGenerator(); } - private void AtTransition(CSharpToken current) + private void AtTransition(SyntaxToken current) { - Debug.Assert(current.Type == CSharpTokenType.Transition); + Debug.Assert(current.Kind == SyntaxKind.Transition); Accept(current); Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None; Span.ChunkGenerator = SpanChunkGenerator.Null; @@ -273,14 +276,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // What type of block is this? if (!EndOfFile) { - if (CurrentToken.Type == CSharpTokenType.LeftParenthesis) + if (CurrentToken.Kind == SyntaxKind.LeftParenthesis) { Context.Builder.CurrentBlock.Type = BlockKindInternal.Expression; Context.Builder.CurrentBlock.ChunkGenerator = new ExpressionChunkGenerator(); ExplicitExpression(); return; } - else if (CurrentToken.Type == CSharpTokenType.Identifier) + else if (CurrentToken.Kind == SyntaxKind.Identifier) { if (TryGetDirectiveHandler(CurrentToken.Content, out var handler)) { @@ -306,7 +309,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return; } } - else if (CurrentToken.Type == CSharpTokenType.Keyword) + else if (CurrentToken.Kind == SyntaxKind.Keyword) { if (TryGetDirectiveHandler(CurrentToken.Content, out var handler)) { @@ -320,7 +323,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return; } } - else if (CurrentToken.Type == CSharpTokenType.LeftBrace) + else if (CurrentToken.Kind == SyntaxKind.LeftBrace) { VerbatimBlock(); return; @@ -339,7 +342,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { AcceptedCharacters = AcceptedCharactersInternal.NonWhiteSpace }; - if (At(CSharpTokenType.WhiteSpace) || At(CSharpTokenType.NewLine)) + if (At(SyntaxKind.Whitespace) || At(SyntaxKind.NewLine)) { Context.ErrorSink.OnError( RazorDiagnosticFactory.CreateParsing_UnexpectedWhiteSpaceAtStartOfCodeBlock( @@ -369,7 +372,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void VerbatimBlock() { - Assert(CSharpTokenType.LeftBrace); + Assert(SyntaxKind.LeftBrace); var block = new Block(Resources.BlockName_Code, CurrentStart); AcceptAndMoveNext(); @@ -385,13 +388,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Span.ChunkGenerator = new StatementChunkGenerator(); AddMarkerTokenIfNecessary(); - if (!At(CSharpTokenType.RightBrace)) + if (!At(SyntaxKind.RightBrace)) { editHandler.AutoCompleteString = "}"; } Output(SpanKindInternal.Code); - if (Optional(CSharpTokenType.RightBrace)) + if (Optional(SyntaxKind.RightBrace)) { // Set up the "}" span Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None; @@ -401,8 +404,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy if (!IsNested) { EnsureCurrent(); - if (At(CSharpTokenType.NewLine) || - (At(CSharpTokenType.WhiteSpace) && NextIs(CSharpTokenType.NewLine))) + if (At(SyntaxKind.NewLine) || + (At(SyntaxKind.Whitespace) && NextIs(SyntaxKind.NewLine))) { Context.NullGenerateWhitespaceAndNewLine = true; } @@ -456,13 +459,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { if (!EndOfFile) { - if (CurrentToken.Type == CSharpTokenType.LeftParenthesis || - CurrentToken.Type == CSharpTokenType.LeftBracket) + if (CurrentToken.Kind == SyntaxKind.LeftParenthesis || + CurrentToken.Kind == SyntaxKind.LeftBracket) { // If we end within "(", whitespace is fine Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.Any; - CSharpTokenType right; + SyntaxKind right; bool success; using (PushSpanConfig((span, prev) => @@ -471,13 +474,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.Any; })) { - right = Language.FlipBracket(CurrentToken.Type); + right = Language.FlipBracket(CurrentToken.Kind); success = Balance(BalancingModes.BacktrackOnFailure | BalancingModes.AllowCommentsAndTemplates); } if (!success) { - AcceptUntil(CSharpTokenType.LessThan); + AcceptUntil(SyntaxKind.LessThan); } if (At(right)) { @@ -488,22 +491,22 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } return MethodCallOrArrayIndex(acceptedCharacters); } - if (At(CSharpTokenType.QuestionMark)) + if (At(SyntaxKind.QuestionMark)) { var next = Lookahead(count: 1); if (next != null) { - if (next.Type == CSharpTokenType.Dot) + if (next.Kind == SyntaxKind.Dot) { // Accept null conditional dot operator (?.). AcceptAndMoveNext(); AcceptAndMoveNext(); // If the next piece after the ?. is a keyword or identifier then we want to continue. - return At(CSharpTokenType.Identifier) || At(CSharpTokenType.Keyword); + return At(SyntaxKind.Identifier) || At(SyntaxKind.Keyword); } - else if (next.Type == CSharpTokenType.LeftBracket) + else if (next.Kind == SyntaxKind.LeftBracket) { // We're at the ? for a null conditional bracket operator (?[). AcceptAndMoveNext(); @@ -513,12 +516,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } } - else if (At(CSharpTokenType.Dot)) + else if (At(SyntaxKind.Dot)) { var dot = CurrentToken; if (NextToken()) { - if (At(CSharpTokenType.Identifier) || At(CSharpTokenType.Keyword)) + if (At(SyntaxKind.Identifier) || At(SyntaxKind.Keyword)) { // Accept the dot and return to the start Accept(dot); @@ -540,7 +543,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Accept(dot); } } - else if (!At(CSharpTokenType.WhiteSpace) && !At(CSharpTokenType.NewLine)) + else if (!At(SyntaxKind.Whitespace) && !At(SyntaxKind.NewLine)) { PutCurrentBack(); } @@ -587,8 +590,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void CaptureWhitespaceAtEndOfCodeOnlyLine() { - var whitespace = ReadWhile(token => token.Type == CSharpTokenType.WhiteSpace); - if (At(CSharpTokenType.NewLine)) + var whitespace = ReadWhile(token => token.Kind == SyntaxKind.Whitespace); + if (At(SyntaxKind.NewLine)) { Accept(whitespace); AcceptAndMoveNext(); @@ -610,7 +613,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void ExplicitExpression() { var block = new Block(Resources.BlockName_ExplicitExpression, CurrentStart); - Assert(CSharpTokenType.LeftParenthesis); + Assert(SyntaxKind.LeftParenthesis); AcceptAndMoveNext(); Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None; Span.ChunkGenerator = SpanChunkGenerator.Null; @@ -621,13 +624,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy BalancingModes.BacktrackOnFailure | BalancingModes.NoErrorOnFailure | BalancingModes.AllowCommentsAndTemplates, - CSharpTokenType.LeftParenthesis, - CSharpTokenType.RightParenthesis, + SyntaxKind.LeftParenthesis, + SyntaxKind.RightParenthesis, block.Start); if (!success) { - AcceptUntil(CSharpTokenType.LessThan); + AcceptUntil(SyntaxKind.LessThan); Context.ErrorSink.OnError( RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF( new SourceSpan(block.Start, contentLength: 1 /* ( */), block.Name, ")", "(")); @@ -636,13 +639,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // If necessary, put an empty-content marker token here if (Span.Tokens.Count == 0) { - Accept(new CSharpToken(string.Empty, CSharpTokenType.Unknown)); + Accept(SyntaxFactory.Token(SyntaxKind.Unknown, string.Empty)); } // Output the content span and then capture the ")" Output(SpanKindInternal.Code); } - Optional(CSharpTokenType.RightParenthesis); + Optional(SyntaxKind.RightParenthesis); if (!EndOfFile) { PutCurrentBack(); @@ -702,7 +705,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // No embedded transitions in C#, so ignore that param return allowTemplatesAndComments && ((Language.IsTransition(CurrentToken) - && NextIs(CSharpTokenType.LessThan, CSharpTokenType.Colon, CSharpTokenType.DoubleColon)) + && NextIs(SyntaxKind.LessThan, SyntaxKind.Colon, SyntaxKind.DoubleColon)) || Language.IsCommentStart(CurrentToken)); } @@ -783,12 +786,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void CaseStatement(bool topLevel) { - Assert(CSharpTokenType.Keyword); - Debug.Assert(CurrentToken.Keyword != null && - (CurrentToken.Keyword.Value == CSharpKeyword.Case || - CurrentToken.Keyword.Value == CSharpKeyword.Default)); - AcceptUntil(CSharpTokenType.Colon); - Optional(CSharpTokenType.Colon); + Assert(SyntaxKind.Keyword); + var result = CSharpTokenizer.GetTokenKeyword(CurrentToken); + Debug.Assert(result.HasValue && + (result.Value == CSharpKeyword.Case || + result.Value == CSharpKeyword.Default)); + AcceptUntil(SyntaxKind.Colon); + Optional(SyntaxKind.Colon); } private void DoStatement(bool topLevel) @@ -813,7 +817,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Assert(CSharpKeyword.While); AcceptAndMoveNext(); AcceptWhile(IsSpacingToken(includeNewLines: true, includeComments: true)); - if (AcceptCondition() && Optional(CSharpTokenType.Semicolon)) + if (AcceptCondition() && Optional(SyntaxKind.Semicolon)) { Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None; } @@ -832,12 +836,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy AcceptAndMoveNext(); AcceptWhile(IsSpacingToken(includeNewLines: false, includeComments: true)); - if (At(CSharpTokenType.LeftParenthesis)) + if (At(SyntaxKind.LeftParenthesis)) { // using ( ==> Using Statement UsingStatement(block); } - else if (At(CSharpTokenType.Identifier) || At(CSharpKeyword.Static)) + else if (At(SyntaxKind.Identifier) || At(CSharpKeyword.Static)) { // using Identifier ==> Using Declaration if (!topLevel) @@ -865,16 +869,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Context.Builder.CurrentBlock.Type = BlockKindInternal.Directive; var start = CurrentStart; - if (At(CSharpTokenType.Identifier)) + if (At(SyntaxKind.Identifier)) { // non-static using NamespaceOrTypeName(); var whitespace = ReadWhile(IsSpacingToken(includeNewLines: true, includeComments: true)); - if (At(CSharpTokenType.Assign)) + if (At(SyntaxKind.Assign)) { // Alias Accept(whitespace); - Assert(CSharpTokenType.Assign); + Assert(SyntaxKind.Assign); AcceptAndMoveNext(); AcceptWhile(IsSpacingToken(includeNewLines: true, includeComments: true)); @@ -904,7 +908,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Optional ";" if (EnsureCurrent()) { - Optional(CSharpTokenType.Semicolon); + Optional(SyntaxKind.Semicolon); } } @@ -919,16 +923,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var expectingDot = false; var tokens = ReadWhile(token => { - var type = token.Type; - if ((expectingDot && type == CSharpTokenType.Dot) || - (!expectingDot && type == CSharpTokenType.Identifier)) + var type = token.Kind; + if ((expectingDot && type == SyntaxKind.Dot) || + (!expectingDot && type == SyntaxKind.Identifier)) { expectingDot = !expectingDot; return true; } - if (type != CSharpTokenType.WhiteSpace && - type != CSharpTokenType.NewLine) + if (type != SyntaxKind.Whitespace && + type != SyntaxKind.NewLine) { expectingDot = false; currentIdentifierLength += token.Content.Length; @@ -966,69 +970,69 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected bool NamespaceOrTypeName() { - if (Optional(CSharpTokenType.LeftParenthesis)) + if (Optional(SyntaxKind.LeftParenthesis)) { - while (!Optional(CSharpTokenType.RightParenthesis) && !EndOfFile) + while (!Optional(SyntaxKind.RightParenthesis) && !EndOfFile) { - Optional(CSharpTokenType.WhiteSpace); + Optional(SyntaxKind.Whitespace); if (!NamespaceOrTypeName()) { return false; } - Optional(CSharpTokenType.WhiteSpace); - Optional(CSharpTokenType.Identifier); - Optional(CSharpTokenType.WhiteSpace); - Optional(CSharpTokenType.Comma); + Optional(SyntaxKind.Whitespace); + Optional(SyntaxKind.Identifier); + Optional(SyntaxKind.Whitespace); + Optional(SyntaxKind.Comma); } - if (At(CSharpTokenType.WhiteSpace) && NextIs(CSharpTokenType.QuestionMark)) + if (At(SyntaxKind.Whitespace) && NextIs(SyntaxKind.QuestionMark)) { // Only accept the whitespace if we are going to consume the next token. AcceptAndMoveNext(); } - Optional(CSharpTokenType.QuestionMark); // Nullable + Optional(SyntaxKind.QuestionMark); // Nullable return true; } - else if (Optional(CSharpTokenType.Identifier) || Optional(CSharpTokenType.Keyword)) + else if (Optional(SyntaxKind.Identifier) || Optional(SyntaxKind.Keyword)) { - if (Optional(CSharpTokenType.DoubleColon)) + if (Optional(SyntaxKind.DoubleColon)) { - if (!Optional(CSharpTokenType.Identifier)) + if (!Optional(SyntaxKind.Identifier)) { - Optional(CSharpTokenType.Keyword); + Optional(SyntaxKind.Keyword); } } - if (At(CSharpTokenType.LessThan)) + if (At(SyntaxKind.LessThan)) { TypeArgumentList(); } - if (Optional(CSharpTokenType.Dot)) + if (Optional(SyntaxKind.Dot)) { NamespaceOrTypeName(); } - if (At(CSharpTokenType.WhiteSpace) && NextIs(CSharpTokenType.QuestionMark)) + if (At(SyntaxKind.Whitespace) && NextIs(SyntaxKind.QuestionMark)) { // Only accept the whitespace if we are going to consume the next token. AcceptAndMoveNext(); } - Optional(CSharpTokenType.QuestionMark); // Nullable + Optional(SyntaxKind.QuestionMark); // Nullable - if (At(CSharpTokenType.WhiteSpace) && NextIs(CSharpTokenType.LeftBracket)) + if (At(SyntaxKind.Whitespace) && NextIs(SyntaxKind.LeftBracket)) { // Only accept the whitespace if we are going to consume the next token. AcceptAndMoveNext(); } - while (At(CSharpTokenType.LeftBracket)) + while (At(SyntaxKind.LeftBracket)) { Balance(BalancingModes.None); - Optional(CSharpTokenType.RightBracket); + Optional(SyntaxKind.RightBracket); } return true; } @@ -1040,14 +1044,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void TypeArgumentList() { - Assert(CSharpTokenType.LessThan); + Assert(SyntaxKind.LessThan); Balance(BalancingModes.None); - Optional(CSharpTokenType.GreaterThan); + Optional(SyntaxKind.GreaterThan); } private void UsingStatement(Block block) { - Assert(CSharpTokenType.LeftParenthesis); + Assert(SyntaxKind.LeftParenthesis); // Parse condition if (AcceptCondition()) @@ -1159,12 +1163,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy if (!EndOfFile) { // Check for "{" to make sure we're at a block - if (!At(CSharpTokenType.LeftBrace)) + if (!At(SyntaxKind.LeftBrace)) { Context.ErrorSink.OnError( RazorDiagnosticFactory.CreateParsing_SingleLineControlFlowStatementsNotAllowed( new SourceSpan(CurrentStart, CurrentToken.Content.Length), - Language.GetSample(CSharpTokenType.LeftBrace), + Language.GetSample(SyntaxKind.LeftBrace), CurrentToken.Content)); } @@ -1175,7 +1179,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void UnconditionalBlock() { - Assert(CSharpTokenType.Keyword); + Assert(SyntaxKind.Keyword); var block = new Block(CurrentToken, CurrentStart); AcceptAndMoveNext(); AcceptWhile(IsSpacingToken(includeNewLines: true, includeComments: true)); @@ -1219,7 +1223,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void ConditionalBlock(bool topLevel) { - Assert(CSharpTokenType.Keyword); + Assert(SyntaxKind.Keyword); var block = new Block(CurrentToken, CurrentStart); ConditionalBlock(block); if (topLevel) @@ -1243,16 +1247,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private bool AcceptCondition() { - if (At(CSharpTokenType.LeftParenthesis)) + if (At(SyntaxKind.LeftParenthesis)) { var complete = Balance(BalancingModes.BacktrackOnFailure | BalancingModes.AllowCommentsAndTemplates); if (!complete) { - AcceptUntil(CSharpTokenType.NewLine); + AcceptUntil(SyntaxKind.NewLine); } else { - Optional(CSharpTokenType.RightParenthesis); + Optional(SyntaxKind.RightParenthesis); } return complete; } @@ -1280,16 +1284,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return; } - var type = CurrentToken.Type; + var type = CurrentToken.Kind; var loc = CurrentStart; // Both cases @: and @:: are triggered as markup, second colon in second case will be triggered as a plain text - var isSingleLineMarkup = type == CSharpTokenType.Transition && - (NextIs(CSharpTokenType.Colon, CSharpTokenType.DoubleColon)); + var isSingleLineMarkup = type == SyntaxKind.Transition && + (NextIs(SyntaxKind.Colon, SyntaxKind.DoubleColon)); var isMarkup = isSingleLineMarkup || - type == CSharpTokenType.LessThan || - (type == CSharpTokenType.Transition && NextIs(CSharpTokenType.LessThan)); + type == SyntaxKind.LessThan || + (type == SyntaxKind.Transition && NextIs(SyntaxKind.LessThan)); if (Context.DesignTimeMode || !isMarkup) { @@ -1321,7 +1325,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy if (isMarkup) { - if (type == CSharpTokenType.Transition && !isSingleLineMarkup) + if (type == SyntaxKind.Transition && !isSingleLineMarkup) { Context.ErrorSink.OnError( RazorDiagnosticFactory.CreateParsing_AtInCodeMustBeFollowedByColonParenOrIdentifierStart( @@ -1331,7 +1335,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Markup block Output(SpanKindInternal.Code); if (Context.DesignTimeMode && CurrentToken != null && - (CurrentToken.Type == CSharpTokenType.LessThan || CurrentToken.Type == CSharpTokenType.Transition)) + (CurrentToken.Kind == SyntaxKind.LessThan || CurrentToken.Kind == SyntaxKind.Transition)) { PutCurrentBack(); } @@ -1344,33 +1348,33 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - private void HandleStatement(Block block, CSharpTokenType type) + private void HandleStatement(Block block, SyntaxKind type) { switch (type) { - case CSharpTokenType.RazorCommentTransition: + case SyntaxKind.RazorCommentTransition: Output(SpanKindInternal.Code); RazorComment(); Statement(block); break; - case CSharpTokenType.LeftBrace: + case SyntaxKind.LeftBrace: // Verbatim Block block = block ?? new Block(Resources.BlockName_Code, CurrentStart); AcceptAndMoveNext(); CodeBlock(block); break; - case CSharpTokenType.Keyword: + case SyntaxKind.Keyword: // Keyword block HandleKeyword(false, StandardStatement); break; - case CSharpTokenType.Transition: + case SyntaxKind.Transition: // Embedded Expression block EmbeddedExpression(); break; - case CSharpTokenType.RightBrace: + case SyntaxKind.RightBrace: // Possible end of Code Block, just run the continuation break; - case CSharpTokenType.Comment: + case SyntaxKind.CSharpComment: AcceptAndMoveNext(); break; default: @@ -1383,11 +1387,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void EmbeddedExpression() { // First, verify the type of the block - Assert(CSharpTokenType.Transition); + Assert(SyntaxKind.Transition); var transition = CurrentToken; NextToken(); - if (At(CSharpTokenType.Transition)) + if (At(SyntaxKind.Transition)) { // Escaped "@" Output(SpanKindInternal.Code); @@ -1397,14 +1401,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Span.ChunkGenerator = SpanChunkGenerator.Null; Output(SpanKindInternal.Code); - Assert(CSharpTokenType.Transition); + Assert(SyntaxKind.Transition); AcceptAndMoveNext(); StandardStatement(); } else { // Throw errors as necessary, but continue parsing - if (At(CSharpTokenType.LeftBrace)) + if (At(SyntaxKind.LeftBrace)) { Context.ErrorSink.OnError( RazorDiagnosticFactory.CreateParsing_UnexpectedNestedCodeBlock( @@ -1428,48 +1432,48 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { var bookmark = CurrentStart.AbsoluteIndex; var read = ReadWhile(token => - token.Type != CSharpTokenType.Semicolon && - token.Type != CSharpTokenType.RazorCommentTransition && - token.Type != CSharpTokenType.Transition && - token.Type != CSharpTokenType.LeftBrace && - token.Type != CSharpTokenType.LeftParenthesis && - token.Type != CSharpTokenType.LeftBracket && - token.Type != CSharpTokenType.RightBrace); + token.Kind != SyntaxKind.Semicolon && + token.Kind != SyntaxKind.RazorCommentTransition && + token.Kind != SyntaxKind.Transition && + token.Kind != SyntaxKind.LeftBrace && + token.Kind != SyntaxKind.LeftParenthesis && + token.Kind != SyntaxKind.LeftBracket && + token.Kind != SyntaxKind.RightBrace); - if (At(CSharpTokenType.LeftBrace) || - At(CSharpTokenType.LeftParenthesis) || - At(CSharpTokenType.LeftBracket)) + if (At(SyntaxKind.LeftBrace) || + At(SyntaxKind.LeftParenthesis) || + At(SyntaxKind.LeftBracket)) { Accept(read); if (Balance(BalancingModes.AllowCommentsAndTemplates | BalancingModes.BacktrackOnFailure)) { - Optional(CSharpTokenType.RightBrace); + Optional(SyntaxKind.RightBrace); } else { // Recovery - AcceptUntil(CSharpTokenType.LessThan, CSharpTokenType.RightBrace); + AcceptUntil(SyntaxKind.LessThan, SyntaxKind.RightBrace); return; } } - else if (At(CSharpTokenType.Transition) && (NextIs(CSharpTokenType.LessThan, CSharpTokenType.Colon))) + else if (At(SyntaxKind.Transition) && (NextIs(SyntaxKind.LessThan, SyntaxKind.Colon))) { Accept(read); Output(SpanKindInternal.Code); Template(); } - else if (At(CSharpTokenType.RazorCommentTransition)) + else if (At(SyntaxKind.RazorCommentTransition)) { Accept(read); RazorComment(); } - else if (At(CSharpTokenType.Semicolon)) + else if (At(SyntaxKind.Semicolon)) { Accept(read); AcceptAndMoveNext(); return; } - else if (At(CSharpTokenType.RightBrace)) + else if (At(SyntaxKind.RightBrace)) { Accept(read); return; @@ -1478,7 +1482,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { Context.Source.Position = bookmark; NextToken(); - AcceptUntil(CSharpTokenType.LessThan, CSharpTokenType.LeftBrace, CSharpTokenType.RightBrace); + AcceptUntil(SyntaxKind.LessThan, SyntaxKind.LeftBrace, SyntaxKind.RightBrace); return; } } @@ -1492,7 +1496,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void CodeBlock(bool acceptTerminatingBrace, Block block) { EnsureCurrent(); - while (!EndOfFile && !At(CSharpTokenType.RightBrace)) + while (!EndOfFile && !At(SyntaxKind.RightBrace)) { // Parse a statement, then return here Statement(); @@ -1507,7 +1511,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } else if (acceptTerminatingBrace) { - Assert(CSharpTokenType.RightBrace); + Assert(SyntaxKind.RightBrace); Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None; AcceptAndMoveNext(); } @@ -1515,8 +1519,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void HandleKeyword(bool topLevel, Action fallback) { - Debug.Assert(CurrentToken.Type == CSharpTokenType.Keyword && CurrentToken.Keyword != null); - if (_keywordParsers.TryGetValue(CurrentToken.Keyword.Value, out var handler)) + var result = CSharpTokenizer.GetTokenKeyword(CurrentToken); + Debug.Assert(CurrentToken.Kind == SyntaxKind.Keyword && result.HasValue); + if (_keywordParsers.TryGetValue(result.Value, out var handler)) { handler(topLevel); } @@ -1526,12 +1531,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - private IEnumerable SkipToNextImportantToken() + private IEnumerable SkipToNextImportantToken() { while (!EndOfFile) { var whitespace = ReadWhile(IsSpacingToken(includeNewLines: true, includeComments: true)); - if (At(CSharpTokenType.RazorCommentTransition)) + if (At(SyntaxKind.RazorCommentTransition)) { Accept(whitespace); Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.Any; @@ -1542,7 +1547,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return whitespace; } } - return Enumerable.Empty(); + return Enumerable.Empty(); } // Common code for Parsers, but FxCop REALLY doesn't like it in the base class.. moving it here for now. @@ -1644,8 +1649,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy for (var i = 0; i < descriptor.Tokens.Count; i++) { - if (!At(CSharpTokenType.WhiteSpace) && - !At(CSharpTokenType.NewLine) && + if (!At(SyntaxKind.Whitespace) && + !At(SyntaxKind.NewLine) && !EndOfFile) { Context.ErrorSink.OnError( @@ -1664,7 +1669,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Span.ChunkGenerator = SpanChunkGenerator.Null; Output(SpanKindInternal.Code, AcceptedCharactersInternal.WhiteSpace); - if (EndOfFile || At(CSharpTokenType.NewLine)) + if (EndOfFile || At(SyntaxKind.NewLine)) { // Add a marker token to provide CSharp intellisense when we start typing the directive token. AddMarkerTokenIfNecessary(); @@ -1679,7 +1684,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Output(SpanKindInternal.Markup, AcceptedCharactersInternal.WhiteSpace); } - if (tokenDescriptor.Optional && (EndOfFile || At(CSharpTokenType.NewLine))) + if (tokenDescriptor.Optional && (EndOfFile || At(SyntaxKind.NewLine))) { break; } @@ -1718,7 +1723,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy break; case DirectiveTokenKind.Member: - if (At(CSharpTokenType.Identifier)) + if (At(SyntaxKind.Identifier)) { AcceptAndMoveNext(); } @@ -1732,7 +1737,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy break; case DirectiveTokenKind.String: - if (At(CSharpTokenType.StringLiteral) && CurrentToken.Errors.Count == 0) + if (At(SyntaxKind.StringLiteral) && !CurrentToken.ContainsDiagnostics) { AcceptAndMoveNext(); } @@ -1759,13 +1764,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy case DirectiveKind.SingleLine: Output(SpanKindInternal.None, AcceptedCharactersInternal.WhiteSpace); - Optional(CSharpTokenType.Semicolon); + Optional(SyntaxKind.Semicolon); Span.ChunkGenerator = SpanChunkGenerator.Null; Output(SpanKindInternal.MetaCode, AcceptedCharactersInternal.WhiteSpace); AcceptWhile(IsSpacingToken(includeNewLines: false, includeComments: true)); - if (At(CSharpTokenType.NewLine)) + if (At(SyntaxKind.NewLine)) { AcceptAndMoveNext(); } @@ -1816,7 +1821,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy ParseDirectiveBlock(descriptor, parseChildren: (startingBraceLocation) => { NextToken(); - Balance(BalancingModes.NoErrorOnFailure, CSharpTokenType.LeftBrace, CSharpTokenType.RightBrace, startingBraceLocation); + Balance(BalancingModes.NoErrorOnFailure, SyntaxKind.LeftBrace, SyntaxKind.RightBrace, startingBraceLocation); Span.ChunkGenerator = new StatementChunkGenerator(); var existingEditHandler = Span.EditHandler; Span.EditHandler = new CodeBlockEditHandler(Language.TokenizeString); @@ -1868,7 +1873,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy RazorDiagnosticFactory.CreateParsing_UnexpectedEOFAfterDirective( new SourceSpan(CurrentStart, contentLength: 1 /* { */), descriptor.Directive, "{")); } - else if (!At(CSharpTokenType.LeftBrace)) + else if (!At(SyntaxKind.LeftBrace)) { Context.ErrorSink.OnError( RazorDiagnosticFactory.CreateParsing_UnexpectedDirectiveLiteral( @@ -1886,7 +1891,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy parseChildren(startingBraceLocation); Span.ChunkGenerator = SpanChunkGenerator.Null; - if (!Optional(CSharpTokenType.RightBrace)) + if (!Optional(SyntaxKind.RightBrace)) { editHandler.AutoCompleteString = "}"; Context.ErrorSink.OnError( @@ -1982,7 +1987,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Ex: @addTagHelper "*, Microsoft.AspNetCore.CoolLibrary" // ^ ^ // Start End - if (Span.Tokens.Count == 1 && (Span.Tokens[0] as CSharpToken)?.Type == CSharpTokenType.StringLiteral) + if (Span.Tokens.Count == 1 && (Span.Tokens[0] as SyntaxToken)?.Kind == SyntaxKind.StringLiteral) { offset += Span.Tokens[0].Content.IndexOf(directiveText, StringComparison.Ordinal); @@ -2081,7 +2086,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Conditional("DEBUG")] protected void AssertDirective(string directive) { - Debug.Assert(CurrentToken.Type == CSharpTokenType.Identifier || CurrentToken.Type == CSharpTokenType.Keyword); + Debug.Assert(CurrentToken.Kind == SyntaxKind.Identifier || CurrentToken.Kind == SyntaxKind.Keyword); Debug.Assert(string.Equals(CurrentToken.Content, directive, StringComparison.Ordinal)); } @@ -2108,18 +2113,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var keywordLength = Span.End.AbsoluteIndex - Span.Start.AbsoluteIndex; - var foundWhitespace = At(CSharpTokenType.WhiteSpace); + var foundWhitespace = At(SyntaxKind.Whitespace); // If we found whitespace then any content placed within the whitespace MAY cause a destructive change // to the document. We can't accept it. var acceptedCharacters = foundWhitespace ? AcceptedCharactersInternal.None : AcceptedCharactersInternal.AnyExceptNewline; Output(SpanKindInternal.MetaCode, acceptedCharacters); - AcceptWhile(CSharpTokenType.WhiteSpace); + AcceptWhile(SyntaxKind.Whitespace); Span.ChunkGenerator = SpanChunkGenerator.Null; Output(SpanKindInternal.Markup, acceptedCharacters); - if (EndOfFile || At(CSharpTokenType.NewLine)) + if (EndOfFile || At(SyntaxKind.NewLine)) { Context.ErrorSink.OnError( RazorDiagnosticFactory.CreateParsing_DirectiveMustHaveValue( @@ -2134,7 +2139,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Parse to the end of the line. Essentially accepts anything until end of line, comments, invalid code // etc. - AcceptUntil(CSharpTokenType.NewLine); + AcceptUntil(SyntaxKind.NewLine); // Pull out the value and remove whitespaces and optional quotes var rawValue = string.Concat(Span.Tokens.Select(s => s.Content)).Trim(); @@ -2170,7 +2175,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Start = start; } - public Block(CSharpToken token, SourceLocation start) + public Block(SyntaxToken token, SourceLocation start) : this(GetName(token), start) { } @@ -2178,11 +2183,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public string Name { get; set; } public SourceLocation Start { get; set; } - private static string GetName(CSharpToken token) + private static string GetName(SyntaxToken token) { - if (token.Type == CSharpTokenType.Keyword) + var result = CSharpTokenizer.GetTokenKeyword(token); + if (result.HasValue && token.Kind == SyntaxKind.Keyword) { - return CSharpLanguageCharacteristics.GetKeyword(token.Keyword.Value); + return CSharpLanguageCharacteristics.GetKeyword(result.Value); } return token.Content; } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpLanguageCharacteristics.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpLanguageCharacteristics.cs index 70d4bfeda1..f0d38acfd6 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpLanguageCharacteristics.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpLanguageCharacteristics.cs @@ -3,64 +3,65 @@ using System.Collections.Generic; using System.Diagnostics; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { - internal class CSharpLanguageCharacteristics : LanguageCharacteristics + internal class CSharpLanguageCharacteristics : LanguageCharacteristics { private static readonly CSharpLanguageCharacteristics _instance = new CSharpLanguageCharacteristics(); - private static Dictionary _tokenSamples = new Dictionary() + private static Dictionary _tokenSamples = new Dictionary() { - { CSharpTokenType.Arrow, "->" }, - { CSharpTokenType.Minus, "-" }, - { CSharpTokenType.Decrement, "--" }, - { CSharpTokenType.MinusAssign, "-=" }, - { CSharpTokenType.NotEqual, "!=" }, - { CSharpTokenType.Not, "!" }, - { CSharpTokenType.Modulo, "%" }, - { CSharpTokenType.ModuloAssign, "%=" }, - { CSharpTokenType.AndAssign, "&=" }, - { CSharpTokenType.And, "&" }, - { CSharpTokenType.DoubleAnd, "&&" }, - { CSharpTokenType.LeftParenthesis, "(" }, - { CSharpTokenType.RightParenthesis, ")" }, - { CSharpTokenType.Star, "*" }, - { CSharpTokenType.MultiplyAssign, "*=" }, - { CSharpTokenType.Comma, "," }, - { CSharpTokenType.Dot, "." }, - { CSharpTokenType.Slash, "/" }, - { CSharpTokenType.DivideAssign, "/=" }, - { CSharpTokenType.DoubleColon, "::" }, - { CSharpTokenType.Colon, ":" }, - { CSharpTokenType.Semicolon, ";" }, - { CSharpTokenType.QuestionMark, "?" }, - { CSharpTokenType.NullCoalesce, "??" }, - { CSharpTokenType.RightBracket, "]" }, - { CSharpTokenType.LeftBracket, "[" }, - { CSharpTokenType.XorAssign, "^=" }, - { CSharpTokenType.Xor, "^" }, - { CSharpTokenType.LeftBrace, "{" }, - { CSharpTokenType.OrAssign, "|=" }, - { CSharpTokenType.DoubleOr, "||" }, - { CSharpTokenType.Or, "|" }, - { CSharpTokenType.RightBrace, "}" }, - { CSharpTokenType.Tilde, "~" }, - { CSharpTokenType.Plus, "+" }, - { CSharpTokenType.PlusAssign, "+=" }, - { CSharpTokenType.Increment, "++" }, - { CSharpTokenType.LessThan, "<" }, - { CSharpTokenType.LessThanEqual, "<=" }, - { CSharpTokenType.LeftShift, "<<" }, - { CSharpTokenType.LeftShiftAssign, "<<=" }, - { CSharpTokenType.Assign, "=" }, - { CSharpTokenType.Equals, "==" }, - { CSharpTokenType.GreaterThan, ">" }, - { CSharpTokenType.GreaterThanEqual, ">=" }, - { CSharpTokenType.RightShift, ">>" }, - { CSharpTokenType.RightShiftAssign, ">>=" }, - { CSharpTokenType.Hash, "#" }, - { CSharpTokenType.Transition, "@" }, + { SyntaxKind.Arrow, "->" }, + { SyntaxKind.Minus, "-" }, + { SyntaxKind.Decrement, "--" }, + { SyntaxKind.MinusAssign, "-=" }, + { SyntaxKind.NotEqual, "!=" }, + { SyntaxKind.Not, "!" }, + { SyntaxKind.Modulo, "%" }, + { SyntaxKind.ModuloAssign, "%=" }, + { SyntaxKind.AndAssign, "&=" }, + { SyntaxKind.And, "&" }, + { SyntaxKind.DoubleAnd, "&&" }, + { SyntaxKind.LeftParenthesis, "(" }, + { SyntaxKind.RightParenthesis, ")" }, + { SyntaxKind.Star, "*" }, + { SyntaxKind.MultiplyAssign, "*=" }, + { SyntaxKind.Comma, "," }, + { SyntaxKind.Dot, "." }, + { SyntaxKind.Slash, "/" }, + { SyntaxKind.DivideAssign, "/=" }, + { SyntaxKind.DoubleColon, "::" }, + { SyntaxKind.Colon, ":" }, + { SyntaxKind.Semicolon, ";" }, + { SyntaxKind.QuestionMark, "?" }, + { SyntaxKind.NullCoalesce, "??" }, + { SyntaxKind.RightBracket, "]" }, + { SyntaxKind.LeftBracket, "[" }, + { SyntaxKind.XorAssign, "^=" }, + { SyntaxKind.Xor, "^" }, + { SyntaxKind.LeftBrace, "{" }, + { SyntaxKind.OrAssign, "|=" }, + { SyntaxKind.DoubleOr, "||" }, + { SyntaxKind.Or, "|" }, + { SyntaxKind.RightBrace, "}" }, + { SyntaxKind.Tilde, "~" }, + { SyntaxKind.Plus, "+" }, + { SyntaxKind.PlusAssign, "+=" }, + { SyntaxKind.Increment, "++" }, + { SyntaxKind.LessThan, "<" }, + { SyntaxKind.LessThanEqual, "<=" }, + { SyntaxKind.LeftShift, "<<" }, + { SyntaxKind.LeftShiftAssign, "<<=" }, + { SyntaxKind.Assign, "=" }, + { SyntaxKind.Equals, "==" }, + { SyntaxKind.GreaterThan, ">" }, + { SyntaxKind.GreaterThanEqual, ">=" }, + { SyntaxKind.RightShift, ">>" }, + { SyntaxKind.RightShiftAssign, ">>=" }, + { SyntaxKind.Hash, "#" }, + { SyntaxKind.Transition, "@" }, }; protected CSharpLanguageCharacteristics() @@ -74,35 +75,35 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return new CSharpTokenizer(source); } - protected override CSharpToken CreateToken(string content, CSharpTokenType type, IReadOnlyList errors) + protected override SyntaxToken CreateToken(string content, SyntaxKind kind, IReadOnlyList errors) { - return new CSharpToken(content, type, errors); + return SyntaxFactory.Token(kind, content, errors); } - public override string GetSample(CSharpTokenType type) + public override string GetSample(SyntaxKind kind) { string sample; - if (!_tokenSamples.TryGetValue(type, out sample)) + if (!_tokenSamples.TryGetValue(kind, out sample)) { - switch (type) + switch (kind) { - case CSharpTokenType.Identifier: + case SyntaxKind.Identifier: return Resources.CSharpToken_Identifier; - case CSharpTokenType.Keyword: + case SyntaxKind.Keyword: return Resources.CSharpToken_Keyword; - case CSharpTokenType.IntegerLiteral: + case SyntaxKind.IntegerLiteral: return Resources.CSharpToken_IntegerLiteral; - case CSharpTokenType.NewLine: + case SyntaxKind.NewLine: return Resources.CSharpToken_Newline; - case CSharpTokenType.WhiteSpace: + case SyntaxKind.Whitespace: return Resources.CSharpToken_Whitespace; - case CSharpTokenType.Comment: + case SyntaxKind.CSharpComment: return Resources.CSharpToken_Comment; - case CSharpTokenType.RealLiteral: + case SyntaxKind.RealLiteral: return Resources.CSharpToken_RealLiteral; - case CSharpTokenType.CharacterLiteral: + case SyntaxKind.CharacterLiteral: return Resources.CSharpToken_CharacterLiteral; - case CSharpTokenType.StringLiteral: + case SyntaxKind.StringLiteral: return Resources.CSharpToken_StringLiteral; default: return Resources.Token_Unknown; @@ -111,59 +112,59 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return sample; } - public override CSharpToken CreateMarkerToken() + public override SyntaxToken CreateMarkerToken() { - return new CSharpToken(string.Empty, CSharpTokenType.Unknown); + return SyntaxFactory.Token(SyntaxKind.Unknown, string.Empty); } - public override CSharpTokenType GetKnownTokenType(KnownTokenType type) + public override SyntaxKind GetKnownTokenType(KnownTokenType type) { switch (type) { case KnownTokenType.Identifier: - return CSharpTokenType.Identifier; + return SyntaxKind.Identifier; case KnownTokenType.Keyword: - return CSharpTokenType.Keyword; + return SyntaxKind.Keyword; case KnownTokenType.NewLine: - return CSharpTokenType.NewLine; + return SyntaxKind.NewLine; case KnownTokenType.WhiteSpace: - return CSharpTokenType.WhiteSpace; + return SyntaxKind.Whitespace; case KnownTokenType.Transition: - return CSharpTokenType.Transition; + return SyntaxKind.Transition; case KnownTokenType.CommentStart: - return CSharpTokenType.RazorCommentTransition; + return SyntaxKind.RazorCommentTransition; case KnownTokenType.CommentStar: - return CSharpTokenType.RazorCommentStar; + return SyntaxKind.RazorCommentStar; case KnownTokenType.CommentBody: - return CSharpTokenType.RazorComment; + return SyntaxKind.RazorComment; default: - return CSharpTokenType.Unknown; + return SyntaxKind.Unknown; } } - public override CSharpTokenType FlipBracket(CSharpTokenType bracket) + public override SyntaxKind FlipBracket(SyntaxKind bracket) { switch (bracket) { - case CSharpTokenType.LeftBrace: - return CSharpTokenType.RightBrace; - case CSharpTokenType.LeftBracket: - return CSharpTokenType.RightBracket; - case CSharpTokenType.LeftParenthesis: - return CSharpTokenType.RightParenthesis; - case CSharpTokenType.LessThan: - return CSharpTokenType.GreaterThan; - case CSharpTokenType.RightBrace: - return CSharpTokenType.LeftBrace; - case CSharpTokenType.RightBracket: - return CSharpTokenType.LeftBracket; - case CSharpTokenType.RightParenthesis: - return CSharpTokenType.LeftParenthesis; - case CSharpTokenType.GreaterThan: - return CSharpTokenType.LessThan; + case SyntaxKind.LeftBrace: + return SyntaxKind.RightBrace; + case SyntaxKind.LeftBracket: + return SyntaxKind.RightBracket; + case SyntaxKind.LeftParenthesis: + return SyntaxKind.RightParenthesis; + case SyntaxKind.LessThan: + return SyntaxKind.GreaterThan; + case SyntaxKind.RightBrace: + return SyntaxKind.LeftBrace; + case SyntaxKind.RightBracket: + return SyntaxKind.LeftBracket; + case SyntaxKind.RightParenthesis: + return SyntaxKind.LeftParenthesis; + case SyntaxKind.GreaterThan: + return SyntaxKind.LessThan; default: Debug.Fail("FlipBracket must be called with a bracket character"); - return CSharpTokenType.Unknown; + return SyntaxKind.Unknown; } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpToken.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpToken.cs deleted file mode 100644 index 02428c2691..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpToken.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; - -namespace Microsoft.AspNetCore.Razor.Language.Legacy -{ - internal class CSharpToken : TokenBase - { - public CSharpToken( - string content, - CSharpTokenType type) - : base(content, type, RazorDiagnostic.EmptyArray) - { - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - } - - public CSharpToken( - string content, - CSharpTokenType type, - IReadOnlyList errors) - : base(content, type, errors) - { - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - } - - public CSharpKeyword? Keyword { get; set; } - - protected override SyntaxToken GetSyntaxToken() - { - switch (Type) - { - default: - return SyntaxFactory.UnknownToken(Content, Errors.ToArray()); - } - } - - public override bool Equals(object obj) - { - var other = obj as CSharpToken; - return base.Equals(other) && - other.Keyword == Keyword; - } - - public override int GetHashCode() - { - // Hash code should include only immutable properties. - return base.GetHashCode(); - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpTokenType.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpTokenType.cs deleted file mode 100644 index 10f3478d6d..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpTokenType.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Legacy -{ - internal enum CSharpTokenType - { - Unknown, - Identifier, - Keyword, - IntegerLiteral, - NewLine, - WhiteSpace, - Comment, - RealLiteral, - CharacterLiteral, - StringLiteral, - - // Operators - Arrow, - Minus, - Decrement, - MinusAssign, - NotEqual, - Not, - Modulo, - ModuloAssign, - AndAssign, - And, - DoubleAnd, - LeftParenthesis, - RightParenthesis, - Star, - MultiplyAssign, - Comma, - Dot, - Slash, - DivideAssign, - DoubleColon, - Colon, - Semicolon, - QuestionMark, - NullCoalesce, - RightBracket, - LeftBracket, - XorAssign, - Xor, - LeftBrace, - OrAssign, - DoubleOr, - Or, - RightBrace, - Tilde, - Plus, - PlusAssign, - Increment, - LessThan, - LessThanEqual, - LeftShift, - LeftShiftAssign, - Assign, - Equals, - GreaterThan, - GreaterThanEqual, - RightShift, - RightShiftAssign, - Hash, - Transition, - - // Razor specific - RazorCommentTransition, - RazorCommentStar, - RazorComment - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpTokenizer.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpTokenizer.cs index f819e98a3a..af20a51dfe 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpTokenizer.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpTokenizer.cs @@ -5,12 +5,13 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { - internal class CSharpTokenizer : Tokenizer + internal class CSharpTokenizer : Tokenizer { - private Dictionary> _operatorHandlers; + private Dictionary> _operatorHandlers; private static readonly Dictionary _keywords = new Dictionary(StringComparer.Ordinal) { @@ -100,31 +101,31 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { base.CurrentState = StartState; - _operatorHandlers = new Dictionary>() + _operatorHandlers = new Dictionary>() { { '-', MinusOperator }, { '<', LessThanOperator }, { '>', GreaterThanOperator }, - { '&', CreateTwoCharOperatorHandler(CSharpTokenType.And, '=', CSharpTokenType.AndAssign, '&', CSharpTokenType.DoubleAnd) }, - { '|', CreateTwoCharOperatorHandler(CSharpTokenType.Or, '=', CSharpTokenType.OrAssign, '|', CSharpTokenType.DoubleOr) }, - { '+', CreateTwoCharOperatorHandler(CSharpTokenType.Plus, '=', CSharpTokenType.PlusAssign, '+', CSharpTokenType.Increment) }, - { '=', CreateTwoCharOperatorHandler(CSharpTokenType.Assign, '=', CSharpTokenType.Equals, '>', CSharpTokenType.GreaterThanEqual) }, - { '!', CreateTwoCharOperatorHandler(CSharpTokenType.Not, '=', CSharpTokenType.NotEqual) }, - { '%', CreateTwoCharOperatorHandler(CSharpTokenType.Modulo, '=', CSharpTokenType.ModuloAssign) }, - { '*', CreateTwoCharOperatorHandler(CSharpTokenType.Star, '=', CSharpTokenType.MultiplyAssign) }, - { ':', CreateTwoCharOperatorHandler(CSharpTokenType.Colon, ':', CSharpTokenType.DoubleColon) }, - { '?', CreateTwoCharOperatorHandler(CSharpTokenType.QuestionMark, '?', CSharpTokenType.NullCoalesce) }, - { '^', CreateTwoCharOperatorHandler(CSharpTokenType.Xor, '=', CSharpTokenType.XorAssign) }, - { '(', () => CSharpTokenType.LeftParenthesis }, - { ')', () => CSharpTokenType.RightParenthesis }, - { '{', () => CSharpTokenType.LeftBrace }, - { '}', () => CSharpTokenType.RightBrace }, - { '[', () => CSharpTokenType.LeftBracket }, - { ']', () => CSharpTokenType.RightBracket }, - { ',', () => CSharpTokenType.Comma }, - { ';', () => CSharpTokenType.Semicolon }, - { '~', () => CSharpTokenType.Tilde }, - { '#', () => CSharpTokenType.Hash } + { '&', CreateTwoCharOperatorHandler(SyntaxKind.And, '=', SyntaxKind.AndAssign, '&', SyntaxKind.DoubleAnd) }, + { '|', CreateTwoCharOperatorHandler(SyntaxKind.Or, '=', SyntaxKind.OrAssign, '|', SyntaxKind.DoubleOr) }, + { '+', CreateTwoCharOperatorHandler(SyntaxKind.Plus, '=', SyntaxKind.PlusAssign, '+', SyntaxKind.Increment) }, + { '=', CreateTwoCharOperatorHandler(SyntaxKind.Assign, '=', SyntaxKind.Equals, '>', SyntaxKind.GreaterThanEqual) }, + { '!', CreateTwoCharOperatorHandler(SyntaxKind.Not, '=', SyntaxKind.NotEqual) }, + { '%', CreateTwoCharOperatorHandler(SyntaxKind.Modulo, '=', SyntaxKind.ModuloAssign) }, + { '*', CreateTwoCharOperatorHandler(SyntaxKind.Star, '=', SyntaxKind.MultiplyAssign) }, + { ':', CreateTwoCharOperatorHandler(SyntaxKind.Colon, ':', SyntaxKind.DoubleColon) }, + { '?', CreateTwoCharOperatorHandler(SyntaxKind.QuestionMark, '?', SyntaxKind.NullCoalesce) }, + { '^', CreateTwoCharOperatorHandler(SyntaxKind.Xor, '=', SyntaxKind.XorAssign) }, + { '(', () => SyntaxKind.LeftParenthesis }, + { ')', () => SyntaxKind.RightParenthesis }, + { '{', () => SyntaxKind.LeftBrace }, + { '}', () => SyntaxKind.RightBrace }, + { '[', () => SyntaxKind.LeftBracket }, + { ']', () => SyntaxKind.RightBracket }, + { ',', () => SyntaxKind.Comma }, + { ';', () => SyntaxKind.Semicolon }, + { '~', () => SyntaxKind.Tilde }, + { '#', () => SyntaxKind.Hash } }; } @@ -132,11 +133,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private new CSharpTokenizerState? CurrentState => (CSharpTokenizerState?)base.CurrentState; - public override CSharpTokenType RazorCommentType => CSharpTokenType.RazorComment; + public override SyntaxKind RazorCommentKind => SyntaxKind.RazorComment; - public override CSharpTokenType RazorCommentTransitionType => CSharpTokenType.RazorCommentTransition; + public override SyntaxKind RazorCommentTransitionKind => SyntaxKind.RazorCommentTransition; - public override CSharpTokenType RazorCommentStarType => CSharpTokenType.RazorCommentStar; + public override SyntaxKind RazorCommentStarKind => SyntaxKind.RazorCommentStar; protected override StateResult Dispatch() { @@ -169,7 +170,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } // Optimize memory allocation by returning constants for the most frequent cases - protected override string GetTokenContent(CSharpTokenType type) + protected override string GetTokenContent(SyntaxKind type) { var tokenLength = Buffer.Length; @@ -177,7 +178,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { switch (type) { - case CSharpTokenType.IntegerLiteral: + case SyntaxKind.IntegerLiteral: switch (Buffer[0]) { case '0': @@ -202,13 +203,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return "9"; } break; - case CSharpTokenType.NewLine: + case SyntaxKind.NewLine: if (Buffer[0] == '\n') { return "\n"; } break; - case CSharpTokenType.WhiteSpace: + case SyntaxKind.Whitespace: if (Buffer[0] == ' ') { return " "; @@ -218,57 +219,57 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return "\t"; } break; - case CSharpTokenType.Minus: + case SyntaxKind.Minus: return "-"; - case CSharpTokenType.Not: + case SyntaxKind.Not: return "!"; - case CSharpTokenType.Modulo: + case SyntaxKind.Modulo: return "%"; - case CSharpTokenType.And: + case SyntaxKind.And: return "&"; - case CSharpTokenType.LeftParenthesis: + case SyntaxKind.LeftParenthesis: return "("; - case CSharpTokenType.RightParenthesis: + case SyntaxKind.RightParenthesis: return ")"; - case CSharpTokenType.Star: + case SyntaxKind.Star: return "*"; - case CSharpTokenType.Comma: + case SyntaxKind.Comma: return ","; - case CSharpTokenType.Dot: + case SyntaxKind.Dot: return "."; - case CSharpTokenType.Slash: + case SyntaxKind.Slash: return "/"; - case CSharpTokenType.Colon: + case SyntaxKind.Colon: return ":"; - case CSharpTokenType.Semicolon: + case SyntaxKind.Semicolon: return ";"; - case CSharpTokenType.QuestionMark: + case SyntaxKind.QuestionMark: return "?"; - case CSharpTokenType.RightBracket: + case SyntaxKind.RightBracket: return "]"; - case CSharpTokenType.LeftBracket: + case SyntaxKind.LeftBracket: return "["; - case CSharpTokenType.Xor: + case SyntaxKind.Xor: return "^"; - case CSharpTokenType.LeftBrace: + case SyntaxKind.LeftBrace: return "{"; - case CSharpTokenType.Or: + case SyntaxKind.Or: return "|"; - case CSharpTokenType.RightBrace: + case SyntaxKind.RightBrace: return "}"; - case CSharpTokenType.Tilde: + case SyntaxKind.Tilde: return "~"; - case CSharpTokenType.Plus: + case SyntaxKind.Plus: return "+"; - case CSharpTokenType.LessThan: + case SyntaxKind.LessThan: return "<"; - case CSharpTokenType.Assign: + case SyntaxKind.Assign: return "="; - case CSharpTokenType.GreaterThan: + case SyntaxKind.GreaterThan: return ">"; - case CSharpTokenType.Hash: + case SyntaxKind.Hash: return "#"; - case CSharpTokenType.Transition: + case SyntaxKind.Transition: return "@"; } @@ -277,53 +278,53 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { switch (type) { - case CSharpTokenType.NewLine: + case SyntaxKind.NewLine: return "\r\n"; - case CSharpTokenType.Arrow: + case SyntaxKind.Arrow: return "->"; - case CSharpTokenType.Decrement: + case SyntaxKind.Decrement: return "--"; - case CSharpTokenType.MinusAssign: + case SyntaxKind.MinusAssign: return "-="; - case CSharpTokenType.NotEqual: + case SyntaxKind.NotEqual: return "!="; - case CSharpTokenType.ModuloAssign: + case SyntaxKind.ModuloAssign: return "%="; - case CSharpTokenType.AndAssign: + case SyntaxKind.AndAssign: return "&="; - case CSharpTokenType.DoubleAnd: + case SyntaxKind.DoubleAnd: return "&&"; - case CSharpTokenType.MultiplyAssign: + case SyntaxKind.MultiplyAssign: return "*="; - case CSharpTokenType.DivideAssign: + case SyntaxKind.DivideAssign: return "/="; - case CSharpTokenType.DoubleColon: + case SyntaxKind.DoubleColon: return "::"; - case CSharpTokenType.NullCoalesce: + case SyntaxKind.NullCoalesce: return "??"; - case CSharpTokenType.XorAssign: + case SyntaxKind.XorAssign: return "^="; - case CSharpTokenType.OrAssign: + case SyntaxKind.OrAssign: return "|="; - case CSharpTokenType.DoubleOr: + case SyntaxKind.DoubleOr: return "||"; - case CSharpTokenType.PlusAssign: + case SyntaxKind.PlusAssign: return "+="; - case CSharpTokenType.Increment: + case SyntaxKind.Increment: return "++"; - case CSharpTokenType.LessThanEqual: + case SyntaxKind.LessThanEqual: return "<="; - case CSharpTokenType.LeftShift: + case SyntaxKind.LeftShift: return "<<"; - case CSharpTokenType.Equals: + case SyntaxKind.Equals: return "=="; - case CSharpTokenType.GreaterThanEqual: + case SyntaxKind.GreaterThanEqual: if (Buffer[0] == '=') { return "=>"; } return ">="; - case CSharpTokenType.RightShift: + case SyntaxKind.RightShift: return ">>"; @@ -333,9 +334,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { switch (type) { - case CSharpTokenType.LeftShiftAssign: + case SyntaxKind.LeftShiftAssign: return "<<="; - case CSharpTokenType.RightShiftAssign: + case SyntaxKind.RightShiftAssign: return ">>="; } } @@ -343,9 +344,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return base.GetTokenContent(type); } - protected override CSharpToken CreateToken(string content, CSharpTokenType type, IReadOnlyList errors) + protected override SyntaxToken CreateToken(string content, SyntaxKind kind, IReadOnlyList errors) { - return new CSharpToken(content, type, errors); + return SyntaxFactory.Token(kind, content, errors); } private StateResult Data() @@ -359,13 +360,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TakeCurrent(); } - return Stay(EndToken(CSharpTokenType.NewLine)); + return Stay(EndToken(SyntaxKind.NewLine)); } else if (ParserHelpers.IsWhitespace(CurrentCharacter)) { // CSharp Spec §2.3.3 TakeUntil(c => !ParserHelpers.IsWhitespace(c)); - return Stay(EndToken(CSharpTokenType.WhiteSpace)); + return Stay(EndToken(SyntaxKind.Whitespace)); } else if (IsIdentifierStart(CurrentCharacter)) { @@ -390,7 +391,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { return RealLiteral(); } - return Stay(Single(CSharpTokenType.Dot)); + return Stay(Single(SyntaxKind.Dot)); case '/': TakeCurrent(); if (CurrentCharacter == '/') @@ -406,11 +407,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy else if (CurrentCharacter == '=') { TakeCurrent(); - return Stay(EndToken(CSharpTokenType.DivideAssign)); + return Stay(EndToken(SyntaxKind.DivideAssign)); } else { - return Stay(EndToken(CSharpTokenType.Slash)); + return Stay(EndToken(SyntaxKind.Slash)); } default: return Stay(EndToken(Operator())); @@ -429,78 +430,78 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { return Transition( CSharpTokenizerState.AfterRazorCommentTransition, - EndToken(CSharpTokenType.RazorCommentTransition)); + EndToken(SyntaxKind.RazorCommentTransition)); } else if (CurrentCharacter == '@') { // Could be escaped comment transition return Transition( CSharpTokenizerState.EscapedRazorCommentTransition, - EndToken(CSharpTokenType.Transition)); + EndToken(SyntaxKind.Transition)); } - return Stay(EndToken(CSharpTokenType.Transition)); + return Stay(EndToken(SyntaxKind.Transition)); } private StateResult EscapedRazorCommentTransition() { TakeCurrent(); - return Transition(CSharpTokenizerState.Data, EndToken(CSharpTokenType.Transition)); + return Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.Transition)); } - private CSharpTokenType Operator() + private SyntaxKind Operator() { var first = CurrentCharacter; TakeCurrent(); - Func handler; + Func handler; if (_operatorHandlers.TryGetValue(first, out handler)) { return handler(); } - return CSharpTokenType.Unknown; + return SyntaxKind.Unknown; } - private CSharpTokenType LessThanOperator() + private SyntaxKind LessThanOperator() { if (CurrentCharacter == '=') { TakeCurrent(); - return CSharpTokenType.LessThanEqual; + return SyntaxKind.LessThanEqual; } - return CSharpTokenType.LessThan; + return SyntaxKind.LessThan; } - private CSharpTokenType GreaterThanOperator() + private SyntaxKind GreaterThanOperator() { if (CurrentCharacter == '=') { TakeCurrent(); - return CSharpTokenType.GreaterThanEqual; + return SyntaxKind.GreaterThanEqual; } - return CSharpTokenType.GreaterThan; + return SyntaxKind.GreaterThan; } - private CSharpTokenType MinusOperator() + private SyntaxKind MinusOperator() { if (CurrentCharacter == '>') { TakeCurrent(); - return CSharpTokenType.Arrow; + return SyntaxKind.Arrow; } else if (CurrentCharacter == '-') { TakeCurrent(); - return CSharpTokenType.Decrement; + return SyntaxKind.Decrement; } else if (CurrentCharacter == '=') { TakeCurrent(); - return CSharpTokenType.MinusAssign; + return SyntaxKind.MinusAssign; } - return CSharpTokenType.Minus; + return SyntaxKind.Minus; } - private Func CreateTwoCharOperatorHandler(CSharpTokenType typeIfOnlyFirst, char second, CSharpTokenType typeIfBoth) + private Func CreateTwoCharOperatorHandler(SyntaxKind typeIfOnlyFirst, char second, SyntaxKind typeIfBoth) { return () => { @@ -513,7 +514,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; } - private Func CreateTwoCharOperatorHandler(CSharpTokenType typeIfOnlyFirst, char option1, CSharpTokenType typeIfOption1, char option2, CSharpTokenType typeIfOption2) + private Func CreateTwoCharOperatorHandler(SyntaxKind typeIfOnlyFirst, char option1, SyntaxKind typeIfOption1, char option2, SyntaxKind typeIfOption2) { return () => { @@ -550,14 +551,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy RazorDiagnosticFactory.CreateParsing_UnterminatedStringLiteral( new SourceSpan(CurrentStart, contentLength: 1 /* end of file */))); } - return Transition(CSharpTokenizerState.Data, EndToken(CSharpTokenType.StringLiteral)); + return Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.StringLiteral)); } - private StateResult QuotedCharacterLiteral() => QuotedLiteral('\'', CSharpTokenType.CharacterLiteral); + private StateResult QuotedCharacterLiteral() => QuotedLiteral('\'', SyntaxKind.CharacterLiteral); - private StateResult QuotedStringLiteral() => QuotedLiteral('\"', CSharpTokenType.StringLiteral); + private StateResult QuotedStringLiteral() => QuotedLiteral('\"', SyntaxKind.StringLiteral); - private StateResult QuotedLiteral(char quote, CSharpTokenType literalType) + private StateResult QuotedLiteral(char quote, SyntaxKind literalType) { TakeUntil(c => c == '\\' || c == quote || ParserHelpers.IsNewLine(c)); if (CurrentCharacter == '\\') @@ -594,7 +595,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy RazorDiagnosticFactory.CreateParsing_BlockCommentNotTerminated( new SourceSpan(CurrentStart, contentLength: 1 /* end of file */))); - return Transition(CSharpTokenizerState.Data, EndToken(CSharpTokenType.Comment)); + return Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.CSharpComment)); } if (CurrentCharacter == '*') { @@ -602,7 +603,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy if (CurrentCharacter == '/') { TakeCurrent(); - return Transition(CSharpTokenizerState.Data, EndToken(CSharpTokenType.Comment)); + return Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.CSharpComment)); } } return Stay(); @@ -612,7 +613,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private StateResult SingleLineComment() { TakeUntil(c => ParserHelpers.IsNewLine(c)); - return Stay(EndToken(CSharpTokenType.Comment)); + return Stay(EndToken(SyntaxKind.CSharpComment)); } // CSharp Spec §2.4.4 @@ -632,7 +633,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TakeUntil(c => !IsHexDigit(c)); TakeIntegerSuffix(); - return Stay(EndToken(CSharpTokenType.IntegerLiteral)); + return Stay(EndToken(SyntaxKind.IntegerLiteral)); } private StateResult DecimalLiteral() @@ -650,7 +651,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy else { TakeIntegerSuffix(); - return Stay(EndToken(CSharpTokenType.IntegerLiteral)); + return Stay(EndToken(SyntaxKind.IntegerLiteral)); } } @@ -669,7 +670,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TakeCurrent(); } - return Stay(EndToken(CSharpTokenType.RealLiteral)); + return Stay(EndToken(SyntaxKind.RealLiteral)); } // CSharp Spec §2.4.4.3 @@ -708,21 +709,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Debug.Assert(IsIdentifierStart(CurrentCharacter)); TakeCurrent(); TakeUntil(c => !IsIdentifierPart(c)); - CSharpToken token = null; + SyntaxToken token = null; if (HaveContent) { CSharpKeyword keyword; - var type = CSharpTokenType.Identifier; + var type = SyntaxKind.Identifier; var tokenContent = Buffer.ToString(); if (_keywords.TryGetValue(tokenContent, out keyword)) { - type = CSharpTokenType.Keyword; + type = SyntaxKind.Keyword; } - - token = new CSharpToken(tokenContent, type) - { - Keyword = type == CSharpTokenType.Keyword ? (CSharpKeyword?)keyword : null, - }; + + token = SyntaxFactory.Token(type, tokenContent); Buffer.Clear(); CurrentErrors.Clear(); @@ -736,7 +734,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return Transition((int)state, result: null); } - private StateResult Transition(CSharpTokenizerState state, CSharpToken result) + private StateResult Transition(CSharpTokenizerState state, SyntaxToken result) { return Transition((int)state, result); } @@ -780,6 +778,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return (value >= '0' && value <= '9') || (value >= 'A' && value <= 'F') || (value >= 'a' && value <= 'f'); } + internal static CSharpKeyword? GetTokenKeyword(SyntaxToken token) + { + if (token != null && _keywords.TryGetValue(token.Content, out var keyword)) + { + return keyword; + } + + return null; + } + private enum CSharpTokenizerState { Data, diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CodeBlockEditHandler.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CodeBlockEditHandler.cs index d5ce71c43e..89d1f3d6c6 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/CodeBlockEditHandler.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/CodeBlockEditHandler.cs @@ -4,12 +4,13 @@ using System; using System.Collections.Generic; using System.Globalization; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { internal class CodeBlockEditHandler : SpanEditHandler { - public CodeBlockEditHandler(Func> tokenizer) : base(tokenizer) + public CodeBlockEditHandler(Func> tokenizer) : base(tokenizer) { } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/DirectiveCSharpTokenizer.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/DirectiveCSharpTokenizer.cs index a9befaa302..4b63b47a03 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/DirectiveCSharpTokenizer.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/DirectiveCSharpTokenizer.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { @@ -17,11 +18,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected override StateResult Dispatch() { var result = base.Dispatch(); - if (result.Result != null && !_visitedFirstTokenStart && IsValidTokenType(result.Result.Type)) + if (result.Result != null && !_visitedFirstTokenStart && IsValidTokenType(result.Result.Kind)) { _visitedFirstTokenStart = true; } - else if (result.Result != null && _visitedFirstTokenStart && result.Result.Type == CSharpTokenType.NewLine) + else if (result.Result != null && _visitedFirstTokenStart && result.Result.Kind == SyntaxKind.NewLine) { _visitedFirstTokenLineEnd = true; } @@ -29,7 +30,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return result; } - public override CSharpToken NextToken() + public override SyntaxToken NextToken() { // Post-Condition: Buffer should be empty at the start of Next() Debug.Assert(Buffer.Length == 0); @@ -48,15 +49,15 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return token; } - private bool IsValidTokenType(CSharpTokenType type) + private bool IsValidTokenType(SyntaxKind kind) { - return type != CSharpTokenType.WhiteSpace && - type != CSharpTokenType.NewLine && - type != CSharpTokenType.Comment && - type != CSharpTokenType.RazorComment && - type != CSharpTokenType.RazorCommentStar && - type != CSharpTokenType.RazorCommentTransition && - type != CSharpTokenType.Transition; + return kind != SyntaxKind.Whitespace && + kind != SyntaxKind.NewLine && + kind != SyntaxKind.CSharpComment && + kind != SyntaxKind.RazorComment && + kind != SyntaxKind.RazorCommentStar && + kind != SyntaxKind.RazorCommentTransition && + kind != SyntaxKind.Transition; } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/DirectiveHtmlTokenizer.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/DirectiveHtmlTokenizer.cs index 034977c758..7d39ebbe0a 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/DirectiveHtmlTokenizer.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/DirectiveHtmlTokenizer.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { @@ -16,7 +17,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected override StateResult Dispatch() { var result = base.Dispatch(); - if (result.Result != null && IsValidTokenType(result.Result.Type)) + if (result.Result != null && IsValidTokenType(result.Result.Kind)) { _visitedFirstTokenStart = true; } @@ -24,7 +25,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return result; } - public override HtmlToken NextToken() + public override SyntaxToken NextToken() { // Post-Condition: Buffer should be empty at the start of Next() Debug.Assert(Buffer.Length == 0); @@ -43,14 +44,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return token; } - private bool IsValidTokenType(HtmlTokenType type) + private bool IsValidTokenType(SyntaxKind kind) { - return type != HtmlTokenType.WhiteSpace && - type != HtmlTokenType.NewLine && - type != HtmlTokenType.RazorComment && - type != HtmlTokenType.RazorCommentStar && - type != HtmlTokenType.RazorCommentTransition && - type != HtmlTokenType.Transition; + return kind != SyntaxKind.Whitespace && + kind != SyntaxKind.NewLine && + kind != SyntaxKind.RazorComment && + kind != SyntaxKind.RazorCommentStar && + kind != SyntaxKind.RazorCommentTransition && + kind != SyntaxKind.Transition; } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlLanguageCharacteristics.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlLanguageCharacteristics.cs index 096ae84dc0..40a1dd9b39 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlLanguageCharacteristics.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlLanguageCharacteristics.cs @@ -3,10 +3,11 @@ using System.Collections.Generic; using System.Diagnostics; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { - internal class HtmlLanguageCharacteristics : LanguageCharacteristics + internal class HtmlLanguageCharacteristics : LanguageCharacteristics { private static readonly HtmlLanguageCharacteristics _instance = new HtmlLanguageCharacteristics(); @@ -19,47 +20,47 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy get { return _instance; } } - public override string GetSample(HtmlTokenType type) + public override string GetSample(SyntaxKind type) { switch (type) { - case HtmlTokenType.Text: + case SyntaxKind.HtmlTextLiteral: return Resources.HtmlToken_Text; - case HtmlTokenType.WhiteSpace: + case SyntaxKind.Whitespace: return Resources.HtmlToken_WhiteSpace; - case HtmlTokenType.NewLine: + case SyntaxKind.NewLine: return Resources.HtmlToken_NewLine; - case HtmlTokenType.OpenAngle: + case SyntaxKind.OpenAngle: return "<"; - case HtmlTokenType.Bang: + case SyntaxKind.Bang: return "!"; - case HtmlTokenType.ForwardSlash: + case SyntaxKind.ForwardSlash: return "/"; - case HtmlTokenType.QuestionMark: + case SyntaxKind.QuestionMark: return "?"; - case HtmlTokenType.DoubleHyphen: + case SyntaxKind.DoubleHyphen: return "--"; - case HtmlTokenType.LeftBracket: + case SyntaxKind.LeftBracket: return "["; - case HtmlTokenType.CloseAngle: + case SyntaxKind.CloseAngle: return ">"; - case HtmlTokenType.RightBracket: + case SyntaxKind.RightBracket: return "]"; - case HtmlTokenType.Equals: + case SyntaxKind.Equals: return "="; - case HtmlTokenType.DoubleQuote: + case SyntaxKind.DoubleQuote: return "\""; - case HtmlTokenType.SingleQuote: + case SyntaxKind.SingleQuote: return "'"; - case HtmlTokenType.Transition: + case SyntaxKind.Transition: return "@"; - case HtmlTokenType.Colon: + case SyntaxKind.Colon: return ":"; - case HtmlTokenType.RazorComment: + case SyntaxKind.RazorComment: return Resources.HtmlToken_RazorComment; - case HtmlTokenType.RazorCommentStar: + case SyntaxKind.RazorCommentStar: return "*"; - case HtmlTokenType.RazorCommentTransition: + case SyntaxKind.RazorCommentTransition: return "@"; default: return Resources.Token_Unknown; @@ -71,57 +72,57 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return new HtmlTokenizer(source); } - public override HtmlTokenType FlipBracket(HtmlTokenType bracket) + public override SyntaxKind FlipBracket(SyntaxKind bracket) { switch (bracket) { - case HtmlTokenType.LeftBracket: - return HtmlTokenType.RightBracket; - case HtmlTokenType.OpenAngle: - return HtmlTokenType.CloseAngle; - case HtmlTokenType.RightBracket: - return HtmlTokenType.LeftBracket; - case HtmlTokenType.CloseAngle: - return HtmlTokenType.OpenAngle; + case SyntaxKind.LeftBracket: + return SyntaxKind.RightBracket; + case SyntaxKind.OpenAngle: + return SyntaxKind.CloseAngle; + case SyntaxKind.RightBracket: + return SyntaxKind.LeftBracket; + case SyntaxKind.CloseAngle: + return SyntaxKind.OpenAngle; default: Debug.Fail("FlipBracket must be called with a bracket character"); - return HtmlTokenType.Unknown; + return SyntaxKind.Unknown; } } - public override HtmlToken CreateMarkerToken() + public override SyntaxToken CreateMarkerToken() { - return new HtmlToken(string.Empty, HtmlTokenType.Unknown); + return SyntaxFactory.Token(SyntaxKind.Unknown, string.Empty); } - public override HtmlTokenType GetKnownTokenType(KnownTokenType type) + public override SyntaxKind GetKnownTokenType(KnownTokenType type) { switch (type) { case KnownTokenType.CommentStart: - return HtmlTokenType.RazorCommentTransition; + return SyntaxKind.RazorCommentTransition; case KnownTokenType.CommentStar: - return HtmlTokenType.RazorCommentStar; + return SyntaxKind.RazorCommentStar; case KnownTokenType.CommentBody: - return HtmlTokenType.RazorComment; + return SyntaxKind.RazorComment; case KnownTokenType.Identifier: - return HtmlTokenType.Text; + return SyntaxKind.HtmlTextLiteral; case KnownTokenType.Keyword: - return HtmlTokenType.Text; + return SyntaxKind.HtmlTextLiteral; case KnownTokenType.NewLine: - return HtmlTokenType.NewLine; + return SyntaxKind.NewLine; case KnownTokenType.Transition: - return HtmlTokenType.Transition; + return SyntaxKind.Transition; case KnownTokenType.WhiteSpace: - return HtmlTokenType.WhiteSpace; + return SyntaxKind.Whitespace; default: - return HtmlTokenType.Unknown; + return SyntaxKind.Unknown; } } - protected override HtmlToken CreateToken(string content, HtmlTokenType type, IReadOnlyList errors) + protected override SyntaxToken CreateToken(string content, SyntaxKind kind, IReadOnlyList errors) { - return new HtmlToken(content, type, errors); + return SyntaxFactory.Token(kind, content, errors); } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlMarkupParser.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlMarkupParser.cs index fdb94014dc..d3679ce664 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlMarkupParser.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlMarkupParser.cs @@ -5,22 +5,31 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { - internal class HtmlMarkupParser : TokenizerBackedParser + internal class HtmlMarkupParser : TokenizerBackedParser { private const string ScriptTagName = "script"; - private static readonly HtmlToken[] nonAllowedHtmlCommentEnding = new[] { HtmlToken.Hyphen, new HtmlToken("!", HtmlTokenType.Bang), new HtmlToken("<", HtmlTokenType.OpenAngle) }; - private static readonly HtmlToken[] singleHyphenArray = new[] { HtmlToken.Hyphen }; + private static readonly SyntaxToken[] nonAllowedHtmlCommentEnding = new[] + { + SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "-"), + SyntaxFactory.Token(SyntaxKind.Bang, "!"), + SyntaxFactory.Token(SyntaxKind.OpenAngle, "<"), + }; + private static readonly SyntaxToken[] singleHyphenArray = new[] + { + SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "-") + }; private static readonly char[] ValidAfterTypeAttributeNameCharacters = { ' ', '\t', '\r', '\n', '\f', '=' }; private SourceLocation _lastTagStart = SourceLocation.Zero; - private HtmlToken _bufferedOpenAngle; + private SyntaxToken _bufferedOpenAngle; //From http://dev.w3.org/html5/spec/Overview.html#elements-0 - private ISet _voidElements = new HashSet(StringComparer.OrdinalIgnoreCase) + private readonly ISet _voidElements = new HashSet(StringComparer.OrdinalIgnoreCase) { "area", "base", @@ -59,7 +68,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy get { return CaseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase; } } - protected override bool TokenTypeEquals(HtmlTokenType x, HtmlTokenType y) => x == y; + protected override bool TokenKindEquals(SyntaxKind x, SyntaxKind y) => x == y; public override void BuildSpan(SpanBuilder span, SourceLocation start, string content) { @@ -73,14 +82,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Output(SpanKindInternal.Markup); } - protected void SkipToAndParseCode(HtmlTokenType type) + protected void SkipToAndParseCode(SyntaxKind type) { - SkipToAndParseCode(token => token.Type == type); + SkipToAndParseCode(token => token.Kind == type); } - protected void SkipToAndParseCode(Func condition) + protected void SkipToAndParseCode(Func condition) { - HtmlToken last = null; + SyntaxToken last = null; var startOfLine = false; while (!EndOfFile && !condition(CurrentToken)) { @@ -88,15 +97,15 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { Context.NullGenerateWhitespaceAndNewLine = false; Span.ChunkGenerator = SpanChunkGenerator.Null; - AcceptWhile(token => token.Type == HtmlTokenType.WhiteSpace); - if (At(HtmlTokenType.NewLine)) + AcceptWhile(token => token.Kind == SyntaxKind.Whitespace); + if (At(SyntaxKind.NewLine)) { AcceptAndMoveNext(); } Output(SpanKindInternal.Markup); } - else if (At(HtmlTokenType.NewLine)) + else if (At(SyntaxKind.NewLine)) { if (last != null) { @@ -108,11 +117,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy last = null; AcceptAndMoveNext(); } - else if (At(HtmlTokenType.Transition)) + else if (At(SyntaxKind.Transition)) { var transition = CurrentToken; NextToken(); - if (At(HtmlTokenType.Transition)) + if (At(SyntaxKind.Transition)) { if (last != null) { @@ -138,7 +147,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Handle whitespace rewriting if (last != null) { - if (!Context.DesignTimeMode && last.Type == HtmlTokenType.WhiteSpace && startOfLine) + if (!Context.DesignTimeMode && last.Kind == SyntaxKind.Whitespace && startOfLine) { // Put the whitespace back too startOfLine = false; @@ -155,12 +164,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy OtherParserBlock(); } - else if (At(HtmlTokenType.RazorCommentTransition)) + else if (At(SyntaxKind.RazorCommentTransition)) { if (last != null) { // Don't render the whitespace between the start of the line and the razor comment. - if (startOfLine && last.Type == HtmlTokenType.WhiteSpace) + if (startOfLine && last.Kind == SyntaxKind.Whitespace) { AddMarkerTokenIfNecessary(); // Output the tokens that may have been accepted prior to the whitespace. @@ -180,8 +189,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Handle the whitespace and newline at the end of a razor comment. if (startOfLine && - (At(HtmlTokenType.NewLine) || - (At(HtmlTokenType.WhiteSpace) && NextIs(HtmlTokenType.NewLine)))) + (At(SyntaxKind.NewLine) || + (At(SyntaxKind.Whitespace) && NextIs(SyntaxKind.NewLine)))) { AcceptWhile(IsSpacingToken(includeNewLines: false)); AcceptAndMoveNext(); @@ -192,7 +201,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy else { // As long as we see whitespace, we're still at the "start" of the line - startOfLine &= At(HtmlTokenType.WhiteSpace); + startOfLine &= At(SyntaxKind.Whitespace); // If there's a last token, accept it if (last != null) @@ -213,9 +222,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - protected static Func IsSpacingToken(bool includeNewLines) + protected static Func IsSpacingToken(bool includeNewLines) { - return token => token.Type == HtmlTokenType.WhiteSpace || (includeNewLines && token.Type == HtmlTokenType.NewLine); + return token => token.Kind == SyntaxKind.Whitespace || (includeNewLines && token.Kind == SyntaxKind.NewLine); } private void OtherParserBlock() @@ -238,12 +247,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var potentialBang = Lookahead(lookahead); if (potentialBang != null && - potentialBang.Type == HtmlTokenType.Bang) + potentialBang.Kind == SyntaxKind.Bang) { var afterBang = Lookahead(lookahead + 1); return afterBang != null && - afterBang.Type == HtmlTokenType.Text && + afterBang.Kind == SyntaxKind.HtmlTextLiteral && !string.Equals(afterBang.Content, "DOCTYPE", StringComparison.OrdinalIgnoreCase); } @@ -257,7 +266,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Output(SpanKindInternal.Markup); // Accept the parser escape character '!'. - Assert(HtmlTokenType.Bang); + Assert(SyntaxKind.Bang); AcceptAndMoveNext(); // Setup the metacode span that we will be outputing. @@ -286,23 +295,23 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy AcceptWhile(IsSpacingToken(includeNewLines: true)); - if (CurrentToken.Type == HtmlTokenType.OpenAngle) + if (CurrentToken.Kind == SyntaxKind.OpenAngle) { // "<" => Implicit Tag Block - TagBlock(new Stack>()); + TagBlock(new Stack>()); } - else if (CurrentToken.Type == HtmlTokenType.Transition) + else if (CurrentToken.Kind == SyntaxKind.Transition) { // "@" => Explicit Tag/Single Line Block OR Template Output(SpanKindInternal.Markup); // Definitely have a transition span - Assert(HtmlTokenType.Transition); + Assert(SyntaxKind.Transition); AcceptAndMoveNext(); Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None; Span.ChunkGenerator = SpanChunkGenerator.Null; Output(SpanKindInternal.Transition); - if (At(HtmlTokenType.Transition)) + if (At(SyntaxKind.Transition)) { Span.ChunkGenerator = SpanChunkGenerator.Null; AcceptAndMoveNext(); @@ -330,10 +339,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void AfterTransition() { // "@:" => Explicit Single Line Block - if (CurrentToken.Type == HtmlTokenType.Text && CurrentToken.Content.Length > 0 && CurrentToken.Content[0] == ':') + if (CurrentToken.Kind == SyntaxKind.HtmlTextLiteral && CurrentToken.Content.Length > 0 && CurrentToken.Content[0] == ':') { // Split the token - Tuple split = Language.SplitToken(CurrentToken, 1, HtmlTokenType.Colon); + var split = Language.SplitToken(CurrentToken, 1, SyntaxKind.Colon); // The first part (left) is added to this span and we return a MetaCode span Accept(split.Item1); @@ -346,9 +355,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy NextToken(); SingleLineMarkup(); } - else if (CurrentToken.Type == HtmlTokenType.OpenAngle) + else if (CurrentToken.Kind == SyntaxKind.OpenAngle) { - TagBlock(new Stack>()); + TagBlock(new Stack>()); } } @@ -359,8 +368,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var old = Context.WhiteSpaceIsSignificantToAncestorBlock; Context.WhiteSpaceIsSignificantToAncestorBlock = true; Span.EditHandler = new SpanEditHandler(Language.TokenizeString); - SkipToAndParseCode(HtmlTokenType.NewLine); - if (!EndOfFile && CurrentToken.Type == HtmlTokenType.NewLine) + SkipToAndParseCode(SyntaxKind.NewLine); + if (!EndOfFile && CurrentToken.Kind == SyntaxKind.NewLine) { AcceptAndMoveNext(); Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None; @@ -370,13 +379,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Output(SpanKindInternal.Markup); } - private void TagBlock(Stack> tags) + private void TagBlock(Stack> tags) { // Skip Whitespace and Text var complete = false; do { - SkipToAndParseCode(HtmlTokenType.OpenAngle); + SkipToAndParseCode(SyntaxKind.OpenAngle); // Output everything prior to the OpenAngle into a markup span Output(SpanKindInternal.Markup); @@ -401,7 +410,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { _bufferedOpenAngle = null; _lastTagStart = CurrentStart; - Assert(HtmlTokenType.OpenAngle); + Assert(SyntaxKind.OpenAngle); _bufferedOpenAngle = CurrentToken; var tagStart = CurrentStart; if (!NextToken()) @@ -440,18 +449,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } private bool AfterTagStart(SourceLocation tagStart, - Stack> tags, + Stack> tags, bool atSpecialTag, IDisposable tagBlockWrapper) { if (!EndOfFile) { - switch (CurrentToken.Type) + switch (CurrentToken.Kind) { - case HtmlTokenType.ForwardSlash: + case SyntaxKind.ForwardSlash: // End Tag return EndTag(tagStart, tags, tagBlockWrapper); - case HtmlTokenType.Bang: + case SyntaxKind.Bang: // Comment, CDATA, DOCTYPE, or a parser-escaped HTML tag. if (atSpecialTag) { @@ -462,7 +471,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { goto default; } - case HtmlTokenType.QuestionMark: + case SyntaxKind.QuestionMark: // XML PI Accept(_bufferedOpenAngle); return XmlPI(); @@ -483,15 +492,15 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private bool XmlPI() { // Accept "?" - Assert(HtmlTokenType.QuestionMark); + Assert(SyntaxKind.QuestionMark); AcceptAndMoveNext(); - return AcceptUntilAll(HtmlTokenType.QuestionMark, HtmlTokenType.CloseAngle); + return AcceptUntilAll(SyntaxKind.QuestionMark, SyntaxKind.CloseAngle); } private bool BangTag() { // Accept "!" - Assert(HtmlTokenType.Bang); + Assert(SyntaxKind.Bang); if (AcceptAndMoveNext()) { @@ -506,10 +515,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.WhiteSpace; while (!EndOfFile) { - SkipToAndParseCode(HtmlTokenType.DoubleHyphen); + SkipToAndParseCode(SyntaxKind.DoubleHyphen); var lastDoubleHyphen = AcceptAllButLastDoubleHyphens(); - if (At(HtmlTokenType.CloseAngle)) + if (At(SyntaxKind.CloseAngle)) { // Output the content in the comment block as a separate markup Output(SpanKindInternal.Markup, AcceptedCharactersInternal.WhiteSpace); @@ -527,7 +536,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } } - else if (CurrentToken.Type == HtmlTokenType.LeftBracket) + else if (CurrentToken.Kind == SyntaxKind.LeftBracket) { if (AcceptAndMoveNext()) { @@ -537,19 +546,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy else { AcceptAndMoveNext(); - return AcceptUntilAll(HtmlTokenType.CloseAngle); + return AcceptUntilAll(SyntaxKind.CloseAngle); } } return false; } - protected HtmlToken AcceptAllButLastDoubleHyphens() + protected SyntaxToken AcceptAllButLastDoubleHyphens() { var lastDoubleHyphen = CurrentToken; AcceptWhile(s => { - if (NextIs(HtmlTokenType.DoubleHyphen)) + if (NextIs(SyntaxKind.DoubleHyphen)) { lastDoubleHyphen = s; return true; @@ -560,10 +569,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy NextToken(); - if (At(HtmlTokenType.Text) && IsHyphen(CurrentToken)) + if (At(SyntaxKind.HtmlTextLiteral) && IsHyphen(CurrentToken)) { // Doing this here to maintain the order of tokens - if (!NextIs(HtmlTokenType.CloseAngle)) + if (!NextIs(SyntaxKind.CloseAngle)) { Accept(lastDoubleHyphen); lastDoubleHyphen = null; @@ -575,9 +584,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return lastDoubleHyphen; } - internal static bool IsHyphen(HtmlToken token) + internal static bool IsHyphen(SyntaxToken token) { - return token.Equals(HtmlToken.Hyphen); + return token.Kind == SyntaxKind.HtmlTextLiteral && token.Content == "-"; } protected bool IsHtmlCommentAhead() @@ -595,13 +604,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // 2.3 nor end with the string "" - if (CurrentToken.Type != HtmlTokenType.DoubleHyphen) + if (CurrentToken.Kind != SyntaxKind.DoubleHyphen) { return false; } // Check condition 2.1 - if (NextIs(HtmlTokenType.CloseAngle) || NextIs(next => IsHyphen(next) && NextIs(HtmlTokenType.CloseAngle))) + if (NextIs(SyntaxKind.CloseAngle) || NextIs(next => IsHyphen(next) && NextIs(SyntaxKind.CloseAngle))) { return false; } @@ -610,15 +619,15 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var isValidComment = false; LookaheadUntil((token, prevTokens) => { - if (token.Type == HtmlTokenType.DoubleHyphen) + if (token.Kind == SyntaxKind.DoubleHyphen) { - if (NextIs(HtmlTokenType.CloseAngle)) + if (NextIs(SyntaxKind.CloseAngle)) { // Check condition 2.3: We're at the end of a comment. Check to make sure the text ending is allowed. isValidComment = !IsCommentContentEndingInvalid(prevTokens); return true; } - else if (NextIs(ns => IsHyphen(ns) && NextIs(HtmlTokenType.CloseAngle))) + else if (NextIs(ns => IsHyphen(ns) && NextIs(SyntaxKind.CloseAngle))) { // Check condition 2.3: we're at the end of a comment, which has an extra dash. // Need to treat the dash as part of the content and check the ending. @@ -627,17 +636,17 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy isValidComment = true; return true; } - else if (NextIs(ns => ns.Type == HtmlTokenType.Bang && NextIs(HtmlTokenType.CloseAngle))) + else if (NextIs(ns => ns.Kind == SyntaxKind.Bang && NextIs(SyntaxKind.CloseAngle))) { // This is condition 2.2.3 isValidComment = false; return true; } } - else if (token.Type == HtmlTokenType.OpenAngle) + else if (token.Kind == SyntaxKind.OpenAngle) { // Checking condition 2.2.1 - if (NextIs(ns => ns.Type == HtmlTokenType.Bang && NextIs(HtmlTokenType.DoubleHyphen))) + if (NextIs(ns => ns.Kind == SyntaxKind.Bang && NextIs(SyntaxKind.DoubleHyphen))) { isValidComment = false; return true; @@ -653,13 +662,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy /// /// Verifies, that the sequence doesn't end with the "<!-" HtmlTokens. Note, the first token is an opening bracket token /// - internal static bool IsCommentContentEndingInvalid(IEnumerable sequence) + internal static bool IsCommentContentEndingInvalid(IEnumerable sequence) { var reversedSequence = sequence.Reverse(); var index = 0; foreach (var item in reversedSequence) { - if (!item.Equals(nonAllowedHtmlCommentEnding[index++])) + if (!item.IsEquivalentTo(nonAllowedHtmlCommentEnding[index++])) { return false; } @@ -675,13 +684,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private bool CData() { - if (CurrentToken.Type == HtmlTokenType.Text && string.Equals(CurrentToken.Content, "cdata", StringComparison.OrdinalIgnoreCase)) + if (CurrentToken.Kind == SyntaxKind.HtmlTextLiteral && string.Equals(CurrentToken.Content, "cdata", StringComparison.OrdinalIgnoreCase)) { if (AcceptAndMoveNext()) { - if (CurrentToken.Type == HtmlTokenType.LeftBracket) + if (CurrentToken.Kind == SyntaxKind.LeftBracket) { - return AcceptUntilAll(HtmlTokenType.RightBracket, HtmlTokenType.RightBracket, HtmlTokenType.CloseAngle); + return AcceptUntilAll(SyntaxKind.RightBracket, SyntaxKind.RightBracket, SyntaxKind.CloseAngle); } } } @@ -690,11 +699,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } private bool EndTag(SourceLocation tagStart, - Stack> tags, + Stack> tags, IDisposable tagBlockWrapper) { // Accept "/" and move next - Assert(HtmlTokenType.ForwardSlash); + Assert(SyntaxKind.ForwardSlash); var forwardSlash = CurrentToken; if (!NextToken()) { @@ -705,20 +714,20 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy else { var tagName = string.Empty; - HtmlToken bangToken = null; + SyntaxToken bangToken = null; - if (At(HtmlTokenType.Bang)) + if (At(SyntaxKind.Bang)) { bangToken = CurrentToken; var nextToken = Lookahead(count: 1); - if (nextToken != null && nextToken.Type == HtmlTokenType.Text) + if (nextToken != null && nextToken.Kind == SyntaxKind.HtmlTextLiteral) { tagName = "!" + nextToken.Content; } } - else if (At(HtmlTokenType.Text)) + else if (At(SyntaxKind.HtmlTextLiteral)) { tagName = CurrentToken.Content; } @@ -738,32 +747,32 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy OptionalBangEscape(); - AcceptUntil(HtmlTokenType.CloseAngle); + AcceptUntil(SyntaxKind.CloseAngle); // Accept the ">" - return Optional(HtmlTokenType.CloseAngle); + return Optional(SyntaxKind.CloseAngle); } } private void RecoverTextTag() { // We don't want to skip-to and parse because there shouldn't be anything in the body of text tags. - AcceptUntil(HtmlTokenType.CloseAngle, HtmlTokenType.NewLine); + AcceptUntil(SyntaxKind.CloseAngle, SyntaxKind.NewLine); // Include the close angle in the text tag block if it's there, otherwise just move on - Optional(HtmlTokenType.CloseAngle); + Optional(SyntaxKind.CloseAngle); } - private bool EndTextTag(HtmlToken solidus, IDisposable tagBlockWrapper) + private bool EndTextTag(SyntaxToken solidus, IDisposable tagBlockWrapper) { Accept(_bufferedOpenAngle); Accept(solidus); var textLocation = CurrentStart; - Assert(HtmlTokenType.Text); + Assert(SyntaxKind.HtmlTextLiteral); AcceptAndMoveNext(); - var seenCloseAngle = Optional(HtmlTokenType.CloseAngle); + var seenCloseAngle = Optional(SyntaxKind.CloseAngle); if (!seenCloseAngle) { @@ -791,32 +800,32 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { get { - if (At(HtmlTokenType.OpenAngle)) + if (At(SyntaxKind.OpenAngle)) { - if (NextIs(HtmlTokenType.Bang)) + if (NextIs(SyntaxKind.Bang)) { return !IsBangEscape(lookahead: 1); } - return NextIs(HtmlTokenType.QuestionMark); + return NextIs(SyntaxKind.QuestionMark); } return false; } } - private bool IsTagRecoveryStopPoint(HtmlToken token) + private bool IsTagRecoveryStopPoint(SyntaxToken token) { - return token.Type == HtmlTokenType.CloseAngle || - token.Type == HtmlTokenType.ForwardSlash || - token.Type == HtmlTokenType.OpenAngle || - token.Type == HtmlTokenType.SingleQuote || - token.Type == HtmlTokenType.DoubleQuote; + return token.Kind == SyntaxKind.CloseAngle || + token.Kind == SyntaxKind.ForwardSlash || + token.Kind == SyntaxKind.OpenAngle || + token.Kind == SyntaxKind.SingleQuote || + token.Kind == SyntaxKind.DoubleQuote; } private void TagContent() { - if (!At(HtmlTokenType.WhiteSpace) && !At(HtmlTokenType.NewLine)) + if (!At(SyntaxKind.Whitespace) && !At(SyntaxKind.NewLine)) { // We should be right after the tag name, so if there's no whitespace or new line, something is wrong RecoverToEndOfTag(); @@ -833,9 +842,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private bool IsEndOfTag() { - if (At(HtmlTokenType.ForwardSlash)) + if (At(SyntaxKind.ForwardSlash)) { - if (NextIs(HtmlTokenType.CloseAngle)) + if (NextIs(SyntaxKind.CloseAngle)) { return true; } @@ -844,16 +853,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy AcceptAndMoveNext(); } } - return At(HtmlTokenType.CloseAngle) || At(HtmlTokenType.OpenAngle); + return At(SyntaxKind.CloseAngle) || At(SyntaxKind.OpenAngle); } private void BeforeAttribute() { // http://dev.w3.org/html5/spec/tokenization.html#before-attribute-name-state // Capture whitespace - var whitespace = ReadWhile(token => token.Type == HtmlTokenType.WhiteSpace || token.Type == HtmlTokenType.NewLine); + var whitespace = ReadWhile(token => token.Kind == SyntaxKind.Whitespace || token.Kind == SyntaxKind.NewLine); - if (At(HtmlTokenType.Transition) || At(HtmlTokenType.RazorCommentTransition)) + if (At(SyntaxKind.Transition) || At(SyntaxKind.RazorCommentTransition)) { // Transition outside of attribute value => Switch to recovery mode Accept(whitespace); @@ -863,21 +872,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // http://dev.w3.org/html5/spec/tokenization.html#attribute-name-state // Read the 'name' (i.e. read until the '=' or whitespace/newline) - var name = Enumerable.Empty(); - var whitespaceAfterAttributeName = Enumerable.Empty(); + var name = Enumerable.Empty(); + var whitespaceAfterAttributeName = Enumerable.Empty(); if (IsValidAttributeNameToken(CurrentToken)) { name = ReadWhile(token => - token.Type != HtmlTokenType.WhiteSpace && - token.Type != HtmlTokenType.NewLine && - token.Type != HtmlTokenType.Equals && - token.Type != HtmlTokenType.CloseAngle && - token.Type != HtmlTokenType.OpenAngle && - (token.Type != HtmlTokenType.ForwardSlash || !NextIs(HtmlTokenType.CloseAngle))); + token.Kind != SyntaxKind.Whitespace && + token.Kind != SyntaxKind.NewLine && + token.Kind != SyntaxKind.Equals && + token.Kind != SyntaxKind.CloseAngle && + token.Kind != SyntaxKind.OpenAngle && + (token.Kind != SyntaxKind.ForwardSlash || !NextIs(SyntaxKind.CloseAngle))); // capture whitespace after attribute name (if any) whitespaceAfterAttributeName = ReadWhile( - token => token.Type == HtmlTokenType.WhiteSpace || token.Type == HtmlTokenType.NewLine); + token => token.Kind == SyntaxKind.Whitespace || token.Kind == SyntaxKind.NewLine); } else { @@ -887,7 +896,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return; } - if (!At(HtmlTokenType.Equals)) + if (!At(SyntaxKind.Equals)) { // Minimized attribute @@ -922,9 +931,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } private void AttributePrefix( - IEnumerable whitespace, - IEnumerable nameTokens, - IEnumerable whitespaceAfterAttributeName) + IEnumerable whitespace, + IEnumerable nameTokens, + IEnumerable whitespaceAfterAttributeName) { // First, determine if this is a 'data-' attribute (since those can't use conditional attributes) var name = string.Concat(nameTokens.Select(s => s.Content)); @@ -938,16 +947,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Since this is not a minimized attribute, the whitespace after attribute name belongs to this attribute. Accept(whitespaceAfterAttributeName); - Assert(HtmlTokenType.Equals); // We should be at "=" + Assert(SyntaxKind.Equals); // We should be at "=" AcceptAndMoveNext(); - var whitespaceAfterEquals = ReadWhile(token => token.Type == HtmlTokenType.WhiteSpace || token.Type == HtmlTokenType.NewLine); - var quote = HtmlTokenType.Unknown; - if (At(HtmlTokenType.SingleQuote) || At(HtmlTokenType.DoubleQuote)) + var whitespaceAfterEquals = ReadWhile(token => token.Kind == SyntaxKind.Whitespace || token.Kind == SyntaxKind.NewLine); + var quote = SyntaxKind.Unknown; + if (At(SyntaxKind.SingleQuote) || At(SyntaxKind.DoubleQuote)) { // Found a quote, the whitespace belongs to this attribute. Accept(whitespaceAfterEquals); - quote = CurrentToken.Type; + quote = CurrentToken.Kind; AcceptAndMoveNext(); } else if (whitespaceAfterEquals.Any()) @@ -967,7 +976,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Read the attribute value only if the value is quoted // or if there is no whitespace between '=' and the unquoted value. - if (quote != HtmlTokenType.Unknown || !whitespaceAfterEquals.Any()) + if (quote != SyntaxKind.Unknown || !whitespaceAfterEquals.Any()) { // Read the attribute value. while (!EndOfFile && !IsEndOfAttributeValue(quote, CurrentToken)) @@ -978,7 +987,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Capture the suffix var suffix = new LocationTagged(string.Empty, CurrentStart); - if (quote != HtmlTokenType.Unknown && At(quote)) + if (quote != SyntaxKind.Unknown && At(quote)) { suffix = new LocationTagged(CurrentToken.Content, CurrentStart); AcceptAndMoveNext(); @@ -1000,7 +1009,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Output the attribute name, the equals and optional quote. Ex: foo=" Output(SpanKindInternal.Markup); - if (quote == HtmlTokenType.Unknown && whitespaceAfterEquals.Any()) + if (quote == SyntaxKind.Unknown && whitespaceAfterEquals.Any()) { return; } @@ -1011,7 +1020,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Output the attribute value (will include everything in-between the attribute's quotes). Output(SpanKindInternal.Markup); - if (quote != HtmlTokenType.Unknown) + if (quote != SyntaxKind.Unknown) { Optional(quote); } @@ -1019,14 +1028,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - private void AttributeValue(HtmlTokenType quote) + private void AttributeValue(SyntaxKind quote) { var prefixStart = CurrentStart; - var prefix = ReadWhile(token => token.Type == HtmlTokenType.WhiteSpace || token.Type == HtmlTokenType.NewLine); + var prefix = ReadWhile(token => token.Kind == SyntaxKind.Whitespace || token.Kind == SyntaxKind.NewLine); - if (At(HtmlTokenType.Transition)) + if (At(SyntaxKind.Transition)) { - if (NextIs(HtmlTokenType.Transition)) + if (NextIs(SyntaxKind.Transition)) { // Wrapping this in a block so that the ConditionalAttributeCollapser doesn't rewrite it. using (Context.Builder.StartBlock(BlockKindInternal.Markup)) @@ -1076,9 +1085,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var valueStart = CurrentStart; var value = ReadWhile(token => // These three conditions find separators which break the attribute value into portions - token.Type != HtmlTokenType.WhiteSpace && - token.Type != HtmlTokenType.NewLine && - token.Type != HtmlTokenType.Transition && + token.Kind != SyntaxKind.Whitespace && + token.Kind != SyntaxKind.NewLine && + token.Kind != SyntaxKind.Transition && // This condition checks for the end of the attribute value (it repeats some of the checks above // but for now that's ok) !IsEndOfAttributeValue(quote, token)); @@ -1090,27 +1099,27 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Output(SpanKindInternal.Markup); } - private bool IsEndOfAttributeValue(HtmlTokenType quote, HtmlToken token) + private bool IsEndOfAttributeValue(SyntaxKind quote, SyntaxToken token) { return EndOfFile || token == null || - (quote != HtmlTokenType.Unknown - ? token.Type == quote // If quoted, just wait for the quote + (quote != SyntaxKind.Unknown + ? token.Kind == quote // If quoted, just wait for the quote : IsUnquotedEndOfAttributeValue(token)); } - private bool IsUnquotedEndOfAttributeValue(HtmlToken token) + private bool IsUnquotedEndOfAttributeValue(SyntaxToken token) { // If unquoted, we have a larger set of terminating characters: // http://dev.w3.org/html5/spec/tokenization.html#attribute-value-unquoted-state // Also we need to detect "/" and ">" - return token.Type == HtmlTokenType.DoubleQuote || - token.Type == HtmlTokenType.SingleQuote || - token.Type == HtmlTokenType.OpenAngle || - token.Type == HtmlTokenType.Equals || - (token.Type == HtmlTokenType.ForwardSlash && NextIs(HtmlTokenType.CloseAngle)) || - token.Type == HtmlTokenType.CloseAngle || - token.Type == HtmlTokenType.WhiteSpace || - token.Type == HtmlTokenType.NewLine; + return token.Kind == SyntaxKind.DoubleQuote || + token.Kind == SyntaxKind.SingleQuote || + token.Kind == SyntaxKind.OpenAngle || + token.Kind == SyntaxKind.Equals || + (token.Kind == SyntaxKind.ForwardSlash && NextIs(SyntaxKind.CloseAngle)) || + token.Kind == SyntaxKind.CloseAngle || + token.Kind == SyntaxKind.Whitespace || + token.Kind == SyntaxKind.NewLine; } private void RecoverToEndOfTag() @@ -1122,17 +1131,17 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy if (!EndOfFile) { EnsureCurrent(); - switch (CurrentToken.Type) + switch (CurrentToken.Kind) { - case HtmlTokenType.SingleQuote: - case HtmlTokenType.DoubleQuote: + case SyntaxKind.SingleQuote: + case SyntaxKind.DoubleQuote: ParseQuoted(); break; - case HtmlTokenType.OpenAngle: + case SyntaxKind.OpenAngle: // Another "<" means this tag is invalid. - case HtmlTokenType.ForwardSlash: + case SyntaxKind.ForwardSlash: // Empty tag - case HtmlTokenType.CloseAngle: + case SyntaxKind.CloseAngle: // End of tag return; default: @@ -1145,12 +1154,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void ParseQuoted() { - var type = CurrentToken.Type; + var type = CurrentToken.Kind; AcceptAndMoveNext(); ParseQuoted(type); } - private void ParseQuoted(HtmlTokenType type) + private void ParseQuoted(SyntaxKind type) { SkipToAndParseCode(type); if (!EndOfFile) @@ -1160,12 +1169,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - private bool StartTag(Stack> tags, IDisposable tagBlockWrapper) + private bool StartTag(Stack> tags, IDisposable tagBlockWrapper) { - HtmlToken bangToken = null; - HtmlToken potentialTagNameToken; + SyntaxToken bangToken = null; + SyntaxToken potentialTagNameToken; - if (At(HtmlTokenType.Bang)) + if (At(SyntaxKind.Bang)) { bangToken = CurrentToken; @@ -1176,22 +1185,22 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy potentialTagNameToken = CurrentToken; } - HtmlToken tagName; + SyntaxToken tagName; - if (potentialTagNameToken == null || potentialTagNameToken.Type != HtmlTokenType.Text) + if (potentialTagNameToken == null || potentialTagNameToken.Kind != SyntaxKind.HtmlTextLiteral) { - tagName = new HtmlToken(string.Empty, HtmlTokenType.Unknown); + tagName = SyntaxFactory.Token(SyntaxKind.Unknown, string.Empty); } else if (bangToken != null) { - tagName = new HtmlToken("!" + potentialTagNameToken.Content, HtmlTokenType.Text); + tagName = SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "!" + potentialTagNameToken.Content); } else { tagName = potentialTagNameToken; } - Tuple tag = Tuple.Create(tagName, _lastTagStart); + var tag = Tuple.Create(tagName, _lastTagStart); if (tags.Count == 0 && // Note tagName may contain a '!' escape character. This ensures doesn't match here. @@ -1203,23 +1212,23 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Accept(_bufferedOpenAngle); var textLocation = CurrentStart; - Assert(HtmlTokenType.Text); + Assert(SyntaxKind.HtmlTextLiteral); AcceptAndMoveNext(); var bookmark = CurrentStart.AbsoluteIndex; - IEnumerable tokens = ReadWhile(IsSpacingToken(includeNewLines: true)); - var empty = At(HtmlTokenType.ForwardSlash); + var tokens = ReadWhile(IsSpacingToken(includeNewLines: true)); + var empty = At(SyntaxKind.ForwardSlash); if (empty) { Accept(tokens); - Assert(HtmlTokenType.ForwardSlash); + Assert(SyntaxKind.ForwardSlash); AcceptAndMoveNext(); bookmark = CurrentStart.AbsoluteIndex; tokens = ReadWhile(IsSpacingToken(includeNewLines: true)); } - if (!Optional(HtmlTokenType.CloseAngle)) + if (!Optional(SyntaxKind.CloseAngle)) { Context.Source.Position = bookmark; NextToken(); @@ -1247,24 +1256,24 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Accept(_bufferedOpenAngle); OptionalBangEscape(); - Optional(HtmlTokenType.Text); + Optional(SyntaxKind.HtmlTextLiteral); return RestOfTag(tag, tags, tagBlockWrapper); } - private bool RestOfTag(Tuple tag, - Stack> tags, + private bool RestOfTag(Tuple tag, + Stack> tags, IDisposable tagBlockWrapper) { TagContent(); // We are now at a possible end of the tag // Found '<', so we just abort this tag. - if (At(HtmlTokenType.OpenAngle)) + if (At(SyntaxKind.OpenAngle)) { return false; } - var isEmpty = At(HtmlTokenType.ForwardSlash); + var isEmpty = At(SyntaxKind.ForwardSlash); // Found a solidus, so don't accept it but DON'T push the tag to the stack if (isEmpty) { @@ -1272,7 +1281,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } // Check for the '>' to determine if the tag is finished - var seenClose = Optional(HtmlTokenType.CloseAngle); + var seenClose = Optional(SyntaxKind.CloseAngle); if (!seenClose) { Context.ErrorSink.OnError( @@ -1298,17 +1307,17 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var bookmark = CurrentStart.AbsoluteIndex; // Skip whitespace - IEnumerable whiteSpace = ReadWhile(IsSpacingToken(includeNewLines: true)); + var whiteSpace = ReadWhile(IsSpacingToken(includeNewLines: true)); // Open Angle - if (At(HtmlTokenType.OpenAngle) && NextIs(HtmlTokenType.ForwardSlash)) + if (At(SyntaxKind.OpenAngle) && NextIs(SyntaxKind.ForwardSlash)) { var openAngle = CurrentToken; NextToken(); - Assert(HtmlTokenType.ForwardSlash); + Assert(SyntaxKind.ForwardSlash); var solidus = CurrentToken; NextToken(); - if (At(HtmlTokenType.Text) && string.Equals(CurrentToken.Content, tagName, StringComparison.OrdinalIgnoreCase)) + if (At(SyntaxKind.HtmlTextLiteral) && string.Equals(CurrentToken.Content, tagName, StringComparison.OrdinalIgnoreCase)) { // Accept up to here Accept(whiteSpace); @@ -1321,9 +1330,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy AcceptAndMoveNext(); // Accept to '>', '<' or EOF - AcceptUntil(HtmlTokenType.CloseAngle, HtmlTokenType.OpenAngle); + AcceptUntil(SyntaxKind.CloseAngle, SyntaxKind.OpenAngle); // Accept the '>' if we saw it. And if we do see it, we're complete - var complete = Optional(HtmlTokenType.CloseAngle); + var complete = Optional(SyntaxKind.CloseAngle); if (complete) { @@ -1373,17 +1382,17 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy while (!seenEndScript && !EndOfFile) { - SkipToAndParseCode(HtmlTokenType.OpenAngle); + SkipToAndParseCode(SyntaxKind.OpenAngle); var tagStart = CurrentStart; - if (NextIs(HtmlTokenType.ForwardSlash)) + if (NextIs(SyntaxKind.ForwardSlash)) { var openAngle = CurrentToken; NextToken(); // Skip over '<', current is '/' var solidus = CurrentToken; NextToken(); // Skip over '/', current should be text - if (At(HtmlTokenType.Text) && + if (At(SyntaxKind.HtmlTextLiteral) && string.Equals(CurrentToken.Content, ScriptTagName, StringComparison.OrdinalIgnoreCase)) { seenEndScript = true; @@ -1409,8 +1418,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy AcceptAndMoveNext(); // '<' AcceptAndMoveNext(); // '/' - SkipToAndParseCode(HtmlTokenType.CloseAngle); - if (!Optional(HtmlTokenType.CloseAngle)) + SkipToAndParseCode(SyntaxKind.CloseAngle); + if (!Optional(SyntaxKind.CloseAngle)) { Context.ErrorSink.OnError( RazorDiagnosticFactory.CreateParsing_UnfinishedTag( @@ -1441,7 +1450,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy tagBlockWrapper.Dispose(); } - private bool AcceptUntilAll(params HtmlTokenType[] endSequence) + private bool AcceptUntilAll(params SyntaxKind[] endSequence) { while (!EndOfFile) { @@ -1456,9 +1465,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return false; } - private bool RemoveTag(Stack> tags, string tagName, SourceLocation tagStart) + private bool RemoveTag(Stack> tags, string tagName, SourceLocation tagStart) { - Tuple currentTag = null; + Tuple currentTag = null; while (tags.Count > 0) { currentTag = tags.Pop(); @@ -1486,7 +1495,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return false; } - private void EndTagBlock(Stack> tags, bool complete) + private void EndTagBlock(Stack> tags, bool complete) { if (tags.Count > 0) { @@ -1515,11 +1524,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy if (Context.Builder.LastSpan.Kind == SpanKindInternal.Transition) { var tokens = ReadWhile( - f => (f.Type == HtmlTokenType.WhiteSpace) || (f.Type == HtmlTokenType.NewLine)); + f => (f.Kind == SyntaxKind.Whitespace) || (f.Kind == SyntaxKind.NewLine)); // Make sure the current token is not markup, which can be html start tag or @: - if (!(At(HtmlTokenType.OpenAngle) || - (At(HtmlTokenType.Transition) && Lookahead(count: 1).Content.StartsWith(":")))) + if (!(At(SyntaxKind.OpenAngle) || + (At(SyntaxKind.Transition) && Lookahead(count: 1).Content.StartsWith(":")))) { // Don't accept whitespace as markup if the end text tag is followed by csharp. shouldAcceptWhitespaceAndNewLine = false; @@ -1533,14 +1542,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy if (shouldAcceptWhitespaceAndNewLine) { // Accept whitespace and a single newline if present - AcceptWhile(HtmlTokenType.WhiteSpace); - Optional(HtmlTokenType.NewLine); + AcceptWhile(SyntaxKind.Whitespace); + Optional(SyntaxKind.NewLine); } } else if (Span.EditHandler.AcceptedCharacters == AcceptedCharactersInternal.Any) { - AcceptWhile(HtmlTokenType.WhiteSpace); - Optional(HtmlTokenType.NewLine); + AcceptWhile(SyntaxKind.Whitespace); + Optional(SyntaxKind.NewLine); } PutCurrentBack(); @@ -1551,7 +1560,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Output(SpanKindInternal.Markup); } - internal static bool IsValidAttributeNameToken(HtmlToken token) + internal static bool IsValidAttributeNameToken(SyntaxToken token) { if (token == null) { @@ -1562,16 +1571,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // However, it's not all of it. For instance we don't special case control characters or allow OpenAngle. // It also doesn't try to exclude Razor specific features such as the @ transition. This is based on the // expectation that the parser handles such scenarios prior to falling through to name resolution. - var tokenType = token.Type; - return tokenType != HtmlTokenType.WhiteSpace && - tokenType != HtmlTokenType.NewLine && - tokenType != HtmlTokenType.CloseAngle && - tokenType != HtmlTokenType.OpenAngle && - tokenType != HtmlTokenType.ForwardSlash && - tokenType != HtmlTokenType.DoubleQuote && - tokenType != HtmlTokenType.SingleQuote && - tokenType != HtmlTokenType.Equals && - tokenType != HtmlTokenType.Unknown; + var tokenType = token.Kind; + return tokenType != SyntaxKind.Whitespace && + tokenType != SyntaxKind.NewLine && + tokenType != SyntaxKind.CloseAngle && + tokenType != SyntaxKind.OpenAngle && + tokenType != SyntaxKind.ForwardSlash && + tokenType != SyntaxKind.DoubleQuote && + tokenType != SyntaxKind.SingleQuote && + tokenType != SyntaxKind.Equals && + tokenType != SyntaxKind.Unknown; } public void ParseDocument() @@ -1591,7 +1600,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy NextToken(); while (!EndOfFile) { - SkipToAndParseCode(HtmlTokenType.OpenAngle); + SkipToAndParseCode(SyntaxKind.OpenAngle); ScanTagInDocumentContext(); } AddMarkerTokenIfNecessary(); @@ -1606,14 +1615,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy /// private void ScanTagInDocumentContext() { - if (At(HtmlTokenType.OpenAngle)) + if (At(SyntaxKind.OpenAngle)) { - if (NextIs(HtmlTokenType.Bang)) + if (NextIs(SyntaxKind.Bang)) { // Checking to see if we meet the conditions of a special '!' tag: ' or '

' etc. ParserState = ParserState.EndTag; - Optional(HtmlTokenType.ForwardSlash); + Optional(SyntaxKind.ForwardSlash); // Whitespace here is invalid (according to the spec) OptionalBangEscape(); - Optional(HtmlTokenType.Text); - Optional(HtmlTokenType.WhiteSpace); - Optional(HtmlTokenType.CloseAngle); + Optional(SyntaxKind.HtmlTextLiteral); + Optional(SyntaxKind.Whitespace); + Optional(SyntaxKind.CloseAngle); ParserState = ParserState.Content; } @@ -1727,9 +1736,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private static bool IsTypeAttribute(Block block) { - var span = block.Children.First() as Span; - if (span == null) + if (!(block.Children.First() is Span span)) { return false; } @@ -1778,7 +1786,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { do { - SkipToAndParseCode(token => token.Type == HtmlTokenType.OpenAngle || AtEnd(nestingSequenceComponents)); + SkipToAndParseCode(token => token.Kind == SyntaxKind.OpenAngle || AtEnd(nestingSequenceComponents)); ScanTagInDocumentContext(); if (!EndOfFile && AtEnd(nestingSequenceComponents)) { @@ -1796,9 +1804,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy while (nesting > 0 && !EndOfFile) { SkipToAndParseCode(token => - token.Type == HtmlTokenType.Text || - token.Type == HtmlTokenType.OpenAngle); - if (At(HtmlTokenType.Text)) + token.Kind == SyntaxKind.HtmlTextLiteral || + token.Kind == SyntaxKind.OpenAngle); + if (At(SyntaxKind.HtmlTextLiteral)) { nesting += ProcessTextToken(nestingSequences, nesting); if (CurrentToken != null) @@ -1825,7 +1833,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var bookmark = Context.Source.Position - CurrentToken.Content.Length; try { - foreach (string component in nestingSequenceComponents) + foreach (var component in nestingSequenceComponents) { if (!EndOfFile && !string.Equals(CurrentToken.Content, component, Comparison)) { @@ -1850,7 +1858,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private int ProcessTextToken(Tuple nestingSequences, int currentNesting) { - for (int i = 0; i < CurrentToken.Content.Length; i++) + for (var i = 0; i < CurrentToken.Content.Length; i++) { var nestingDelta = HandleNestingSequence(nestingSequences.Item1, i, currentNesting, 1); if (nestingDelta == 0) @@ -1881,10 +1889,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy PutCurrentBack(); // Carve up the token - Tuple pair = Language.SplitToken(token, position, HtmlTokenType.Text); + var pair = Language.SplitToken(token, position, SyntaxKind.HtmlTextLiteral); var preSequence = pair.Item1; Debug.Assert(pair.Item2 != null); - pair = Language.SplitToken(pair.Item2, sequence.Length, HtmlTokenType.Text); + pair = Language.SplitToken(pair.Item2, sequence.Length, SyntaxKind.HtmlTextLiteral); var sequenceToken = pair.Item1; var postSequence = pair.Item2; var postSequenceBookmark = bookmark.AbsoluteIndex + preSequence.Content.Length + pair.Item1.Content.Length; diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlToken.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlToken.cs deleted file mode 100644 index 9659d85360..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlToken.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; - -namespace Microsoft.AspNetCore.Razor.Language.Legacy -{ - internal class HtmlToken : TokenBase - { - internal static readonly HtmlToken Hyphen = new HtmlToken("-", HtmlTokenType.Text); - - public HtmlToken(string content, HtmlTokenType type) - : base(content, type, RazorDiagnostic.EmptyArray) - { - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - } - - public HtmlToken( - string content, - HtmlTokenType type, - IReadOnlyList errors) - : base(content, type, errors) - { - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - } - - protected override SyntaxToken GetSyntaxToken() - { - switch (Type) - { - case HtmlTokenType.Text: - return SyntaxFactory.HtmlTextToken(Content, Errors.ToArray()); - case HtmlTokenType.WhiteSpace: - return SyntaxFactory.WhitespaceToken(Content, Errors.ToArray()); - case HtmlTokenType.NewLine: - return SyntaxFactory.NewLineToken(Content, Errors.ToArray()); - case HtmlTokenType.OpenAngle: - return SyntaxFactory.Punctuation(SyntaxKind.OpenAngle, Content, Errors.ToArray()); - case HtmlTokenType.Bang: - return SyntaxFactory.Punctuation(SyntaxKind.Bang, Content, Errors.ToArray()); - case HtmlTokenType.ForwardSlash: - return SyntaxFactory.Punctuation(SyntaxKind.ForwardSlash, Content, Errors.ToArray()); - case HtmlTokenType.QuestionMark: - return SyntaxFactory.Punctuation(SyntaxKind.QuestionMark, Content, Errors.ToArray()); - case HtmlTokenType.DoubleHyphen: - return SyntaxFactory.Punctuation(SyntaxKind.DoubleHyphen, Content, Errors.ToArray()); - case HtmlTokenType.LeftBracket: - return SyntaxFactory.Punctuation(SyntaxKind.LeftBracket, Content, Errors.ToArray()); - case HtmlTokenType.CloseAngle: - return SyntaxFactory.Punctuation(SyntaxKind.CloseAngle, Content, Errors.ToArray()); - case HtmlTokenType.RightBracket: - return SyntaxFactory.Punctuation(SyntaxKind.RightBracket, Content, Errors.ToArray()); - case HtmlTokenType.Equals: - return SyntaxFactory.Punctuation(SyntaxKind.Equals, Content, Errors.ToArray()); - case HtmlTokenType.DoubleQuote: - return SyntaxFactory.Punctuation(SyntaxKind.DoubleQuote, Content, Errors.ToArray()); - case HtmlTokenType.SingleQuote: - return SyntaxFactory.Punctuation(SyntaxKind.SingleQuote, Content, Errors.ToArray()); - case HtmlTokenType.Transition: - return SyntaxFactory.Punctuation(SyntaxKind.Transition, Content, Errors.ToArray()); - case HtmlTokenType.Colon: - return SyntaxFactory.Punctuation(SyntaxKind.Colon, Content, Errors.ToArray()); - default: - return SyntaxFactory.UnknownToken(Content, Errors.ToArray()); - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlTokenType.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlTokenType.cs deleted file mode 100644 index 82d96d7ebc..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlTokenType.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.AspNetCore.Razor.Language.Legacy -{ - [Flags] - internal enum HtmlTokenType - { - Unknown, - Text, // Text which isn't one of the below - WhiteSpace, // Non-newline Whitespace - NewLine, // Newline - OpenAngle, // < - Bang, // ! - ForwardSlash, // / - QuestionMark, // ? - DoubleHyphen, // -- - LeftBracket, // [ - CloseAngle, // > - RightBracket, // ] - Equals, // = - DoubleQuote, // " - SingleQuote, // ' - Transition, // @ - Colon, - RazorComment, - RazorCommentStar, - RazorCommentTransition - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlTokenizer.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlTokenizer.cs index 99a7152447..e804eb3114 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlTokenizer.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/HtmlTokenizer.cs @@ -3,11 +3,12 @@ using System.Collections.Generic; using System.Diagnostics; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { // Tokenizer _loosely_ based on http://dev.w3.org/html5/spec/Overview.html#tokenization - internal class HtmlTokenizer : Tokenizer + internal class HtmlTokenizer : Tokenizer { private const char TransitionChar = '@'; @@ -21,24 +22,24 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private new HtmlTokenizerState? CurrentState => (HtmlTokenizerState?)base.CurrentState; - public override HtmlTokenType RazorCommentType + public override SyntaxKind RazorCommentKind { - get { return HtmlTokenType.RazorComment; } + get { return SyntaxKind.RazorComment; } } - public override HtmlTokenType RazorCommentTransitionType + public override SyntaxKind RazorCommentTransitionKind { - get { return HtmlTokenType.RazorCommentTransition; } + get { return SyntaxKind.RazorCommentTransition; } } - public override HtmlTokenType RazorCommentStarType + public override SyntaxKind RazorCommentStarKind { - get { return HtmlTokenType.RazorCommentStar; } + get { return SyntaxKind.RazorCommentStar; } } - protected override HtmlToken CreateToken(string content, HtmlTokenType type, IReadOnlyList errors) + protected override SyntaxToken CreateToken(string content, SyntaxKind type, IReadOnlyList errors) { - return new HtmlToken(content, type, errors); + return SyntaxFactory.Token(type, content, errors); } protected override StateResult Dispatch() @@ -66,7 +67,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } // Optimize memory allocation by returning constants for the most frequent cases - protected override string GetTokenContent(HtmlTokenType type) + protected override string GetTokenContent(SyntaxKind type) { var tokenLength = Buffer.Length; @@ -74,27 +75,27 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { switch (type) { - case HtmlTokenType.OpenAngle: + case SyntaxKind.OpenAngle: return "<"; - case HtmlTokenType.Bang: + case SyntaxKind.Bang: return "!"; - case HtmlTokenType.ForwardSlash: + case SyntaxKind.ForwardSlash: return "/"; - case HtmlTokenType.QuestionMark: + case SyntaxKind.QuestionMark: return "?"; - case HtmlTokenType.LeftBracket: + case SyntaxKind.LeftBracket: return "["; - case HtmlTokenType.CloseAngle: + case SyntaxKind.CloseAngle: return ">"; - case HtmlTokenType.RightBracket: + case SyntaxKind.RightBracket: return "]"; - case HtmlTokenType.Equals: + case SyntaxKind.Equals: return "="; - case HtmlTokenType.DoubleQuote: + case SyntaxKind.DoubleQuote: return "\""; - case HtmlTokenType.SingleQuote: + case SyntaxKind.SingleQuote: return "'"; - case HtmlTokenType.WhiteSpace: + case SyntaxKind.Whitespace: if (Buffer[0] == ' ') { return " "; @@ -104,7 +105,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return "\t"; } break; - case HtmlTokenType.NewLine: + case SyntaxKind.NewLine: if (Buffer[0] == '\n') { return "\n"; @@ -113,7 +114,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - if (tokenLength == 2 && type == HtmlTokenType.NewLine) + if (tokenLength == 2 && type == SyntaxKind.NewLine) { return "\r\n"; } @@ -139,17 +140,17 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { return Transition( HtmlTokenizerState.AfterRazorCommentTransition, - EndToken(HtmlTokenType.RazorCommentTransition)); + EndToken(SyntaxKind.RazorCommentTransition)); } else if (CurrentCharacter == '@') { // Could be escaped comment transition return Transition( HtmlTokenizerState.EscapedRazorCommentTransition, - EndToken(HtmlTokenType.Transition)); + EndToken(SyntaxKind.Transition)); } - return Stay(EndToken(HtmlTokenType.Transition)); + return Stay(EndToken(SyntaxKind.Transition)); } else if (AtToken()) { @@ -164,7 +165,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private StateResult EscapedRazorCommentTransition() { TakeCurrent(); - return Transition(HtmlTokenizerState.Data, EndToken(HtmlTokenType.Transition)); + return Transition(HtmlTokenizerState.Data, EndToken(SyntaxKind.Transition)); } private StateResult Text() @@ -190,10 +191,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } // Output the Text token and return to the Data state to tokenize the next character (if there is one) - return Transition(HtmlTokenizerState.Data, EndToken(HtmlTokenType.Text)); + return Transition(HtmlTokenizerState.Data, EndToken(SyntaxKind.HtmlTextLiteral)); } - private HtmlToken Token() + private SyntaxToken Token() { Debug.Assert(AtToken()); var sym = CurrentCharacter; @@ -201,45 +202,45 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy switch (sym) { case '<': - return EndToken(HtmlTokenType.OpenAngle); + return EndToken(SyntaxKind.OpenAngle); case '!': - return EndToken(HtmlTokenType.Bang); + return EndToken(SyntaxKind.Bang); case '/': - return EndToken(HtmlTokenType.ForwardSlash); + return EndToken(SyntaxKind.ForwardSlash); case '?': - return EndToken(HtmlTokenType.QuestionMark); + return EndToken(SyntaxKind.QuestionMark); case '[': - return EndToken(HtmlTokenType.LeftBracket); + return EndToken(SyntaxKind.LeftBracket); case '>': - return EndToken(HtmlTokenType.CloseAngle); + return EndToken(SyntaxKind.CloseAngle); case ']': - return EndToken(HtmlTokenType.RightBracket); + return EndToken(SyntaxKind.RightBracket); case '=': - return EndToken(HtmlTokenType.Equals); + return EndToken(SyntaxKind.Equals); case '"': - return EndToken(HtmlTokenType.DoubleQuote); + return EndToken(SyntaxKind.DoubleQuote); case '\'': - return EndToken(HtmlTokenType.SingleQuote); + return EndToken(SyntaxKind.SingleQuote); case '-': Debug.Assert(CurrentCharacter == '-'); TakeCurrent(); - return EndToken(HtmlTokenType.DoubleHyphen); + return EndToken(SyntaxKind.DoubleHyphen); default: Debug.Fail("Unexpected token!"); - return EndToken(HtmlTokenType.Unknown); + return EndToken(SyntaxKind.Unknown); } } - private HtmlToken Whitespace() + private SyntaxToken Whitespace() { while (ParserHelpers.IsWhitespace(CurrentCharacter)) { TakeCurrent(); } - return EndToken(HtmlTokenType.WhiteSpace); + return EndToken(SyntaxKind.Whitespace); } - private HtmlToken Newline() + private SyntaxToken Newline() { Debug.Assert(ParserHelpers.IsNewLine(CurrentCharacter)); // CSharp Spec §2.3.1 @@ -249,7 +250,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TakeCurrent(); } - return EndToken(HtmlTokenType.NewLine); + return EndToken(SyntaxKind.NewLine); } private bool AtToken() @@ -274,7 +275,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return Transition((int)state, result: null); } - private StateResult Transition(HtmlTokenizerState state, HtmlToken result) + private StateResult Transition(HtmlTokenizerState state, SyntaxToken result) { return Transition((int)state, result); } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/IToken.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/IToken.cs deleted file mode 100644 index a57f9dbf4d..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/IToken.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; - -namespace Microsoft.AspNetCore.Razor.Language.Legacy -{ - internal interface IToken - { - Span Parent { get; set; } - - string Content { get; } - - SourceLocation Start { get; } - - SyntaxKind SyntaxKind { get; } - - SyntaxToken SyntaxToken { get; } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/ITokenizer.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/ITokenizer.cs index 530df75dbc..0dac9f1b4f 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/ITokenizer.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/ITokenizer.cs @@ -1,10 +1,12 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; + namespace Microsoft.AspNetCore.Razor.Language.Legacy { internal interface ITokenizer { - IToken NextToken(); + SyntaxToken NextToken(); } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/ImplicitExpressionEditHandler.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/ImplicitExpressionEditHandler.cs index b3869f00d0..fb9efdc751 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/ImplicitExpressionEditHandler.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/ImplicitExpressionEditHandler.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; +using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -16,7 +17,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private readonly ISet _keywords; private readonly IReadOnlyCollection _readOnlyKeywords; - public ImplicitExpressionEditHandler(Func> tokenizer, ISet keywords, bool acceptTrailingDot) + public ImplicitExpressionEditHandler(Func> tokenizer, ISet keywords, bool acceptTrailingDot) : base(tokenizer) { _keywords = keywords ?? new HashSet(); @@ -172,20 +173,20 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy for (var i = 0; i < target.Tokens.Count; i++) { - var token = target.Tokens[i] as CSharpToken; + var token = target.Tokens[i]; if (token == null) { break; } - var tokenStartIndex = token.Start.AbsoluteIndex; - var tokenEndIndex = tokenStartIndex + token.Content.Length; + var tokenStartIndex = token.Position; + var tokenEndIndex = token.EndPosition; // We're looking for the first token that contains the SourceChange. if (tokenEndIndex > change.Span.AbsoluteIndex) { - if (tokenEndIndex >= change.Span.AbsoluteIndex + change.Span.Length && token.Type == CSharpTokenType.Identifier) + if (tokenEndIndex >= change.Span.AbsoluteIndex + change.Span.Length && token.Kind == SyntaxKind.Identifier) { // The token we're changing happens to be an identifier. Need to check if its transformed state is also one. // We do this transformation logic to capture the case that the new text change happens to not be an identifier; @@ -200,8 +201,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy break; } - var newToken = (CSharpToken)newTokens.First(); - if (newToken.Type == CSharpTokenType.Identifier) + var newToken = newTokens.First(); + if (newToken.Kind == SyntaxKind.Identifier) { return true; } @@ -241,8 +242,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var changeStart = change.Span.AbsoluteIndex; var changeLength = change.Span.Length; var changeEnd = changeStart + changeLength; - var tokens = target.Tokens.Cast().ToArray(); - if (!IsInsideParenthesis(changeStart, tokens) || !IsInsideParenthesis(changeEnd, tokens)) + if (!IsInsideParenthesis(changeStart, target.Tokens) || !IsInsideParenthesis(changeEnd, target.Tokens)) { // Either the start or end of the delete does not fall inside of parenthesis, unacceptable inner deletion. return false; @@ -274,8 +274,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return false; } - var tokens = target.Tokens.Cast().ToArray(); - if (IsInsideParenthesis(change.Span.AbsoluteIndex, tokens)) + if (IsInsideParenthesis(change.Span.AbsoluteIndex, target.Tokens)) { return true; } @@ -284,7 +283,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } // Internal for testing - internal static bool IsInsideParenthesis(int position, IReadOnlyList tokens) + internal static bool IsInsideParenthesis(int position, IReadOnlyList tokens) { var balanceCount = 0; var foundInsertionPoint = false; @@ -322,9 +321,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } // Internal for testing - internal static bool ContainsPosition(int position, CSharpToken currentToken) + internal static bool ContainsPosition(int position, SyntaxToken currentToken) { - var tokenStart = currentToken.Start.AbsoluteIndex; + var tokenStart = currentToken.Position; if (tokenStart == position) { // Token is exactly at the insertion point. @@ -342,14 +341,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } // Internal for testing - internal static bool TryUpdateBalanceCount(CSharpToken token, ref int count) + internal static bool TryUpdateBalanceCount(SyntaxToken token, ref int count) { var updatedCount = count; - if (token.Type == CSharpTokenType.LeftParenthesis) + if (token.Kind == SyntaxKind.LeftParenthesis) { updatedCount++; } - else if (token.Type == CSharpTokenType.RightParenthesis) + else if (token.Kind == SyntaxKind.RightParenthesis) { if (updatedCount == 0) { @@ -358,7 +357,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy updatedCount--; } - else if (token.Type == CSharpTokenType.StringLiteral) + else if (token.Kind == SyntaxKind.StringLiteral) { var content = token.Content; if (content.Length > 0 && content[content.Length - 1] != '"') @@ -370,7 +369,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } } - else if (token.Type == CSharpTokenType.CharacterLiteral) + else if (token.Kind == SyntaxKind.CharacterLiteral) { var content = token.Content; if (content.Length > 0 && content[content.Length - 1] != '\'') diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/LanguageCharacteristics.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/LanguageCharacteristics.cs index b12bf612b9..b08bbb0fe1 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/LanguageCharacteristics.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/LanguageCharacteristics.cs @@ -3,30 +3,29 @@ using System; using System.Collections.Generic; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { - internal abstract class LanguageCharacteristics - where TTokenType : struct - where TTokenizer : Tokenizer - where TToken : TokenBase + internal abstract class LanguageCharacteristics + where TTokenizer : Tokenizer { - public abstract string GetSample(TTokenType type); + public abstract string GetSample(SyntaxKind type); public abstract TTokenizer CreateTokenizer(ITextDocument source); - public abstract TTokenType FlipBracket(TTokenType bracket); - public abstract TToken CreateMarkerToken(); + public abstract SyntaxKind FlipBracket(SyntaxKind bracket); + public abstract SyntaxToken CreateMarkerToken(); - public virtual IEnumerable TokenizeString(string content) + public virtual IEnumerable TokenizeString(string content) { return TokenizeString(SourceLocation.Zero, content); } - public virtual IEnumerable TokenizeString(SourceLocation start, string input) + public virtual IEnumerable TokenizeString(SourceLocation start, string input) { using (var reader = new SeekableTextReader(input, start.FilePath)) { var tok = CreateTokenizer(reader); - TToken token; + SyntaxToken token; while ((token = tok.NextToken()) != null) { yield return token; @@ -34,76 +33,76 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - public virtual bool IsWhiteSpace(TToken token) + public virtual bool IsWhiteSpace(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.WhiteSpace); } - public virtual bool IsNewLine(TToken token) + public virtual bool IsNewLine(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.NewLine); } - public virtual bool IsIdentifier(TToken token) + public virtual bool IsIdentifier(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.Identifier); } - public virtual bool IsKeyword(TToken token) + public virtual bool IsKeyword(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.Keyword); } - public virtual bool IsTransition(TToken token) + public virtual bool IsTransition(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.Transition); } - public virtual bool IsCommentStart(TToken token) + public virtual bool IsCommentStart(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.CommentStart); } - public virtual bool IsCommentStar(TToken token) + public virtual bool IsCommentStar(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.CommentStar); } - public virtual bool IsCommentBody(TToken token) + public virtual bool IsCommentBody(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.CommentBody); } - public virtual bool IsUnknown(TToken token) + public virtual bool IsUnknown(SyntaxToken token) { return IsKnownTokenType(token, KnownTokenType.Unknown); } - public virtual bool IsKnownTokenType(TToken token, KnownTokenType type) + public virtual bool IsKnownTokenType(SyntaxToken token, KnownTokenType type) { - return token != null && Equals(token.Type, GetKnownTokenType(type)); + return token != null && Equals(token.Kind, GetKnownTokenType(type)); } - public virtual Tuple SplitToken(TToken token, int splitAt, TTokenType leftType) + public virtual Tuple SplitToken(SyntaxToken token, int splitAt, SyntaxKind leftType) { var left = CreateToken(token.Content.Substring(0, splitAt), leftType, RazorDiagnostic.EmptyArray); - TToken right = null; + SyntaxToken right = null; if (splitAt < token.Content.Length) { - right = CreateToken(token.Content.Substring(splitAt), token.Type, token.Errors); + right = CreateToken(token.Content.Substring(splitAt), token.Kind, token.GetDiagnostics()); } return Tuple.Create(left, right); } - public abstract TTokenType GetKnownTokenType(KnownTokenType type); + public abstract SyntaxKind GetKnownTokenType(KnownTokenType type); public virtual bool KnowsTokenType(KnownTokenType type) { return type == KnownTokenType.Unknown || !Equals(GetKnownTokenType(type), GetKnownTokenType(KnownTokenType.Unknown)); } - protected abstract TToken CreateToken(string content, TTokenType type, IReadOnlyList errors); + protected abstract SyntaxToken CreateToken(string content, SyntaxKind type, IReadOnlyList errors); } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/MarkupRewriter.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/MarkupRewriter.cs index 42074050ff..95908fb736 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/MarkupRewriter.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/MarkupRewriter.cs @@ -67,9 +67,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy builder.Kind = SpanKindInternal.Markup; builder.ChunkGenerator = new MarkupChunkGenerator(); - foreach (IToken sym in HtmlLanguageCharacteristics.Instance.TokenizeString(start, content)) + foreach (var token in HtmlLanguageCharacteristics.Instance.TokenizeString(start, content)) { - builder.Accept(sym); + builder.Accept(token); } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/Span.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/Span.cs index ec448d0dc4..b9147e8dac 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/Span.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/Span.cs @@ -5,13 +5,16 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; +using Microsoft.AspNetCore.Razor.Language.Syntax; +using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Razor.Language.Legacy { internal class Span : SyntaxTreeNode { + private static readonly List EmptyTokenList = new List(0); private static readonly int TypeHashCode = typeof(Span).GetHashCode(); + private IReadOnlyList _greenTokens; private string _content; private int? _length; private SourceLocation _start; @@ -24,7 +27,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public ISpanChunkGenerator ChunkGenerator { get; private set; } public SpanKindInternal Kind { get; private set; } - public IReadOnlyList Tokens { get; private set; } + + public IReadOnlyList Tokens { get; private set; } // Allow test code to re-link spans public Span Previous { get; internal set; } @@ -32,7 +36,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public SpanEditHandler EditHandler { get; private set; } - public HtmlNodeSyntax SyntaxNode { get; private set; } + public SyntaxNode SyntaxNode { get; private set; } public override bool IsBlock => false; @@ -96,20 +100,29 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void ReplaceWith(SpanBuilder builder) { Kind = builder.Kind; - Tokens = builder.Tokens; - SyntaxNode = builder.SyntaxNode; - - for (var i = 0; i 0) + { + tokens = new List(); + var currentStart = _start.AbsoluteIndex; + for (var i = 0; i < _greenTokens.Count; i++) + { + var token = new SyntaxToken(_greenTokens[i], parent: SyntaxNode, parentSpan: this, position: currentStart); + tokens.Add(token); + currentStart += token.FullWidth; + } + } + + Tokens = tokens; + Parent?.ChildChanged(); // Since we took references to the values in SpanBuilder, clear its references out @@ -149,8 +162,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy /// public override bool EquivalentTo(SyntaxTreeNode node) { - var other = node as Span; - return other != null && + return node is Span other && Kind.Equals(other.Kind) && Start.Equals(other.Start) && EditHandler.Equals(other.EditHandler) && @@ -165,12 +177,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public override bool Equals(object obj) { - var other = obj as Span; - return other != null && + return obj is Span other && Kind.Equals(other.Kind) && EditHandler.Equals(other.EditHandler) && ChunkGenerator.Equals(other.ChunkGenerator) && - Tokens.SequenceEqual(other.Tokens); + Tokens.SequenceEqual(other.Tokens, SyntaxTokenComparer.Default); } public override int GetHashCode() @@ -189,5 +200,28 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var spanBuilder = new SpanBuilder(this); return spanBuilder.Build(); } + + private class SyntaxTokenComparer : IEqualityComparer + { + public static readonly SyntaxTokenComparer Default = new SyntaxTokenComparer(); + + private SyntaxTokenComparer() + { + } + + public bool Equals(SyntaxToken x, SyntaxToken y) + { + return x.IsEquivalentTo(y); + } + + public int GetHashCode(SyntaxToken obj) + { + var hash = HashCodeCombiner.Start(); + hash.Add(obj.Content, StringComparer.Ordinal); + hash.Add(obj.Kind); + + return hash; + } + } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/SpanBuilder.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/SpanBuilder.cs index 09396a10be..229f5da627 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/SpanBuilder.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/SpanBuilder.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy internal class SpanBuilder { private SourceLocation _start; - private List _tokens; + private List _tokens; private SourceLocationTracker _tracker; public SpanBuilder(Span original) @@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy _start = original.Start; ChunkGenerator = original.ChunkGenerator; - _tokens = new List(original.Tokens); + _tokens = new List(original.Tokens.Select(t =>t.Green)); _tracker = new SourceLocationTracker(original.Start); } @@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Start = location; } - public HtmlNodeSyntax SyntaxNode { get; private set; } + public Syntax.GreenNode SyntaxNode { get; private set; } public ISpanChunkGenerator ChunkGenerator { get; set; } @@ -53,13 +53,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public SpanKindInternal Kind { get; set; } - public IReadOnlyList Tokens + public IReadOnlyList Tokens { get { if (_tokens == null) { - _tokens = new List(); + _tokens = new List(); } return _tokens; @@ -73,9 +73,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Need to potentially allocate a new list because Span.ReplaceWith takes ownership // of the original list. _tokens = null; - _tokens = new List(); + _tokens = new List(); - EditHandler = SpanEditHandler.CreateDefault((content) => Enumerable.Empty()); + EditHandler = SpanEditHandler.CreateDefault((content) => Enumerable.Empty()); ChunkGenerator = SpanChunkGenerator.Null; Start = SourceLocation.Undefined; } @@ -85,12 +85,6 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy SyntaxNode = GetSyntaxNode(syntaxKind); var span = new Span(this); - - for (var i = 0; i < span.Tokens.Count; i++) - { - var token = span.Tokens[i]; - token.Parent = span; - } return span; } @@ -100,7 +94,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy _tokens?.Clear(); } - public void Accept(IToken token) + public void Accept(SyntaxToken token) { if (token == null) { @@ -116,20 +110,20 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy _tracker.UpdateLocation(token.Content); } - private HtmlNodeSyntax GetSyntaxNode(SyntaxKind syntaxKind) + private Syntax.GreenNode GetSyntaxNode(SyntaxKind syntaxKind) { if (syntaxKind == SyntaxKind.HtmlText) { var textTokens = new SyntaxListBuilder(SyntaxListBuilder.Create()); foreach (var token in Tokens) { - if (token.SyntaxKind == SyntaxKind.Unknown) + if (token.Kind == SyntaxKind.Unknown) { - Debug.Assert(false, $"Unexpected html token {((HtmlToken)token).Type}"); + Debug.Assert(false, $"Unexpected token {token.Kind}"); continue; } - textTokens.Add(token.SyntaxToken); + textTokens.Add(token); } var textResult = textTokens.ToList(); return SyntaxFactory.HtmlText(new SyntaxList(textResult.Node)); diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/SpanEditHandler.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/SpanEditHandler.cs index d5407f34dd..321b4d37ce 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/SpanEditHandler.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/SpanEditHandler.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; -using System.Diagnostics; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { @@ -11,12 +11,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { private static readonly int TypeHashCode = typeof(SpanEditHandler).GetHashCode(); - public SpanEditHandler(Func> tokenizer) + public SpanEditHandler(Func> tokenizer) : this(tokenizer, AcceptedCharactersInternal.Any) { } - public SpanEditHandler(Func> tokenizer, AcceptedCharactersInternal accepted) + public SpanEditHandler(Func> tokenizer, AcceptedCharactersInternal accepted) { AcceptedCharacters = accepted; Tokenizer = tokenizer; @@ -24,9 +24,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public AcceptedCharactersInternal AcceptedCharacters { get; set; } - public Func> Tokenizer { get; set; } + public Func> Tokenizer { get; set; } - public static SpanEditHandler CreateDefault(Func> tokenizer) + public static SpanEditHandler CreateDefault(Func> tokenizer) { return new SpanEditHandler(tokenizer); } @@ -116,8 +116,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public override bool Equals(object obj) { - var other = obj as SpanEditHandler; - return other != null && + return obj is SpanEditHandler other && GetType() == other.GetType() && AcceptedCharacters == other.AcceptedCharacters; } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperBlockRewriter.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperBlockRewriter.cs index f08d0579e5..1aea40a746 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperBlockRewriter.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperBlockRewriter.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; +using Microsoft.AspNetCore.Razor.Language.Syntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { @@ -150,7 +151,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; // Will contain tokens that represent a single attribute value: - var htmlTokens = span.Tokens.OfType().ToArray(); + var tokens = span.Tokens; var capturedAttributeValueStart = false; var attributeValueStartLocation = span.Start; @@ -165,9 +166,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Iterate down through the tokens to find the name and the start of the value. // We subtract the tokenOffset so we don't accept an ending quote of a span. - for (var i = 0; i < htmlTokens.Length - tokenOffset; i++) + for (var i = 0; i < tokens.Count - tokenOffset; i++) { - var token = htmlTokens[i]; + var token = tokens[i]; if (afterEquals) { @@ -186,9 +187,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy attributeValueStartLocation = token.Start; } - builder.Accept(token); + builder.Accept(token.Green); } - else if (name == null && HtmlMarkupParser.IsValidAttributeNameToken(token)) + else if (name == null && HtmlMarkupParser.IsValidAttributeNameToken(token.Green)) { // We've captured all leading whitespace prior to the attribute name. // We're now at: " |asp-for='...'" or " |asp-for=..." @@ -196,10 +197,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var nameBuilder = new StringBuilder(); // Move the indexer past the attribute name tokens. - for (var j = i; j < htmlTokens.Length; j++) + for (var j = i; j < tokens.Count; j++) { - var nameToken = htmlTokens[j]; - if (!HtmlMarkupParser.IsValidAttributeNameToken(nameToken)) + var nameToken = tokens[j]; + if (!HtmlMarkupParser.IsValidAttributeNameToken(nameToken.Green)) { break; } @@ -213,7 +214,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy name = nameBuilder.ToString(); attributeValueStartLocation = SourceLocationTracker.Advance(attributeValueStartLocation, name); } - else if (token.Type == HtmlTokenType.Equals) + else if (token.Kind == SyntaxKind.Equals) { // We've captured all leading whitespace and the attribute name. // We're now at: " asp-for|='...'" or " asp-for|=..." @@ -227,19 +228,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy do { i++; // Start from the token after '='. - } while (i < htmlTokens.Length && - (htmlTokens[i].Type == HtmlTokenType.WhiteSpace || - htmlTokens[i].Type == HtmlTokenType.NewLine)); + } while (i < tokens.Count && + (tokens[i].Kind == SyntaxKind.Whitespace || + tokens[i].Kind == SyntaxKind.NewLine)); // Check for attribute start values, aka single or double quote - if (i < htmlTokens.Length && IsQuote(htmlTokens[i])) + if (i < tokens.Count && IsQuote(tokens[i])) { - if (htmlTokens[i].Type == HtmlTokenType.SingleQuote) + if (tokens[i].Kind == SyntaxKind.SingleQuote) { attributeValueStyle = AttributeStructure.SingleQuotes; } - tokenStartLocation = htmlTokens[i].Start; + tokenStartLocation = tokens[i].Start; // If there's a start quote then there must be an end quote to be valid, skip it. tokenOffset = 1; @@ -260,7 +261,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy afterEquals = true; } - else if (token.Type == HtmlTokenType.WhiteSpace) + else if (token.Kind == SyntaxKind.Whitespace) { // We're at the start of the attribute, this branch may be hit on the first iterations of // the loop since the parser separates attributes with their spaces included as tokens. @@ -343,9 +344,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var nameTokens = childSpan .Tokens - .OfType() - .SkipWhile(token => !HtmlMarkupParser.IsValidAttributeNameToken(token)) // Skip prefix - .TakeWhile(nameToken => HtmlMarkupParser.IsValidAttributeNameToken(nameToken)) + .SkipWhile(token => !HtmlMarkupParser.IsValidAttributeNameToken(token.Green)) // Skip prefix + .TakeWhile(nameToken => HtmlMarkupParser.IsValidAttributeNameToken(nameToken.Green)) .Select(nameToken => nameToken.Content); var name = string.Concat(nameTokens); @@ -362,12 +362,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var result = CreateTryParseResult(name, descriptors, processedBoundAttributeNames); var firstChild = builder.Children[0] as Span; - if (firstChild != null && firstChild.Tokens[0] is HtmlToken) + if (firstChild != null) { - var htmlToken = firstChild.Tokens[firstChild.Tokens.Count - 1] as HtmlToken; - switch (htmlToken.Type) + var token = firstChild.Tokens[firstChild.Tokens.Count - 1]; + switch (token.Kind) { - case HtmlTokenType.Equals: + case SyntaxKind.Equals: if (builder.Children.Count == 2 && builder.Children[1] is Span value && value.Kind == SpanKindInternal.Markup) @@ -385,10 +385,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy result.AttributeStructure = AttributeStructure.DoubleQuotes; } break; - case HtmlTokenType.DoubleQuote: + case SyntaxKind.DoubleQuote: result.AttributeStructure = AttributeStructure.DoubleQuotes; break; - case HtmlTokenType.SingleQuote: + case SyntaxKind.SingleQuote: result.AttributeStructure = AttributeStructure.SingleQuotes; break; default: @@ -408,8 +408,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // In some malformed cases e.g.

: ITokenizer - where TTokenType : struct - where TToken : TokenBase + internal abstract class Tokenizer : ITokenizer { protected Tokenizer(ITextDocument source) { @@ -31,7 +30,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected int? CurrentState { get; set; } - protected TToken CurrentToken { get; private set; } + protected SyntaxToken CurrenSyntaxToken { get; private set; } public ITextDocument Source { get; private set; } @@ -42,9 +41,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy get { return Source.Peek() == -1; } } - public abstract TTokenType RazorCommentStarType { get; } - public abstract TTokenType RazorCommentType { get; } - public abstract TTokenType RazorCommentTransitionType { get; } + public abstract SyntaxKind RazorCommentStarKind { get; } + public abstract SyntaxKind RazorCommentKind { get; } + public abstract SyntaxKind RazorCommentTransitionKind { get; } protected bool HaveContent { @@ -64,16 +63,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public SourceLocation CurrentStart { get; private set; } - protected abstract TToken CreateToken(string content, TTokenType type, IReadOnlyList errors); + protected abstract SyntaxToken CreateToken(string content, SyntaxKind type, IReadOnlyList errors); protected abstract StateResult Dispatch(); - IToken ITokenizer.NextToken() + SyntaxToken ITokenizer.NextToken() { return NextToken(); } - public virtual TToken NextToken() + public virtual SyntaxToken NextToken() { // Post-Condition: Buffer should be empty at the start of Next() Debug.Assert(Buffer.Length == 0); @@ -95,7 +94,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return token; } - protected virtual TToken Turn() + protected virtual SyntaxToken Turn() { if (CurrentState != null) { @@ -105,19 +104,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var next = Dispatch(); CurrentState = next.State; - CurrentToken = next.Result; + CurrenSyntaxToken = next.Result; } - while (CurrentState != null && CurrentToken == null); + while (CurrentState != null && CurrenSyntaxToken == null); if (CurrentState == null) { - return default(TToken); // Terminated + return default(SyntaxToken); // Terminated } - return CurrentToken; + return CurrenSyntaxToken; } - return default(TToken); + return default(SyntaxToken); } public void Reset() @@ -149,7 +148,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy /// Returns a result containing the specified output and indicating that the next call to /// should invoke the provided state. /// - protected StateResult Transition(int state, TToken result) + protected StateResult Transition(int state, SyntaxToken result) { return new StateResult(state, result); } @@ -159,7 +158,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return new StateResult((int)state, result: null); } - protected StateResult Transition(RazorCommentTokenizerState state, TToken result) + protected StateResult Transition(RazorCommentTokenizerState state, SyntaxToken result) { return new StateResult((int)state, result); } @@ -180,12 +179,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy /// Returns a result containing the specified output and indicating that the next call to /// should re-invoke the current state. /// - protected StateResult Stay(TToken result) + protected StateResult Stay(SyntaxToken result) { return new StateResult(CurrentState, result); } - protected TToken Single(TTokenType type) + protected SyntaxToken Single(SyntaxKind type) { TakeCurrent(); return EndToken(type); @@ -199,9 +198,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy CurrentStart = CurrentLocation; } - protected TToken EndToken(TTokenType type) + protected SyntaxToken EndToken(SyntaxKind type) { - TToken token = null; + SyntaxToken token = null; if (HaveContent) { // Perf: Don't allocate a new errors array unless necessary. @@ -222,7 +221,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return token; } - protected virtual string GetTokenContent(TTokenType type) + protected virtual string GetTokenContent(SyntaxKind type) { return Buffer.ToString(); } @@ -278,7 +277,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy AssertCurrent('*'); TakeCurrent(); - return Transition(1002, EndToken(RazorCommentStarType)); + return Transition(1002, EndToken(RazorCommentStarKind)); } protected StateResult RazorCommentBody() @@ -292,7 +291,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { return Transition( RazorCommentTokenizerState.StarAfterRazorCommentBody, - EndToken(RazorCommentType)); + EndToken(RazorCommentKind)); } else { @@ -306,7 +305,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - return Transition(StartState, EndToken(RazorCommentType)); + return Transition(StartState, EndToken(RazorCommentKind)); } protected StateResult StarAfterRazorCommentBody() @@ -315,14 +314,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy TakeCurrent(); return Transition( RazorCommentTokenizerState.AtTokenAfterRazorCommentBody, - EndToken(RazorCommentStarType)); + EndToken(RazorCommentStarKind)); } protected StateResult AtTokenAfterRazorCommentBody() { AssertCurrent('@'); TakeCurrent(); - return Transition(StartState, EndToken(RazorCommentTransitionType)); + return Transition(StartState, EndToken(RazorCommentTransitionKind)); } ///

@@ -397,7 +396,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected struct StateResult { - public StateResult(int? state, TToken result) + public StateResult(int? state, SyntaxToken result) { State = state; Result = result; @@ -405,7 +404,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public int? State { get; } - public TToken Result { get; } + public SyntaxToken Result { get; } } private static LookaheadToken BeginLookahead(ITextBuffer buffer) diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TokenizerBackedParser.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TokenizerBackedParser.cs index f7b054ecff..5168dbe79c 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TokenizerBackedParser.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TokenizerBackedParser.cs @@ -9,20 +9,18 @@ using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; namespace Microsoft.AspNetCore.Razor.Language.Legacy { - internal abstract partial class TokenizerBackedParser : ParserBase - where TTokenType : struct - where TTokenizer : Tokenizer - where TToken : TokenBase + internal abstract class TokenizerBackedParser : ParserBase + where TTokenizer : Tokenizer { - private readonly TokenizerView _tokenizer; + private readonly TokenizerView _tokenizer; - protected TokenizerBackedParser(LanguageCharacteristics language, ParserContext context) + protected TokenizerBackedParser(LanguageCharacteristics language, ParserContext context) : base(context) { Language = language; var languageTokenizer = Language.CreateTokenizer(Context.Source); - _tokenizer = new TokenizerView(languageTokenizer); + _tokenizer = new TokenizerView(languageTokenizer); Span = new SpanBuilder(CurrentLocation); } @@ -32,14 +30,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected Action SpanConfig { get; set; } - protected TToken CurrentToken + protected SyntaxToken CurrentToken { get { return _tokenizer.Current; } } - protected SyntaxToken CurrentSyntaxToken => CurrentToken?.SyntaxToken; - - protected TToken PreviousToken { get; private set; } + protected SyntaxToken PreviousToken { get; private set; } protected SourceLocation CurrentLocation => _tokenizer.Tokenizer.CurrentLocation; @@ -50,7 +46,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy get { return _tokenizer.EndOfFile; } } - protected LanguageCharacteristics Language { get; } + protected LanguageCharacteristics Language { get; } protected virtual void HandleEmbeddedTransition() { @@ -63,21 +59,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public override void BuildSpan(SpanBuilder span, SourceLocation start, string content) { - foreach (IToken sym in Language.TokenizeString(start, content)) + foreach (var token in Language.TokenizeString(start, content)) { - span.Accept(sym); + span.Accept(token); } } protected void Initialize(SpanBuilder span) { - if (SpanConfig != null) - { - SpanConfig(span); - } + SpanConfig?.Invoke(span); } - protected TToken Lookahead(int count) + protected SyntaxToken Lookahead(int count) { if (count < 0) { @@ -89,7 +82,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } // We add 1 in order to store the current token. - var tokens = new TToken[count + 1]; + var tokens = new SyntaxToken[count + 1]; var currentToken = CurrentToken; tokens[0] = currentToken; @@ -120,7 +113,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy /// A predicate accepting the token being evaluated and the list of tokens which have been looped through. /// true, if the condition was met. false - if the condition wasn't met and the last token has already been processed. /// The list of previous tokens is passed in the reverse order. So the last processed element will be the first one in the list. - protected bool LookaheadUntil(Func, bool> condition) + protected bool LookaheadUntil(Func, bool> condition) { if (condition == null) { @@ -129,7 +122,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var matchFound = false; - var tokens = new List(); + var tokens = new List(); tokens.Add(CurrentToken); while (true) @@ -168,14 +161,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Helpers [Conditional("DEBUG")] - internal void Assert(TTokenType expectedType) + internal void Assert(SyntaxKind expectedType) { - Debug.Assert(!EndOfFile && TokenTypeEquals(CurrentToken.Type, expectedType)); + Debug.Assert(!EndOfFile && TokenKindEquals(CurrentToken.Kind, expectedType)); } - abstract protected bool TokenTypeEquals(TTokenType x, TTokenType y); + protected abstract bool TokenKindEquals(SyntaxKind x, SyntaxKind y); - protected internal void PutBack(TToken token) + protected internal void PutBack(SyntaxToken token) { if (token != null) { @@ -185,7 +178,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy /// /// Put the specified tokens back in the input stream. The provided list MUST be in the ORDER THE TOKENS WERE READ. The - /// list WILL be reversed and the Putback(TToken) will be called on each item. + /// list WILL be reversed and the Putback(SyntaxToken) will be called on each item. /// /// /// If a document contains tokens: a, b, c, d, e, f @@ -194,9 +187,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy /// that is the correct format for providing to this method. The caller of this method would, /// in that case, want to put c, b and a back into the stream, so "a, b, c" is the CORRECT order /// - protected internal void PutBack(IEnumerable tokens) + protected internal void PutBack(IEnumerable tokens) { - foreach (TToken token in tokens.Reverse()) + foreach (var token in tokens.Reverse()) { PutBack(token); } @@ -212,7 +205,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected internal bool Balance(BalancingModes mode) { - var left = CurrentToken.Type; + var left = CurrentToken.Kind; var right = Language.FlipBracket(left); var start = CurrentStart; AcceptAndMoveNext(); @@ -228,21 +221,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return Balance(mode, left, right, start); } - protected internal bool Balance(BalancingModes mode, TTokenType left, TTokenType right, SourceLocation start) + protected internal bool Balance(BalancingModes mode, SyntaxKind left, SyntaxKind right, SourceLocation start) { var startPosition = CurrentStart.AbsoluteIndex; var nesting = 1; if (!EndOfFile) { - var syms = new List(); + var tokens = new List(); do { if (IsAtEmbeddedTransition( (mode & BalancingModes.AllowCommentsAndTemplates) == BalancingModes.AllowCommentsAndTemplates, (mode & BalancingModes.AllowEmbeddedTransitions) == BalancingModes.AllowEmbeddedTransitions)) { - Accept(syms); - syms.Clear(); + Accept(tokens); + tokens.Clear(); HandleEmbeddedTransition(); // Reset backtracking since we've already outputted some spans. @@ -258,7 +251,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } if (nesting > 0) { - syms.Add(CurrentToken); + tokens.Add(CurrentToken); } } while (nesting > 0 && NextToken()); @@ -280,29 +273,29 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } else { - Accept(syms); + Accept(tokens); } } else { // Accept all the tokens we saw - Accept(syms); + Accept(tokens); } } return nesting == 0; } - protected internal bool NextIs(TTokenType type) + protected internal bool NextIs(SyntaxKind type) { - return NextIs(sym => sym != null && TokenTypeEquals(type, sym.Type)); + return NextIs(token => token != null && TokenKindEquals(type, token.Kind)); } - protected internal bool NextIs(params TTokenType[] types) + protected internal bool NextIs(params SyntaxKind[] types) { - return NextIs(sym => sym != null && types.Any(t => TokenTypeEquals(t, sym.Type))); + return NextIs(token => token != null && types.Any(t => TokenKindEquals(t, token.Kind))); } - protected internal bool NextIs(Func condition) + protected internal bool NextIs(Func condition) { var cur = CurrentToken; if (NextToken()) @@ -322,14 +315,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return false; } - protected internal bool Was(TTokenType type) + protected internal bool Was(SyntaxKind type) { - return PreviousToken != null && TokenTypeEquals(PreviousToken.Type, type); + return PreviousToken != null && TokenKindEquals(PreviousToken.Kind, type); } - protected internal bool At(TTokenType type) + protected internal bool At(SyntaxKind type) { - return !EndOfFile && CurrentToken != null && TokenTypeEquals(CurrentToken.Type, type); + return !EndOfFile && CurrentToken != null && TokenKindEquals(CurrentToken.Kind, type); } protected internal bool AcceptAndMoveNext() @@ -338,11 +331,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return NextToken(); } - protected TToken AcceptSingleWhiteSpaceCharacter() + protected SyntaxToken AcceptSingleWhiteSpaceCharacter() { if (Language.IsWhiteSpace(CurrentToken)) { - Tuple pair = Language.SplitToken(CurrentToken, 1, Language.GetKnownTokenType(KnownTokenType.WhiteSpace)); + var pair = Language.SplitToken(CurrentToken, 1, Language.GetKnownTokenType(KnownTokenType.WhiteSpace)); Accept(pair.Item1); Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.None; NextToken(); @@ -351,19 +344,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return null; } - protected internal void Accept(IEnumerable tokens) + protected internal void Accept(IEnumerable tokens) { - foreach (TToken token in tokens) + foreach (var token in tokens) { Accept(token); } } - protected internal void Accept(TToken token) + protected internal void Accept(SyntaxToken token) { if (token != null) { - foreach (var error in token.Errors) + foreach (var error in token.GetDiagnostics()) { Context.ErrorSink.OnError(error); } @@ -372,11 +365,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - protected internal bool AcceptAll(params TTokenType[] types) + protected internal bool AcceptAll(params SyntaxKind[] kinds) { - foreach (TTokenType type in types) + foreach (var kind in kinds) { - if (CurrentToken == null || !TokenTypeEquals(CurrentToken.Type, type)) + if (CurrentToken == null || !TokenKindEquals(CurrentToken.Kind, kind)) { return false; } @@ -442,7 +435,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected IDisposable PushSpanConfig(Action> newConfig) { - Action old = SpanConfig; + var old = SpanConfig; ConfigureSpan(newConfig); return new DisposableAction(() => SpanConfig = old); } @@ -455,7 +448,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy protected void ConfigureSpan(Action> config) { - Action prev = SpanConfig; + var prev = SpanConfig; if (config == null) { SpanConfig = null; @@ -472,9 +465,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Expected(Language.GetKnownTokenType(type)); } - protected internal void Expected(params TTokenType[] types) + protected internal void Expected(params SyntaxKind[] types) { - Debug.Assert(!EndOfFile && CurrentToken != null && types.Contains(CurrentToken.Type)); + Debug.Assert(!EndOfFile && CurrentToken != null && types.Contains(CurrentToken.Kind)); AcceptAndMoveNext(); } @@ -483,7 +476,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return Optional(Language.GetKnownTokenType(type)); } - protected internal bool Optional(TTokenType type) + protected internal bool Optional(SyntaxKind type) { if (At(type)) { @@ -503,61 +496,61 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return true; } - protected internal void AcceptWhile(TTokenType type) + protected internal void AcceptWhile(SyntaxKind type) { - AcceptWhile(sym => TokenTypeEquals(type, sym.Type)); + AcceptWhile(token => TokenKindEquals(type, token.Kind)); } // We want to avoid array allocations and enumeration where possible, so we use the same technique as string.Format - protected internal void AcceptWhile(TTokenType type1, TTokenType type2) + protected internal void AcceptWhile(SyntaxKind type1, SyntaxKind type2) { - AcceptWhile(sym => TokenTypeEquals(type1, sym.Type) || TokenTypeEquals(type2, sym.Type)); + AcceptWhile(token => TokenKindEquals(type1, token.Kind) || TokenKindEquals(type2, token.Kind)); } - protected internal void AcceptWhile(TTokenType type1, TTokenType type2, TTokenType type3) + protected internal void AcceptWhile(SyntaxKind type1, SyntaxKind type2, SyntaxKind type3) { - AcceptWhile(sym => TokenTypeEquals(type1, sym.Type) || TokenTypeEquals(type2, sym.Type) || TokenTypeEquals(type3, sym.Type)); + AcceptWhile(token => TokenKindEquals(type1, token.Kind) || TokenKindEquals(type2, token.Kind) || TokenKindEquals(type3, token.Kind)); } - protected internal void AcceptWhile(params TTokenType[] types) + protected internal void AcceptWhile(params SyntaxKind[] types) { - AcceptWhile(sym => types.Any(expected => TokenTypeEquals(expected, sym.Type))); + AcceptWhile(token => types.Any(expected => TokenKindEquals(expected, token.Kind))); } - protected internal void AcceptUntil(TTokenType type) + protected internal void AcceptUntil(SyntaxKind type) { - AcceptWhile(sym => !TokenTypeEquals(type, sym.Type)); + AcceptWhile(token => !TokenKindEquals(type, token.Kind)); } // We want to avoid array allocations and enumeration where possible, so we use the same technique as string.Format - protected internal void AcceptUntil(TTokenType type1, TTokenType type2) + protected internal void AcceptUntil(SyntaxKind type1, SyntaxKind type2) { - AcceptWhile(sym => !TokenTypeEquals(type1, sym.Type) && !TokenTypeEquals(type2, sym.Type)); + AcceptWhile(token => !TokenKindEquals(type1, token.Kind) && !TokenKindEquals(type2, token.Kind)); } - protected internal void AcceptUntil(TTokenType type1, TTokenType type2, TTokenType type3) + protected internal void AcceptUntil(SyntaxKind type1, SyntaxKind type2, SyntaxKind type3) { - AcceptWhile(sym => !TokenTypeEquals(type1, sym.Type) && !TokenTypeEquals(type2, sym.Type) && !TokenTypeEquals(type3, sym.Type)); + AcceptWhile(token => !TokenKindEquals(type1, token.Kind) && !TokenKindEquals(type2, token.Kind) && !TokenKindEquals(type3, token.Kind)); } - protected internal void AcceptUntil(params TTokenType[] types) + protected internal void AcceptUntil(params SyntaxKind[] types) { - AcceptWhile(sym => types.All(expected => !TokenTypeEquals(expected, sym.Type))); + AcceptWhile(token => types.All(expected => !TokenKindEquals(expected, token.Kind))); } - protected internal void AcceptWhile(Func condition) + protected internal void AcceptWhile(Func condition) { Accept(ReadWhileLazy(condition)); } - protected internal IEnumerable ReadWhile(Func condition) + protected internal IEnumerable ReadWhile(Func condition) { return ReadWhileLazy(condition).ToList(); } - protected TToken AcceptWhiteSpaceInLines() + protected SyntaxToken AcceptWhiteSpaceInLines() { - TToken lastWs = null; + SyntaxToken lastWs = null; while (Language.IsWhiteSpace(CurrentToken) || Language.IsNewLine(CurrentToken)) { // Capture the previous whitespace node @@ -591,7 +584,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Don't open this to sub classes because it's lazy but it looks eager. // You have to advance the Enumerable to read the next characters. - internal IEnumerable ReadWhileLazy(Func condition) + internal IEnumerable ReadWhileLazy(Func condition) { while (EnsureCurrent() && condition(CurrentToken)) { diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TokenizerView.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TokenizerView.cs index 2b290bda5c..ef481af1ac 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TokenizerView.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TokenizerView.cs @@ -1,12 +1,12 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; + namespace Microsoft.AspNetCore.Razor.Language.Legacy { - internal class TokenizerView - where TTokenType : struct - where TTokenizer : Tokenizer - where TToken : TokenBase + internal class TokenizerView + where TTokenizer : Tokenizer { public TokenizerView(TTokenizer tokenizer) { @@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public TTokenizer Tokenizer { get; private set; } public bool EndOfFile { get; private set; } - public TToken Current { get; private set; } + public SyntaxToken Current { get; private set; } public ITextDocument Source { @@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return !EndOfFile; } - public void PutBack(TToken token) + public void PutBack(SyntaxToken token) { Source.Position -= token.Content.Length; Current = null; diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/GreenNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/GreenNode.cs index e90374ad2b..e14cbc0594 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/GreenNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Syntax/GreenNode.cs @@ -377,6 +377,70 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax } #endregion + #region Equivalence + public virtual bool IsEquivalentTo(GreenNode other) + { + if (this == other) + { + return true; + } + + if (other == null) + { + return false; + } + + return EquivalentToInternal(this, other); + } + + private static bool EquivalentToInternal(GreenNode node1, GreenNode node2) + { + if (node1.Kind != node2.Kind) + { + // A single-element list is usually represented as just a single node, + // but can be represented as a List node with one child. Move to that + // child if necessary. + if (node1.IsList && node1.SlotCount == 1) + { + node1 = node1.GetSlot(0); + } + + if (node2.IsList && node2.SlotCount == 1) + { + node2 = node2.GetSlot(0); + } + + if (node1.Kind != node2.Kind) + { + return false; + } + } + + if (node1.FullWidth != node2.FullWidth) + { + return false; + } + + var n = node1.SlotCount; + if (n != node2.SlotCount) + { + return false; + } + + for (var i = 0; i < n; i++) + { + var node1Child = node1.GetSlot(i); + var node2Child = node2.GetSlot(i); + if (node1Child != null && node2Child != null && !node1Child.IsEquivalentTo(node2Child)) + { + return false; + } + } + + return true; + } + #endregion + #region Factories public virtual GreenNode CreateList(IEnumerable nodes, bool alwaysCreateListNode = false) { diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/HtmlTextTokenSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/HtmlTextTokenSyntax.cs deleted file mode 100644 index 9130b5c5d4..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/HtmlTextTokenSyntax.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax -{ - internal class HtmlTextTokenSyntax : SyntaxToken - { - internal HtmlTextTokenSyntax(GreenNode green, SyntaxNode parent, int position) - : base(green, parent, position) - { - } - - internal new InternalSyntax.HtmlTextTokenSyntax Green => (InternalSyntax.HtmlTextTokenSyntax)base.Green; - - public string Value => Text; - - internal override SyntaxToken WithLeadingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.HtmlTextTokenSyntax(Text, trivia?.Green, GetTrailingTrivia().Node?.Green).CreateRed(Parent, Position) as HtmlTextTokenSyntax; - } - - internal override SyntaxToken WithTrailingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.HtmlTextTokenSyntax(Text, GetLeadingTrivia().Node?.Green, trivia?.Green).CreateRed(Parent, Position) as HtmlTextTokenSyntax; - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/HtmlTextTokenSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/HtmlTextTokenSyntax.cs deleted file mode 100644 index 68d6eecd97..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/HtmlTextTokenSyntax.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax -{ - internal class HtmlTextTokenSyntax : SyntaxToken - { - internal HtmlTextTokenSyntax(string text, params RazorDiagnostic[] diagnostics) - : base(SyntaxKind.HtmlTextLiteralToken, text, null, null, diagnostics, null) - { - } - - internal HtmlTextTokenSyntax(string text, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(SyntaxKind.HtmlTextLiteralToken, text, leadingTrivia, trailingTrivia) - { - } - - protected HtmlTextTokenSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(kind, name, leadingTrivia, trailingTrivia) - { - } - - protected HtmlTextTokenSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia, RazorDiagnostic[] diagnostics, SyntaxAnnotation[] annotations) - : base(kind, name, leadingTrivia, trailingTrivia, diagnostics, annotations) - { - } - - internal override SyntaxNode CreateRed(SyntaxNode parent, int position) - { - return new Syntax.HtmlTextTokenSyntax(this, parent, position); - } - - public override SyntaxToken TokenWithLeadingTrivia(GreenNode trivia) - { - return new HtmlTextTokenSyntax(Kind, Text, trivia, TrailingTrivia); - } - - public override SyntaxToken TokenWithTrailingTrivia(GreenNode trivia) - { - return new HtmlTextTokenSyntax(Kind, Text, LeadingTrivia, trivia); - } - - internal override GreenNode SetDiagnostics(RazorDiagnostic[] diagnostics) - { - return new HtmlTextTokenSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, diagnostics, GetAnnotations()); - } - - internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations) - { - return new HtmlTextTokenSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, GetDiagnostics(), annotations); - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/NewLineTokenSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/NewLineTokenSyntax.cs deleted file mode 100644 index 97d47e9fb9..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/NewLineTokenSyntax.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax -{ - internal class NewLineTokenSyntax : SyntaxToken - { - internal NewLineTokenSyntax(string text, params RazorDiagnostic[] diagnostics) - : base(SyntaxKind.NewLine, text, null, null, diagnostics, null) - { - } - - internal NewLineTokenSyntax(string text, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(SyntaxKind.NewLine, text, leadingTrivia, trailingTrivia) - { - } - - protected NewLineTokenSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(kind, name, leadingTrivia, trailingTrivia) - { - } - - protected NewLineTokenSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia, RazorDiagnostic[] diagnostics, SyntaxAnnotation[] annotations) - : base(kind, name, leadingTrivia, trailingTrivia, diagnostics, annotations) - { - } - - internal override SyntaxNode CreateRed(SyntaxNode parent, int position) => new Syntax.NewLineTokenSyntax(this, parent, position); - - public override SyntaxToken TokenWithLeadingTrivia(GreenNode trivia) - { - return new NewLineTokenSyntax(Kind, Text, trivia, TrailingTrivia); - } - - public override SyntaxToken TokenWithTrailingTrivia(GreenNode trivia) - { - return new NewLineTokenSyntax(Kind, Text, LeadingTrivia, trivia); - } - - internal override GreenNode SetDiagnostics(RazorDiagnostic[] diagnostics) - { - return new NewLineTokenSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, diagnostics, GetAnnotations()); - } - - internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations) - { - return new NewLineTokenSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, GetDiagnostics(), annotations); - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/PunctuationSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/PunctuationSyntax.cs deleted file mode 100644 index 0c2bb06b61..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/PunctuationSyntax.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax -{ - internal class PunctuationSyntax : SyntaxToken - { - internal PunctuationSyntax(SyntaxKind kind, string name, RazorDiagnostic[] diagnostics) - : this(kind, name, null, null, diagnostics, null) - { - } - - internal PunctuationSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia) - : this(kind, name, leadingTrivia, trailingTrivia, null, null) - { - } - - internal PunctuationSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia, RazorDiagnostic[] diagnostics, SyntaxAnnotation[] annotations) - : base(kind, name, leadingTrivia, trailingTrivia, diagnostics, annotations) - { - } - - internal override SyntaxNode CreateRed(SyntaxNode parent, int position) => new Syntax.PunctuationSyntax(this, parent, position); - - public override SyntaxToken TokenWithLeadingTrivia(GreenNode trivia) - { - return new PunctuationSyntax(Kind, Text, trivia, TrailingTrivia); - } - - public override SyntaxToken TokenWithTrailingTrivia(GreenNode trivia) - { - return new PunctuationSyntax(Kind, Text, LeadingTrivia, trivia); - } - - internal override GreenNode SetDiagnostics(RazorDiagnostic[] diagnostics) - { - return new PunctuationSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, diagnostics, GetAnnotations()); - } - - internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations) - { - return new PunctuationSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, GetDiagnostics(), annotations); - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxFactory.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxFactory.cs index a6f5ce2e1f..78b7f447d2 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxFactory.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxFactory.cs @@ -1,6 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Collections.Generic; +using System.Linq; + namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax { internal static class SyntaxFactory @@ -10,29 +13,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax return new HtmlTextSyntax(textTokens.Node); } - internal static HtmlTextTokenSyntax HtmlTextToken(string text, params RazorDiagnostic[] diagnostics) + internal static SyntaxToken Token(SyntaxKind kind, string content, IEnumerable diagnostics) { - return new HtmlTextTokenSyntax(text, diagnostics); + return Token(kind, content, diagnostics.ToArray()); } - internal static WhitespaceTokenSyntax WhitespaceToken(string text, params RazorDiagnostic[] diagnostics) + internal static SyntaxToken Token(SyntaxKind kind, string content, params RazorDiagnostic[] diagnostics) { - return new WhitespaceTokenSyntax(text, diagnostics); - } - - internal static NewLineTokenSyntax NewLineToken(string text, params RazorDiagnostic[] diagnostics) - { - return new NewLineTokenSyntax(text, diagnostics); - } - - internal static PunctuationSyntax Punctuation(SyntaxKind syntaxKind, string text, params RazorDiagnostic[] diagnostics) - { - return new PunctuationSyntax(syntaxKind, text, diagnostics); - } - - internal static UnknownTokenSyntax UnknownToken(string text, params RazorDiagnostic[] diagnostics) - { - return new UnknownTokenSyntax(text, diagnostics); + return new SyntaxToken(kind, content, diagnostics); } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxToken.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxToken.cs index d9167704b5..b7471591c8 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxToken.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxToken.cs @@ -4,32 +4,39 @@ using System; using System.Collections.Generic; using System.IO; +using Microsoft.AspNetCore.Razor.Language.Legacy; namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax { - internal abstract class SyntaxToken : GreenNode + internal class SyntaxToken : GreenNode { - internal SyntaxToken(SyntaxKind tokenKind, string text, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(tokenKind, text.Length) + internal SyntaxToken(SyntaxKind kind, string content, RazorDiagnostic[] diagnostics) + : base(kind, content.Length, diagnostics, annotations: null) { - Text = text; + Content = content; + } + + internal SyntaxToken(SyntaxKind kind, string content, GreenNode leadingTrivia, GreenNode trailingTrivia) + : base(kind, content.Length) + { + Content = content; LeadingTrivia = leadingTrivia; AdjustFlagsAndWidth(leadingTrivia); TrailingTrivia = trailingTrivia; AdjustFlagsAndWidth(trailingTrivia); } - internal SyntaxToken(SyntaxKind tokenKind, string text, GreenNode leadingTrivia, GreenNode trailingTrivia, RazorDiagnostic[] diagnostics, SyntaxAnnotation[] annotations) - : base(tokenKind, text.Length, diagnostics, annotations) + internal SyntaxToken(SyntaxKind kind, string content, GreenNode leadingTrivia, GreenNode trailingTrivia, RazorDiagnostic[] diagnostics, SyntaxAnnotation[] annotations) + : base(kind, content.Length, diagnostics, annotations) { - Text = text; + Content = content; LeadingTrivia = leadingTrivia; AdjustFlagsAndWidth(leadingTrivia); TrailingTrivia = trailingTrivia; AdjustFlagsAndWidth(trailingTrivia); } - public string Text { get; } + public string Content { get; } public GreenNode LeadingTrivia { get; } @@ -37,7 +44,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax internal override bool IsToken => true; - public override int Width => Text.Length; + public override int Width => Content.Length; + + internal override SyntaxNode CreateRed(SyntaxNode parent, int position) + { + return new Syntax.SyntaxToken(this, parent, position); + } protected override void WriteTokenTo(TextWriter writer, bool leading, bool trailing) { @@ -50,7 +62,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax } } - writer.Write(Text); + writer.Write(Content); if (trailing) { @@ -87,14 +99,30 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax return TokenWithLeadingTrivia(trivia); } - public abstract SyntaxToken TokenWithLeadingTrivia(GreenNode trivia); + public virtual SyntaxToken TokenWithLeadingTrivia(GreenNode trivia) + { + return new SyntaxToken(Kind, Content, trivia, TrailingTrivia, GetDiagnostics(), GetAnnotations()); + } public sealed override GreenNode WithTrailingTrivia(GreenNode trivia) { return TokenWithTrailingTrivia(trivia); } - public abstract SyntaxToken TokenWithTrailingTrivia(GreenNode trivia); + public virtual SyntaxToken TokenWithTrailingTrivia(GreenNode trivia) + { + return new SyntaxToken(Kind, Content, LeadingTrivia, trivia, GetDiagnostics(), GetAnnotations()); + } + + internal override GreenNode SetDiagnostics(RazorDiagnostic[] diagnostics) + { + return new SyntaxToken(Kind, Content, LeadingTrivia, TrailingTrivia, diagnostics, GetAnnotations()); + } + + internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations) + { + return new SyntaxToken(Kind, Content, LeadingTrivia, TrailingTrivia, GetDiagnostics(), annotations); + } protected override sealed int GetSlotCount() { @@ -103,7 +131,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax internal override sealed GreenNode GetSlot(int index) { - throw new InvalidOperationException(); + throw new InvalidOperationException("Tokens don't have slots."); } internal override GreenNode Accept(SyntaxVisitor visitor) @@ -111,9 +139,56 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax return visitor.VisitSyntaxToken(this); } + public override bool IsEquivalentTo(GreenNode other) + { + if (!base.IsEquivalentTo(other)) + { + return false; + } + + var otherToken = (SyntaxToken)other; + + if (Content != otherToken.Content) + { + return false; + } + + var thisLeading = GetLeadingTrivia(); + var otherLeading = otherToken.GetLeadingTrivia(); + if (thisLeading != otherLeading) + { + if (thisLeading == null || otherLeading == null) + { + return false; + } + + if (!thisLeading.IsEquivalentTo(otherLeading)) + { + return false; + } + } + + var thisTrailing = GetTrailingTrivia(); + var otherTrailing = otherToken.GetTrailingTrivia(); + if (thisTrailing != otherTrailing) + { + if (thisTrailing == null || otherTrailing == null) + { + return false; + } + + if (!thisTrailing.IsEquivalentTo(otherTrailing)) + { + return false; + } + } + + return true; + } + public override string ToString() { - return Text; + return Content; } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxTrivia.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxTrivia.cs index 6618b20c69..53867dc274 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxTrivia.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/SyntaxTrivia.cs @@ -76,5 +76,20 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax { return new SyntaxTrivia(Kind, Text, GetDiagnostics(), annotations); } + + public override bool IsEquivalentTo(GreenNode other) + { + if (!base.IsEquivalentTo(other)) + { + return false; + } + + if (Text != ((SyntaxTrivia)other).Text) + { + return false; + } + + return true; + } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/UnknownTokenSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/UnknownTokenSyntax.cs deleted file mode 100644 index 4c6cd4608b..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/UnknownTokenSyntax.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax -{ - internal class UnknownTokenSyntax : SyntaxToken - { - internal UnknownTokenSyntax(string text, params RazorDiagnostic[] diagnostics) - : base(SyntaxKind.Unknown, text, null, null, diagnostics, null) - { - } - - internal UnknownTokenSyntax(string text, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(SyntaxKind.Unknown, text, leadingTrivia, trailingTrivia) - { - } - - protected UnknownTokenSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(kind, name, leadingTrivia, trailingTrivia) - { - } - - protected UnknownTokenSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia, RazorDiagnostic[] diagnostics, SyntaxAnnotation[] annotations) - : base(kind, name, leadingTrivia, trailingTrivia, diagnostics, annotations) - { - } - - internal override SyntaxNode CreateRed(SyntaxNode parent, int position) => new Syntax.UnknownTokenSyntax(this, parent, position); - - public override SyntaxToken TokenWithLeadingTrivia(GreenNode trivia) - { - return new UnknownTokenSyntax(Kind, Text, trivia, TrailingTrivia); - } - - public override SyntaxToken TokenWithTrailingTrivia(GreenNode trivia) - { - return new UnknownTokenSyntax(Kind, Text, LeadingTrivia, trivia); - } - - internal override GreenNode SetDiagnostics(RazorDiagnostic[] diagnostics) - { - return new UnknownTokenSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, diagnostics, GetAnnotations()); - } - - internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations) - { - return new UnknownTokenSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, GetDiagnostics(), annotations); - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/WhitespaceTokenSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/WhitespaceTokenSyntax.cs deleted file mode 100644 index b576b60e3a..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/InternalSyntax/WhitespaceTokenSyntax.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax -{ - internal class WhitespaceTokenSyntax : SyntaxToken - { - internal WhitespaceTokenSyntax(string text, params RazorDiagnostic[] diagnostics) - : base(SyntaxKind.Whitespace, text, null, null, diagnostics, null) - { - } - - internal WhitespaceTokenSyntax(string text, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(SyntaxKind.Whitespace, text, leadingTrivia, trailingTrivia) - { - } - - protected WhitespaceTokenSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia) - : base(kind, name, leadingTrivia, trailingTrivia) - { - } - - protected WhitespaceTokenSyntax(SyntaxKind kind, string name, GreenNode leadingTrivia, GreenNode trailingTrivia, RazorDiagnostic[] diagnostics, SyntaxAnnotation[] annotations) - : base(kind, name, leadingTrivia, trailingTrivia, diagnostics, annotations) - { - } - - internal override SyntaxNode CreateRed(SyntaxNode parent, int position) => new Syntax.WhitespaceTokenSyntax(this, parent, position); - - public override SyntaxToken TokenWithLeadingTrivia(GreenNode trivia) - { - return new WhitespaceTokenSyntax(Kind, Text, trivia, TrailingTrivia); - } - - public override SyntaxToken TokenWithTrailingTrivia(GreenNode trivia) - { - return new WhitespaceTokenSyntax(Kind, Text, LeadingTrivia, trivia); - } - - internal override GreenNode SetDiagnostics(RazorDiagnostic[] diagnostics) - { - return new WhitespaceTokenSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, diagnostics, GetAnnotations()); - } - - internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations) - { - return new WhitespaceTokenSyntax(Kind, Text, LeadingTrivia, TrailingTrivia, GetDiagnostics(), annotations); - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/NewLineTokenSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/NewLineTokenSyntax.cs deleted file mode 100644 index d164f069e9..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/NewLineTokenSyntax.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax -{ - internal class NewLineTokenSyntax : SyntaxToken - { - internal NewLineTokenSyntax(GreenNode green, SyntaxNode parent, int position) - : base(green, parent, position) - { - } - - internal new InternalSyntax.NewLineTokenSyntax Green => (InternalSyntax.NewLineTokenSyntax)base.Green; - - public string Value => Text; - - internal override SyntaxToken WithLeadingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.NewLineTokenSyntax(Text, trivia?.Green, GetTrailingTrivia().Node?.Green).CreateRed(Parent, Position) as NewLineTokenSyntax; - } - - internal override SyntaxToken WithTrailingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.NewLineTokenSyntax(Text, GetLeadingTrivia().Node?.Green, trivia?.Green).CreateRed(Parent, Position) as NewLineTokenSyntax; - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/PunctuationSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/PunctuationSyntax.cs deleted file mode 100644 index 0f25740ecd..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/PunctuationSyntax.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax -{ - internal class PunctuationSyntax : SyntaxToken - { - internal PunctuationSyntax(GreenNode green, SyntaxNode parent, int position) - : base(green, parent, position) - { - } - - internal new InternalSyntax.PunctuationSyntax Green => (InternalSyntax.PunctuationSyntax)base.Green; - - public string Punctuation => Text; - - internal override SyntaxToken WithLeadingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.PunctuationSyntax(Kind, Text, trivia?.Green, GetTrailingTrivia().Node?.Green).CreateRed(Parent, Position) as PunctuationSyntax; - } - - internal override SyntaxToken WithTrailingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.PunctuationSyntax(Kind, Text, GetLeadingTrivia().Node?.Green, trivia?.Green).CreateRed(Parent, Position) as PunctuationSyntax; - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxFactory.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxFactory.cs new file mode 100644 index 0000000000..46bfd219dc --- /dev/null +++ b/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxFactory.cs @@ -0,0 +1,13 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Razor.Language.Syntax +{ + internal static class SyntaxFactory + { + internal static SyntaxToken Token(SyntaxKind kind, string content, params RazorDiagnostic[] diagnostics) + { + return new SyntaxToken(InternalSyntax.SyntaxFactory.Token(kind, content), parent: null, position: 0); + } + } +} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxKind.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxKind.cs index 46dad28dee..1cad1ed9f2 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxKind.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxKind.cs @@ -5,28 +5,93 @@ namespace Microsoft.AspNetCore.Razor.Language { internal enum SyntaxKind : byte { + #region Nodes + HtmlText, + HtmlDocument, + HtmlDeclaration, + #endregion + + #region Tokens + // Common Unknown, List, Whitespace, NewLine, + Colon, + QuestionMark, + RightBracket, + LeftBracket, + Equals, + Transition, // HTML - HtmlText, - HtmlDocument, - HtmlDeclaration, - HtmlTextLiteralToken, + HtmlTextLiteral, OpenAngle, Bang, ForwardSlash, - QuestionMark, DoubleHyphen, - LeftBracket, CloseAngle, - RightBracket, - Equals, DoubleQuote, SingleQuote, - Transition, - Colon, + + // CSharp literals + Identifier, + Keyword, + IntegerLiteral, + CSharpComment, + RealLiteral, + CharacterLiteral, + StringLiteral, + + // CSharp operators + Arrow, + Minus, + Decrement, + MinusAssign, + NotEqual, + Not, + Modulo, + ModuloAssign, + AndAssign, + And, + DoubleAnd, + LeftParenthesis, + RightParenthesis, + Star, + MultiplyAssign, + Comma, + Dot, + Slash, + DivideAssign, + DoubleColon, + Semicolon, + NullCoalesce, + XorAssign, + Xor, + LeftBrace, + OrAssign, + DoubleOr, + Or, + RightBrace, + Tilde, + Plus, + PlusAssign, + Increment, + LessThan, + LessThanEqual, + LeftShift, + LeftShiftAssign, + Assign, + GreaterThan, + GreaterThanEqual, + RightShift, + RightShiftAssign, + Hash, + + // Razor specific + RazorComment, + RazorCommentStar, + RazorCommentTransition, + #endregion } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxNode.cs index d55504d46e..f0634d10d3 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxNode.cs @@ -239,6 +239,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax return Green.GetAnnotations(); } + public bool IsEquivalentTo(SyntaxNode other) + { + if (this == other) + { + return true; + } + + if (other == null) + { + return false; + } + + return Green.IsEquivalentTo(other.Green); + } + public override string ToString() { return Green.ToString(); diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxToken.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxToken.cs index d3ffa0096c..c022f3634b 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxToken.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Syntax/SyntaxToken.cs @@ -3,29 +3,70 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; +using Microsoft.AspNetCore.Razor.Language.Legacy; namespace Microsoft.AspNetCore.Razor.Language.Syntax { - internal abstract class SyntaxToken : SyntaxNode + internal class SyntaxToken : SyntaxNode { internal SyntaxToken(GreenNode green, SyntaxNode parent, int position) + : this(green, parent, null, position) + { + } + + // Temporary plumbing + internal SyntaxToken(GreenNode green, SyntaxNode parent, Span parentSpan, int position) : base(green, parent, position) { + Debug.Assert(parent == null || !parent.Green.IsList, "list cannot be a parent"); + Debug.Assert(green == null || green.IsToken, "green must be a token"); + + ParentSpan = parentSpan; + } + + // Temporary plumbing + internal Span ParentSpan { get; } + + // Temporary plumbing + internal SourceLocation Start + { + get + { + if (ParentSpan == null) + { + return SourceLocation.Undefined; + } + + var tracker = new SourceLocationTracker(ParentSpan.Start); + for (var i = 0; i < ParentSpan.Tokens.Count; i++) + { + var token = ParentSpan.Tokens[i]; + if (object.ReferenceEquals(this, token)) + { + break; + } + + tracker.UpdateLocation(token.Content); + } + + return tracker.CurrentLocation; + } } internal new InternalSyntax.SyntaxToken Green => (InternalSyntax.SyntaxToken)base.Green; - public string Text => Green.Text; + public string Content => Green.Content; internal override sealed SyntaxNode GetCachedSlot(int index) { - throw new InvalidOperationException(); + throw new InvalidOperationException("Tokens can't have slots."); } internal override sealed SyntaxNode GetNodeSlot(int slot) { - throw new InvalidOperationException(); + throw new InvalidOperationException("Tokens can't have slots."); } internal override SyntaxNode Accept(SyntaxVisitor visitor) @@ -33,24 +74,30 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax return visitor.VisitSyntaxToken(this); } - internal abstract SyntaxToken WithLeadingTriviaCore(SyntaxNode trivia); + public SyntaxToken WithLeadingTrivia(SyntaxNode trivia) + { + return Green != null + ? new SyntaxToken(Green.WithLeadingTrivia(trivia.Green), parent: null, position: 0) + : default(SyntaxToken); + } - internal abstract SyntaxToken WithTrailingTriviaCore(SyntaxNode trivia); - - public SyntaxToken WithLeadingTrivia(SyntaxNode trivia) => WithLeadingTriviaCore(trivia); - - public SyntaxToken WithTrailingTrivia(SyntaxNode trivia) => WithTrailingTriviaCore(trivia); + public SyntaxToken WithTrailingTrivia(SyntaxNode trivia) + { + return Green != null + ? new SyntaxToken(Green.WithTrailingTrivia(trivia.Green), parent: null, position: 0) + : default(SyntaxToken); + } public SyntaxToken WithLeadingTrivia(IEnumerable trivia) { var greenList = trivia?.Select(t => t.Green); - return WithLeadingTriviaCore(Green.CreateList(greenList)?.CreateRed()); + return WithLeadingTrivia(Green.CreateList(greenList)?.CreateRed()); } public SyntaxToken WithTrailingTrivia(IEnumerable trivia) { var greenList = trivia?.Select(t => t.Green); - return WithTrailingTriviaCore(Green.CreateList(greenList)?.CreateRed()); + return WithTrailingTrivia(Green.CreateList(greenList)?.CreateRed()); } public override SyntaxTriviaList GetLeadingTrivia() @@ -85,7 +132,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax public override string ToString() { - return Text; + return Content; } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/UnknownTokenSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/UnknownTokenSyntax.cs deleted file mode 100644 index 238b36d1af..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/UnknownTokenSyntax.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax -{ - internal class UnknownTokenSyntax : SyntaxToken - { - internal UnknownTokenSyntax(GreenNode green, SyntaxNode parent, int position) - : base(green, parent, position) - { - } - - internal new InternalSyntax.UnknownTokenSyntax Green => (InternalSyntax.UnknownTokenSyntax)base.Green; - - public string Value => Text; - - internal override SyntaxToken WithLeadingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.UnknownTokenSyntax(Text, trivia?.Green, GetTrailingTrivia().Node?.Green).CreateRed(Parent, Position) as UnknownTokenSyntax; - } - - internal override SyntaxToken WithTrailingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.UnknownTokenSyntax(Text, GetLeadingTrivia().Node?.Green, trivia?.Green).CreateRed(Parent, Position) as UnknownTokenSyntax; - } - } -} diff --git a/src/Microsoft.AspNetCore.Razor.Language/Syntax/WhitespaceTokenSyntax.cs b/src/Microsoft.AspNetCore.Razor.Language/Syntax/WhitespaceTokenSyntax.cs deleted file mode 100644 index 5a8222f802..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Language/Syntax/WhitespaceTokenSyntax.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Razor.Language.Syntax -{ - internal class WhitespaceTokenSyntax : SyntaxToken - { - internal WhitespaceTokenSyntax(GreenNode green, SyntaxNode parent, int position) - : base(green, parent, position) - { - } - - internal new InternalSyntax.WhitespaceTokenSyntax Green => (InternalSyntax.WhitespaceTokenSyntax)base.Green; - - public string Value => Text; - - internal override SyntaxToken WithLeadingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.WhitespaceTokenSyntax(Text, trivia?.Green, GetTrailingTrivia().Node?.Green).CreateRed(Parent, Position) as WhitespaceTokenSyntax; - } - - internal override SyntaxToken WithTrailingTriviaCore(SyntaxNode trivia) - { - return new InternalSyntax.WhitespaceTokenSyntax(Text, GetLeadingTrivia().Node?.Green, trivia?.Green).CreateRed(Parent, Position) as WhitespaceTokenSyntax; - } - } -} diff --git a/src/Microsoft.VisualStudio.Editor.Razor/DefaultRazorCompletionFactsService.cs b/src/Microsoft.VisualStudio.Editor.Razor/DefaultRazorCompletionFactsService.cs index 57ac8ddb8d..2f9146eab2 100644 --- a/src/Microsoft.VisualStudio.Editor.Razor/DefaultRazorCompletionFactsService.cs +++ b/src/Microsoft.VisualStudio.Editor.Razor/DefaultRazorCompletionFactsService.cs @@ -7,6 +7,7 @@ using System.ComponentModel.Composition; using System.Linq; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Legacy; +using Microsoft.AspNetCore.Razor.Language.Syntax; namespace Microsoft.VisualStudio.Editor.Razor { @@ -83,16 +84,11 @@ namespace Microsoft.VisualStudio.Editor.Razor } // Internal for testing - internal static bool IsDirectiveCompletableToken(IToken token) + internal static bool IsDirectiveCompletableToken(SyntaxToken token) { - if (!(token is CSharpToken csharpToken)) - { - return false; - } - - return csharpToken.Type == CSharpTokenType.Identifier || + return token.Kind == SyntaxKind.Identifier || // Marker symbol - csharpToken.Type == CSharpTokenType.Unknown; + token.Kind == SyntaxKind.Unknown; } } } diff --git a/src/Microsoft.VisualStudio.Editor.Razor/DefaultRazorIndentationFactsService.cs b/src/Microsoft.VisualStudio.Editor.Razor/DefaultRazorIndentationFactsService.cs index f69274fa15..f8776d6993 100644 --- a/src/Microsoft.VisualStudio.Editor.Razor/DefaultRazorIndentationFactsService.cs +++ b/src/Microsoft.VisualStudio.Editor.Razor/DefaultRazorIndentationFactsService.cs @@ -143,8 +143,7 @@ namespace Microsoft.VisualStudio.Editor.Razor { return currentChild is Span currentSpan && currentSpan.Tokens.Count == 1 && - currentSpan.Tokens[0] is CSharpToken symbol && - symbol.Type == CSharpTokenType.LeftBrace; + currentSpan.Tokens[0].Kind == SyntaxKind.LeftBrace; } } } diff --git a/src/Microsoft.VisualStudio.Editor.Razor/RazorDirectiveCompletionProvider.cs b/src/Microsoft.VisualStudio.Editor.Razor/RazorDirectiveCompletionProvider.cs index 607270c978..2b4788dad9 100644 --- a/src/Microsoft.VisualStudio.Editor.Razor/RazorDirectiveCompletionProvider.cs +++ b/src/Microsoft.VisualStudio.Editor.Razor/RazorDirectiveCompletionProvider.cs @@ -206,17 +206,5 @@ namespace Microsoft.VisualStudio.Editor.Razor return false; } - - private static bool IsDirectiveCompletableSymbol(AspNetCore.Razor.Language.Legacy.IToken symbol) - { - if (!(symbol is CSharpToken csharpSymbol)) - { - return false; - } - - return csharpSymbol.Type == CSharpTokenType.Identifier || - // Marker symbol - csharpSymbol.Type == CSharpTokenType.Unknown; - } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/BlockTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/BlockTest.cs index d54ef401df..643c8d54fc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/BlockTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/BlockTest.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -13,7 +14,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { // Arrange var spanBuilder = new SpanBuilder(SourceLocation.Zero); - spanBuilder.Accept(new HtmlToken("hello", HtmlTokenType.Text)); + spanBuilder.Accept(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "hello")); var span = spanBuilder.Build(); var blockBuilder = new BlockBuilder() { @@ -29,7 +30,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var parentBlock = blockBuilder.Build(); var originalBlockLength = parentBlock.Length; spanBuilder = new SpanBuilder(SourceLocation.Zero); - spanBuilder.Accept(new HtmlToken("hi", HtmlTokenType.Text)); + spanBuilder.Accept(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "hi")); span.ReplaceWith(spanBuilder); // Wire up parents now so we can re-trigger ChildChanged to cause cache refresh. diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpLanguageCharacteristicsTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpLanguageCharacteristicsTest.cs index e8eeb8c586..84802523b2 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpLanguageCharacteristicsTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpLanguageCharacteristicsTest.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void GetSample_RightShiftAssign_ReturnsCorrectToken() { // Arrange & Act - var token = CSharpLanguageCharacteristics.Instance.GetSample(CSharpTokenType.RightShiftAssign); + var token = CSharpLanguageCharacteristics.Instance.GetSample(SyntaxKind.RightShiftAssign); // Assert Assert.Equal(">>=", token); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerCommentTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerCommentTest.cs index 64dafafa16..4abaea783f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerCommentTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerCommentTest.cs @@ -1,22 +1,23 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy { public class CSharpTokenizerCommentTest : CSharpTokenizerTestBase { - private new CSharpToken IgnoreRemaining => (CSharpToken)base.IgnoreRemaining; + private new SyntaxToken IgnoreRemaining => (SyntaxToken)base.IgnoreRemaining; [Fact] public void Next_Ignores_Star_At_EOF_In_RazorComment() { TestTokenizer( "@* Foo * Bar * Baz *", - new CSharpToken("@", CSharpTokenType.RazorCommentTransition), - new CSharpToken("*", CSharpTokenType.RazorCommentStar), - new CSharpToken(" Foo * Bar * Baz *", CSharpTokenType.RazorComment)); + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorComment, " Foo * Bar * Baz *")); } [Fact] @@ -24,11 +25,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "@* Foo * Bar * Baz *@", - new CSharpToken("@", CSharpTokenType.RazorCommentTransition), - new CSharpToken("*", CSharpTokenType.RazorCommentStar), - new CSharpToken(" Foo * Bar * Baz ", CSharpTokenType.RazorComment), - new CSharpToken("*", CSharpTokenType.RazorCommentStar), - new CSharpToken("@", CSharpTokenType.RazorCommentTransition)); + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorComment, " Foo * Bar * Baz "), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@")); } [Fact] @@ -36,59 +37,59 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "@* Foo Bar Baz *@", - new CSharpToken("@", CSharpTokenType.RazorCommentTransition), - new CSharpToken("*", CSharpTokenType.RazorCommentStar), - new CSharpToken(" Foo Bar Baz ", CSharpTokenType.RazorComment), - new CSharpToken("*", CSharpTokenType.RazorCommentStar), - new CSharpToken("@", CSharpTokenType.RazorCommentTransition)); + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorComment, " Foo Bar Baz "), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@")); } [Fact] public void Next_Returns_Comment_Token_For_Entire_Single_Line_Comment() { - TestTokenizer("// Foo Bar Baz", new CSharpToken("// Foo Bar Baz", CSharpTokenType.Comment)); + TestTokenizer("// Foo Bar Baz", SyntaxFactory.Token(SyntaxKind.CSharpComment, "// Foo Bar Baz")); } [Fact] public void Single_Line_Comment_Is_Terminated_By_Newline() { - TestTokenizer("// Foo Bar Baz\na", new CSharpToken("// Foo Bar Baz", CSharpTokenType.Comment), IgnoreRemaining); + TestTokenizer("// Foo Bar Baz\na", SyntaxFactory.Token(SyntaxKind.CSharpComment, "// Foo Bar Baz"), IgnoreRemaining); } [Fact] public void Multi_Line_Comment_In_Single_Line_Comment_Has_No_Effect() { - TestTokenizer("// Foo/*Bar*/ Baz\na", new CSharpToken("// Foo/*Bar*/ Baz", CSharpTokenType.Comment), IgnoreRemaining); + TestTokenizer("// Foo/*Bar*/ Baz\na", SyntaxFactory.Token(SyntaxKind.CSharpComment, "// Foo/*Bar*/ Baz"), IgnoreRemaining); } [Fact] public void Next_Returns_Comment_Token_For_Entire_Multi_Line_Comment() { - TestTokenizer("/* Foo\nBar\nBaz */", new CSharpToken("/* Foo\nBar\nBaz */", CSharpTokenType.Comment)); + TestTokenizer("/* Foo\nBar\nBaz */", SyntaxFactory.Token(SyntaxKind.CSharpComment, "/* Foo\nBar\nBaz */")); } [Fact] public void Multi_Line_Comment_Is_Terminated_By_End_Sequence() { - TestTokenizer("/* Foo\nBar\nBaz */a", new CSharpToken("/* Foo\nBar\nBaz */", CSharpTokenType.Comment), IgnoreRemaining); + TestTokenizer("/* Foo\nBar\nBaz */a", SyntaxFactory.Token(SyntaxKind.CSharpComment, "/* Foo\nBar\nBaz */"), IgnoreRemaining); } [Fact] public void Unterminated_Multi_Line_Comment_Captures_To_EOF() { - TestTokenizer("/* Foo\nBar\nBaz", new CSharpToken("/* Foo\nBar\nBaz", CSharpTokenType.Comment), IgnoreRemaining); + TestTokenizer("/* Foo\nBar\nBaz", SyntaxFactory.Token(SyntaxKind.CSharpComment, "/* Foo\nBar\nBaz"), IgnoreRemaining); } [Fact] public void Nested_Multi_Line_Comments_Terminated_At_First_End_Sequence() { - TestTokenizer("/* Foo/*\nBar\nBaz*/ */", new CSharpToken("/* Foo/*\nBar\nBaz*/", CSharpTokenType.Comment), IgnoreRemaining); + TestTokenizer("/* Foo/*\nBar\nBaz*/ */", SyntaxFactory.Token(SyntaxKind.CSharpComment, "/* Foo/*\nBar\nBaz*/"), IgnoreRemaining); } [Fact] public void Nested_Multi_Line_Comments_Terminated_At_Full_End_Sequence() { - TestTokenizer("/* Foo\nBar\nBaz* */", new CSharpToken("/* Foo\nBar\nBaz* */", CSharpTokenType.Comment), IgnoreRemaining); + TestTokenizer("/* Foo\nBar\nBaz* */", SyntaxFactory.Token(SyntaxKind.CSharpComment, "/* Foo\nBar\nBaz* */"), IgnoreRemaining); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerIdentifierTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerIdentifierTest.cs index b24c976dc9..e5a3a466ac 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerIdentifierTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerIdentifierTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -10,73 +11,73 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Fact] public void Simple_Identifier_Is_Recognized() { - TestTokenizer("foo", new CSharpToken("foo", CSharpTokenType.Identifier)); + TestTokenizer("foo", SyntaxFactory.Token(SyntaxKind.Identifier, "foo")); } [Fact] public void Identifier_Starting_With_Underscore_Is_Recognized() { - TestTokenizer("_foo", new CSharpToken("_foo", CSharpTokenType.Identifier)); + TestTokenizer("_foo", SyntaxFactory.Token(SyntaxKind.Identifier, "_foo")); } [Fact] public void Identifier_Can_Contain_Digits() { - TestTokenizer("foo4", new CSharpToken("foo4", CSharpTokenType.Identifier)); + TestTokenizer("foo4", SyntaxFactory.Token(SyntaxKind.Identifier, "foo4")); } [Fact] public void Identifier_Can_Start_With_Titlecase_Letter() { - TestTokenizer("ῼfoo", new CSharpToken("ῼfoo", CSharpTokenType.Identifier)); + TestTokenizer("ῼfoo", SyntaxFactory.Token(SyntaxKind.Identifier, "ῼfoo")); } [Fact] public void Identifier_Can_Start_With_Letter_Modifier() { - TestTokenizer("ᵊfoo", new CSharpToken("ᵊfoo", CSharpTokenType.Identifier)); + TestTokenizer("ᵊfoo", SyntaxFactory.Token(SyntaxKind.Identifier, "ᵊfoo")); } [Fact] public void Identifier_Can_Start_With_Other_Letter() { - TestTokenizer("ƻfoo", new CSharpToken("ƻfoo", CSharpTokenType.Identifier)); + TestTokenizer("ƻfoo", SyntaxFactory.Token(SyntaxKind.Identifier, "ƻfoo")); } [Fact] public void Identifier_Can_Start_With_Number_Letter() { - TestTokenizer("Ⅽool", new CSharpToken("Ⅽool", CSharpTokenType.Identifier)); + TestTokenizer("Ⅽool", SyntaxFactory.Token(SyntaxKind.Identifier, "Ⅽool")); } [Fact] public void Identifier_Can_Contain_Non_Spacing_Mark() { - TestTokenizer("foo\u0300", new CSharpToken("foo\u0300", CSharpTokenType.Identifier)); + TestTokenizer("foo\u0300", SyntaxFactory.Token(SyntaxKind.Identifier, "foo\u0300")); } [Fact] public void Identifier_Can_Contain_Spacing_Combining_Mark() { - TestTokenizer("fooः", new CSharpToken("fooः", CSharpTokenType.Identifier)); + TestTokenizer("fooः", SyntaxFactory.Token(SyntaxKind.Identifier, "fooः")); } [Fact] public void Identifier_Can_Contain_Non_English_Digit() { - TestTokenizer("foo١", new CSharpToken("foo١", CSharpTokenType.Identifier)); + TestTokenizer("foo١", SyntaxFactory.Token(SyntaxKind.Identifier, "foo١")); } [Fact] public void Identifier_Can_Contain_Connector_Punctuation() { - TestTokenizer("foo‿bar", new CSharpToken("foo‿bar", CSharpTokenType.Identifier)); + TestTokenizer("foo‿bar", SyntaxFactory.Token(SyntaxKind.Identifier, "foo‿bar")); } [Fact] public void Identifier_Can_Contain_Format_Character() { - TestTokenizer("foo؃bar", new CSharpToken("foo؃bar", CSharpTokenType.Identifier)); + TestTokenizer("foo؃bar", SyntaxFactory.Token(SyntaxKind.Identifier, "foo؃bar")); } [Fact] @@ -164,7 +165,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void TestKeyword(string keyword, CSharpKeyword keywordType) { - TestTokenizer(keyword, new CSharpToken(keyword, CSharpTokenType.Keyword) { Keyword = keywordType }); + TestTokenizer(keyword, SyntaxFactory.Token(SyntaxKind.Keyword, keyword)); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerLiteralTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerLiteralTest.cs index a10aea8ba9..c7c250cce3 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerLiteralTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerLiteralTest.cs @@ -2,286 +2,287 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy { public class CSharpTokenizerLiteralTest : CSharpTokenizerTestBase { - private new CSharpToken IgnoreRemaining => (CSharpToken)base.IgnoreRemaining; + private new SyntaxToken IgnoreRemaining => (SyntaxToken)base.IgnoreRemaining; [Fact] public void Simple_Integer_Literal_Is_Recognized() { - TestSingleToken("01189998819991197253", CSharpTokenType.IntegerLiteral); + TestSingleToken("01189998819991197253", SyntaxKind.IntegerLiteral); } [Fact] public void Integer_Type_Suffix_Is_Recognized() { - TestSingleToken("42U", CSharpTokenType.IntegerLiteral); - TestSingleToken("42u", CSharpTokenType.IntegerLiteral); + TestSingleToken("42U", SyntaxKind.IntegerLiteral); + TestSingleToken("42u", SyntaxKind.IntegerLiteral); - TestSingleToken("42L", CSharpTokenType.IntegerLiteral); - TestSingleToken("42l", CSharpTokenType.IntegerLiteral); + TestSingleToken("42L", SyntaxKind.IntegerLiteral); + TestSingleToken("42l", SyntaxKind.IntegerLiteral); - TestSingleToken("42UL", CSharpTokenType.IntegerLiteral); - TestSingleToken("42Ul", CSharpTokenType.IntegerLiteral); + TestSingleToken("42UL", SyntaxKind.IntegerLiteral); + TestSingleToken("42Ul", SyntaxKind.IntegerLiteral); - TestSingleToken("42uL", CSharpTokenType.IntegerLiteral); - TestSingleToken("42ul", CSharpTokenType.IntegerLiteral); + TestSingleToken("42uL", SyntaxKind.IntegerLiteral); + TestSingleToken("42ul", SyntaxKind.IntegerLiteral); - TestSingleToken("42LU", CSharpTokenType.IntegerLiteral); - TestSingleToken("42Lu", CSharpTokenType.IntegerLiteral); + TestSingleToken("42LU", SyntaxKind.IntegerLiteral); + TestSingleToken("42Lu", SyntaxKind.IntegerLiteral); - TestSingleToken("42lU", CSharpTokenType.IntegerLiteral); - TestSingleToken("42lu", CSharpTokenType.IntegerLiteral); + TestSingleToken("42lU", SyntaxKind.IntegerLiteral); + TestSingleToken("42lu", SyntaxKind.IntegerLiteral); } [Fact] public void Trailing_Letter_Is_Not_Part_Of_Integer_Literal_If_Not_Type_Sufix() { - TestTokenizer("42a", new CSharpToken("42", CSharpTokenType.IntegerLiteral), IgnoreRemaining); + TestTokenizer("42a", SyntaxFactory.Token(SyntaxKind.IntegerLiteral, "42"), IgnoreRemaining); } [Fact] public void Simple_Hex_Literal_Is_Recognized() { - TestSingleToken("0x0123456789ABCDEF", CSharpTokenType.IntegerLiteral); + TestSingleToken("0x0123456789ABCDEF", SyntaxKind.IntegerLiteral); } [Fact] public void Integer_Type_Suffix_Is_Recognized_In_Hex_Literal() { - TestSingleToken("0xDEADBEEFU", CSharpTokenType.IntegerLiteral); - TestSingleToken("0xDEADBEEFu", CSharpTokenType.IntegerLiteral); + TestSingleToken("0xDEADBEEFU", SyntaxKind.IntegerLiteral); + TestSingleToken("0xDEADBEEFu", SyntaxKind.IntegerLiteral); - TestSingleToken("0xDEADBEEFL", CSharpTokenType.IntegerLiteral); - TestSingleToken("0xDEADBEEFl", CSharpTokenType.IntegerLiteral); + TestSingleToken("0xDEADBEEFL", SyntaxKind.IntegerLiteral); + TestSingleToken("0xDEADBEEFl", SyntaxKind.IntegerLiteral); - TestSingleToken("0xDEADBEEFUL", CSharpTokenType.IntegerLiteral); - TestSingleToken("0xDEADBEEFUl", CSharpTokenType.IntegerLiteral); + TestSingleToken("0xDEADBEEFUL", SyntaxKind.IntegerLiteral); + TestSingleToken("0xDEADBEEFUl", SyntaxKind.IntegerLiteral); - TestSingleToken("0xDEADBEEFuL", CSharpTokenType.IntegerLiteral); - TestSingleToken("0xDEADBEEFul", CSharpTokenType.IntegerLiteral); + TestSingleToken("0xDEADBEEFuL", SyntaxKind.IntegerLiteral); + TestSingleToken("0xDEADBEEFul", SyntaxKind.IntegerLiteral); - TestSingleToken("0xDEADBEEFLU", CSharpTokenType.IntegerLiteral); - TestSingleToken("0xDEADBEEFLu", CSharpTokenType.IntegerLiteral); + TestSingleToken("0xDEADBEEFLU", SyntaxKind.IntegerLiteral); + TestSingleToken("0xDEADBEEFLu", SyntaxKind.IntegerLiteral); - TestSingleToken("0xDEADBEEFlU", CSharpTokenType.IntegerLiteral); - TestSingleToken("0xDEADBEEFlu", CSharpTokenType.IntegerLiteral); + TestSingleToken("0xDEADBEEFlU", SyntaxKind.IntegerLiteral); + TestSingleToken("0xDEADBEEFlu", SyntaxKind.IntegerLiteral); } [Fact] public void Trailing_Letter_Is_Not_Part_Of_Hex_Literal_If_Not_Type_Sufix() { - TestTokenizer("0xDEADBEEFz", new CSharpToken("0xDEADBEEF", CSharpTokenType.IntegerLiteral), IgnoreRemaining); + TestTokenizer("0xDEADBEEFz", SyntaxFactory.Token(SyntaxKind.IntegerLiteral, "0xDEADBEEF"), IgnoreRemaining); } [Fact] public void Dot_Followed_By_Non_Digit_Is_Not_Part_Of_Real_Literal() { - TestTokenizer("3.a", new CSharpToken("3", CSharpTokenType.IntegerLiteral), IgnoreRemaining); + TestTokenizer("3.a", SyntaxFactory.Token(SyntaxKind.IntegerLiteral, "3"), IgnoreRemaining); } [Fact] public void Simple_Real_Literal_Is_Recognized() { - TestTokenizer("3.14159", new CSharpToken("3.14159", CSharpTokenType.RealLiteral)); + TestTokenizer("3.14159", SyntaxFactory.Token(SyntaxKind.RealLiteral, "3.14159")); } [Fact] public void Real_Literal_Between_Zero_And_One_Is_Recognized() { - TestTokenizer(".14159", new CSharpToken(".14159", CSharpTokenType.RealLiteral)); + TestTokenizer(".14159", SyntaxFactory.Token(SyntaxKind.RealLiteral, ".14159")); } [Fact] public void Integer_With_Real_Type_Suffix_Is_Recognized() { - TestSingleToken("42F", CSharpTokenType.RealLiteral); - TestSingleToken("42f", CSharpTokenType.RealLiteral); - TestSingleToken("42D", CSharpTokenType.RealLiteral); - TestSingleToken("42d", CSharpTokenType.RealLiteral); - TestSingleToken("42M", CSharpTokenType.RealLiteral); - TestSingleToken("42m", CSharpTokenType.RealLiteral); + TestSingleToken("42F", SyntaxKind.RealLiteral); + TestSingleToken("42f", SyntaxKind.RealLiteral); + TestSingleToken("42D", SyntaxKind.RealLiteral); + TestSingleToken("42d", SyntaxKind.RealLiteral); + TestSingleToken("42M", SyntaxKind.RealLiteral); + TestSingleToken("42m", SyntaxKind.RealLiteral); } [Fact] public void Integer_With_Exponent_Is_Recognized() { - TestSingleToken("1e10", CSharpTokenType.RealLiteral); - TestSingleToken("1E10", CSharpTokenType.RealLiteral); - TestSingleToken("1e+10", CSharpTokenType.RealLiteral); - TestSingleToken("1E+10", CSharpTokenType.RealLiteral); - TestSingleToken("1e-10", CSharpTokenType.RealLiteral); - TestSingleToken("1E-10", CSharpTokenType.RealLiteral); + TestSingleToken("1e10", SyntaxKind.RealLiteral); + TestSingleToken("1E10", SyntaxKind.RealLiteral); + TestSingleToken("1e+10", SyntaxKind.RealLiteral); + TestSingleToken("1E+10", SyntaxKind.RealLiteral); + TestSingleToken("1e-10", SyntaxKind.RealLiteral); + TestSingleToken("1E-10", SyntaxKind.RealLiteral); } [Fact] public void Real_Number_With_Type_Suffix_Is_Recognized() { - TestSingleToken("3.14F", CSharpTokenType.RealLiteral); - TestSingleToken("3.14f", CSharpTokenType.RealLiteral); - TestSingleToken("3.14D", CSharpTokenType.RealLiteral); - TestSingleToken("3.14d", CSharpTokenType.RealLiteral); - TestSingleToken("3.14M", CSharpTokenType.RealLiteral); - TestSingleToken("3.14m", CSharpTokenType.RealLiteral); + TestSingleToken("3.14F", SyntaxKind.RealLiteral); + TestSingleToken("3.14f", SyntaxKind.RealLiteral); + TestSingleToken("3.14D", SyntaxKind.RealLiteral); + TestSingleToken("3.14d", SyntaxKind.RealLiteral); + TestSingleToken("3.14M", SyntaxKind.RealLiteral); + TestSingleToken("3.14m", SyntaxKind.RealLiteral); } [Fact] public void Real_Number_With_Exponent_Is_Recognized() { - TestSingleToken("3.14E10", CSharpTokenType.RealLiteral); - TestSingleToken("3.14e10", CSharpTokenType.RealLiteral); - TestSingleToken("3.14E+10", CSharpTokenType.RealLiteral); - TestSingleToken("3.14e+10", CSharpTokenType.RealLiteral); - TestSingleToken("3.14E-10", CSharpTokenType.RealLiteral); - TestSingleToken("3.14e-10", CSharpTokenType.RealLiteral); + TestSingleToken("3.14E10", SyntaxKind.RealLiteral); + TestSingleToken("3.14e10", SyntaxKind.RealLiteral); + TestSingleToken("3.14E+10", SyntaxKind.RealLiteral); + TestSingleToken("3.14e+10", SyntaxKind.RealLiteral); + TestSingleToken("3.14E-10", SyntaxKind.RealLiteral); + TestSingleToken("3.14e-10", SyntaxKind.RealLiteral); } [Fact] public void Real_Number_With_Exponent_And_Type_Suffix_Is_Recognized() { - TestSingleToken("3.14E+10F", CSharpTokenType.RealLiteral); + TestSingleToken("3.14E+10F", SyntaxKind.RealLiteral); } [Fact] public void Single_Character_Literal_Is_Recognized() { - TestSingleToken("'f'", CSharpTokenType.CharacterLiteral); + TestSingleToken("'f'", SyntaxKind.CharacterLiteral); } [Fact] public void Multi_Character_Literal_Is_Recognized() { - TestSingleToken("'foo'", CSharpTokenType.CharacterLiteral); + TestSingleToken("'foo'", SyntaxKind.CharacterLiteral); } [Fact] public void Character_Literal_Is_Terminated_By_EOF_If_Unterminated() { - TestSingleToken("'foo bar", CSharpTokenType.CharacterLiteral); + TestSingleToken("'foo bar", SyntaxKind.CharacterLiteral); } [Fact] public void Character_Literal_Not_Terminated_By_Escaped_Quote() { - TestSingleToken("'foo\\'bar'", CSharpTokenType.CharacterLiteral); + TestSingleToken("'foo\\'bar'", SyntaxKind.CharacterLiteral); } [Fact] public void Character_Literal_Is_Terminated_By_EOL_If_Unterminated() { - TestTokenizer("'foo\n", new CSharpToken("'foo", CSharpTokenType.CharacterLiteral), IgnoreRemaining); + TestTokenizer("'foo\n", SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "'foo"), IgnoreRemaining); } [Fact] public void Character_Literal_Terminated_By_EOL_Even_When_Last_Char_Is_Slash() { - TestTokenizer("'foo\\\n", new CSharpToken("'foo\\", CSharpTokenType.CharacterLiteral), IgnoreRemaining); + TestTokenizer("'foo\\\n", SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "'foo\\"), IgnoreRemaining); } [Fact] public void Character_Literal_Terminated_By_EOL_Even_When_Last_Char_Is_Slash_And_Followed_By_Stuff() { - TestTokenizer("'foo\\\nflarg", new CSharpToken("'foo\\", CSharpTokenType.CharacterLiteral), IgnoreRemaining); + TestTokenizer("'foo\\\nflarg", SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "'foo\\"), IgnoreRemaining); } [Fact] public void Character_Literal_Terminated_By_CRLF_Even_When_Last_Char_Is_Slash() { - TestTokenizer("'foo\\" + Environment.NewLine, new CSharpToken("'foo\\", CSharpTokenType.CharacterLiteral), IgnoreRemaining); + TestTokenizer("'foo\\" + Environment.NewLine, SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "'foo\\"), IgnoreRemaining); } [Fact] public void Character_Literal_Terminated_By_CRLF_Even_When_Last_Char_Is_Slash_And_Followed_By_Stuff() { - TestTokenizer($"'foo\\{Environment.NewLine}flarg", new CSharpToken("'foo\\", CSharpTokenType.CharacterLiteral), IgnoreRemaining); + TestTokenizer($"'foo\\{Environment.NewLine}flarg", SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "'foo\\"), IgnoreRemaining); } [Fact] public void Character_Literal_Allows_Escaped_Escape() { - TestTokenizer("'foo\\\\'blah", new CSharpToken("'foo\\\\'", CSharpTokenType.CharacterLiteral), IgnoreRemaining); + TestTokenizer("'foo\\\\'blah", SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "'foo\\\\'"), IgnoreRemaining); } [Fact] public void String_Literal_Is_Recognized() { - TestSingleToken("\"foo\"", CSharpTokenType.StringLiteral); + TestSingleToken("\"foo\"", SyntaxKind.StringLiteral); } [Fact] public void String_Literal_Is_Terminated_By_EOF_If_Unterminated() { - TestSingleToken("\"foo bar", CSharpTokenType.StringLiteral); + TestSingleToken("\"foo bar", SyntaxKind.StringLiteral); } [Fact] public void String_Literal_Not_Terminated_By_Escaped_Quote() { - TestSingleToken("\"foo\\\"bar\"", CSharpTokenType.StringLiteral); + TestSingleToken("\"foo\\\"bar\"", SyntaxKind.StringLiteral); } [Fact] public void String_Literal_Is_Terminated_By_EOL_If_Unterminated() { - TestTokenizer("\"foo\n", new CSharpToken("\"foo", CSharpTokenType.StringLiteral), IgnoreRemaining); + TestTokenizer("\"foo\n", SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"foo"), IgnoreRemaining); } [Fact] public void String_Literal_Terminated_By_EOL_Even_When_Last_Char_Is_Slash() { - TestTokenizer("\"foo\\\n", new CSharpToken("\"foo\\", CSharpTokenType.StringLiteral), IgnoreRemaining); + TestTokenizer("\"foo\\\n", SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"foo\\"), IgnoreRemaining); } [Fact] public void String_Literal_Terminated_By_EOL_Even_When_Last_Char_Is_Slash_And_Followed_By_Stuff() { - TestTokenizer("\"foo\\\nflarg", new CSharpToken("\"foo\\", CSharpTokenType.StringLiteral), IgnoreRemaining); + TestTokenizer("\"foo\\\nflarg", SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"foo\\"), IgnoreRemaining); } [Fact] public void String_Literal_Terminated_By_CRLF_Even_When_Last_Char_Is_Slash() { - TestTokenizer("\"foo\\" + Environment.NewLine, new CSharpToken("\"foo\\", CSharpTokenType.StringLiteral), IgnoreRemaining); + TestTokenizer("\"foo\\" + Environment.NewLine, SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"foo\\"), IgnoreRemaining); } [Fact] public void String_Literal_Terminated_By_CRLF_Even_When_Last_Char_Is_Slash_And_Followed_By_Stuff() { - TestTokenizer($"\"foo\\{Environment.NewLine}flarg", new CSharpToken("\"foo\\", CSharpTokenType.StringLiteral), IgnoreRemaining); + TestTokenizer($"\"foo\\{Environment.NewLine}flarg", SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"foo\\"), IgnoreRemaining); } [Fact] public void String_Literal_Allows_Escaped_Escape() { - TestTokenizer("\"foo\\\\\"blah", new CSharpToken("\"foo\\\\\"", CSharpTokenType.StringLiteral), IgnoreRemaining); + TestTokenizer("\"foo\\\\\"blah", SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"foo\\\\\""), IgnoreRemaining); } [Fact] public void Verbatim_String_Literal_Can_Contain_Newlines() { - TestSingleToken("@\"foo\nbar\nbaz\"", CSharpTokenType.StringLiteral); + TestSingleToken("@\"foo\nbar\nbaz\"", SyntaxKind.StringLiteral); } [Fact] public void Verbatim_String_Literal_Not_Terminated_By_Escaped_Double_Quote() { - TestSingleToken("@\"foo\"\"bar\"", CSharpTokenType.StringLiteral); + TestSingleToken("@\"foo\"\"bar\"", SyntaxKind.StringLiteral); } [Fact] public void Verbatim_String_Literal_Is_Terminated_By_Slash_Double_Quote() { - TestTokenizer("@\"foo\\\"bar\"", new CSharpToken("@\"foo\\\"", CSharpTokenType.StringLiteral), IgnoreRemaining); + TestTokenizer("@\"foo\\\"bar\"", SyntaxFactory.Token(SyntaxKind.StringLiteral, "@\"foo\\\""), IgnoreRemaining); } [Fact] public void Verbatim_String_Literal_Is_Terminated_By_EOF() { - TestSingleToken("@\"foo", CSharpTokenType.StringLiteral); + TestSingleToken("@\"foo", SyntaxKind.StringLiteral); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerOperatorsTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerOperatorsTest.cs index 0b600ea9bc..fdf2718387 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerOperatorsTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerOperatorsTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -10,287 +11,287 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Fact] public void LeftBrace_Is_Recognized() { - TestSingleToken("{", CSharpTokenType.LeftBrace); + TestSingleToken("{", SyntaxKind.LeftBrace); } [Fact] public void Plus_Is_Recognized() { - TestSingleToken("+", CSharpTokenType.Plus); + TestSingleToken("+", SyntaxKind.Plus); } [Fact] public void Assign_Is_Recognized() { - TestSingleToken("=", CSharpTokenType.Assign); + TestSingleToken("=", SyntaxKind.Assign); } [Fact] public void Arrow_Is_Recognized() { - TestSingleToken("->", CSharpTokenType.Arrow); + TestSingleToken("->", SyntaxKind.Arrow); } [Fact] public void AndAssign_Is_Recognized() { - TestSingleToken("&=", CSharpTokenType.AndAssign); + TestSingleToken("&=", SyntaxKind.AndAssign); } [Fact] public void RightBrace_Is_Recognized() { - TestSingleToken("}", CSharpTokenType.RightBrace); + TestSingleToken("}", SyntaxKind.RightBrace); } [Fact] public void Minus_Is_Recognized() { - TestSingleToken("-", CSharpTokenType.Minus); + TestSingleToken("-", SyntaxKind.Minus); } [Fact] public void LessThan_Is_Recognized() { - TestSingleToken("<", CSharpTokenType.LessThan); + TestSingleToken("<", SyntaxKind.LessThan); } [Fact] public void Equals_Is_Recognized() { - TestSingleToken("==", CSharpTokenType.Equals); + TestSingleToken("==", SyntaxKind.Equals); } [Fact] public void OrAssign_Is_Recognized() { - TestSingleToken("|=", CSharpTokenType.OrAssign); + TestSingleToken("|=", SyntaxKind.OrAssign); } [Fact] public void LeftBracket_Is_Recognized() { - TestSingleToken("[", CSharpTokenType.LeftBracket); + TestSingleToken("[", SyntaxKind.LeftBracket); } [Fact] public void Star_Is_Recognized() { - TestSingleToken("*", CSharpTokenType.Star); + TestSingleToken("*", SyntaxKind.Star); } [Fact] public void GreaterThan_Is_Recognized() { - TestSingleToken(">", CSharpTokenType.GreaterThan); + TestSingleToken(">", SyntaxKind.GreaterThan); } [Fact] public void NotEqual_Is_Recognized() { - TestSingleToken("!=", CSharpTokenType.NotEqual); + TestSingleToken("!=", SyntaxKind.NotEqual); } [Fact] public void XorAssign_Is_Recognized() { - TestSingleToken("^=", CSharpTokenType.XorAssign); + TestSingleToken("^=", SyntaxKind.XorAssign); } [Fact] public void RightBracket_Is_Recognized() { - TestSingleToken("]", CSharpTokenType.RightBracket); + TestSingleToken("]", SyntaxKind.RightBracket); } [Fact] public void Slash_Is_Recognized() { - TestSingleToken("/", CSharpTokenType.Slash); + TestSingleToken("/", SyntaxKind.Slash); } [Fact] public void QuestionMark_Is_Recognized() { - TestSingleToken("?", CSharpTokenType.QuestionMark); + TestSingleToken("?", SyntaxKind.QuestionMark); } [Fact] public void LessThanEqual_Is_Recognized() { - TestSingleToken("<=", CSharpTokenType.LessThanEqual); + TestSingleToken("<=", SyntaxKind.LessThanEqual); } [Fact] public void LeftShift_Is_Not_Specially_Recognized() { TestTokenizer("<<", - new CSharpToken("<", CSharpTokenType.LessThan), - new CSharpToken("<", CSharpTokenType.LessThan)); + SyntaxFactory.Token(SyntaxKind.LessThan, "<"), + SyntaxFactory.Token(SyntaxKind.LessThan, "<")); } [Fact] public void LeftParen_Is_Recognized() { - TestSingleToken("(", CSharpTokenType.LeftParenthesis); + TestSingleToken("(", SyntaxKind.LeftParenthesis); } [Fact] public void Modulo_Is_Recognized() { - TestSingleToken("%", CSharpTokenType.Modulo); + TestSingleToken("%", SyntaxKind.Modulo); } [Fact] public void NullCoalesce_Is_Recognized() { - TestSingleToken("??", CSharpTokenType.NullCoalesce); + TestSingleToken("??", SyntaxKind.NullCoalesce); } [Fact] public void GreaterThanEqual_Is_Recognized() { - TestSingleToken(">=", CSharpTokenType.GreaterThanEqual); + TestSingleToken(">=", SyntaxKind.GreaterThanEqual); } [Fact] public void EqualGreaterThan_Is_Recognized() { - TestSingleToken("=>", CSharpTokenType.GreaterThanEqual); + TestSingleToken("=>", SyntaxKind.GreaterThanEqual); } [Fact] public void RightParen_Is_Recognized() { - TestSingleToken(")", CSharpTokenType.RightParenthesis); + TestSingleToken(")", SyntaxKind.RightParenthesis); } [Fact] public void And_Is_Recognized() { - TestSingleToken("&", CSharpTokenType.And); + TestSingleToken("&", SyntaxKind.And); } [Fact] public void DoubleColon_Is_Recognized() { - TestSingleToken("::", CSharpTokenType.DoubleColon); + TestSingleToken("::", SyntaxKind.DoubleColon); } [Fact] public void PlusAssign_Is_Recognized() { - TestSingleToken("+=", CSharpTokenType.PlusAssign); + TestSingleToken("+=", SyntaxKind.PlusAssign); } [Fact] public void Semicolon_Is_Recognized() { - TestSingleToken(";", CSharpTokenType.Semicolon); + TestSingleToken(";", SyntaxKind.Semicolon); } [Fact] public void Tilde_Is_Recognized() { - TestSingleToken("~", CSharpTokenType.Tilde); + TestSingleToken("~", SyntaxKind.Tilde); } [Fact] public void DoubleOr_Is_Recognized() { - TestSingleToken("||", CSharpTokenType.DoubleOr); + TestSingleToken("||", SyntaxKind.DoubleOr); } [Fact] public void ModuloAssign_Is_Recognized() { - TestSingleToken("%=", CSharpTokenType.ModuloAssign); + TestSingleToken("%=", SyntaxKind.ModuloAssign); } [Fact] public void Colon_Is_Recognized() { - TestSingleToken(":", CSharpTokenType.Colon); + TestSingleToken(":", SyntaxKind.Colon); } [Fact] public void Not_Is_Recognized() { - TestSingleToken("!", CSharpTokenType.Not); + TestSingleToken("!", SyntaxKind.Not); } [Fact] public void DoubleAnd_Is_Recognized() { - TestSingleToken("&&", CSharpTokenType.DoubleAnd); + TestSingleToken("&&", SyntaxKind.DoubleAnd); } [Fact] public void DivideAssign_Is_Recognized() { - TestSingleToken("/=", CSharpTokenType.DivideAssign); + TestSingleToken("/=", SyntaxKind.DivideAssign); } [Fact] public void Comma_Is_Recognized() { - TestSingleToken(",", CSharpTokenType.Comma); + TestSingleToken(",", SyntaxKind.Comma); } [Fact] public void Xor_Is_Recognized() { - TestSingleToken("^", CSharpTokenType.Xor); + TestSingleToken("^", SyntaxKind.Xor); } [Fact] public void Decrement_Is_Recognized() { - TestSingleToken("--", CSharpTokenType.Decrement); + TestSingleToken("--", SyntaxKind.Decrement); } [Fact] public void MultiplyAssign_Is_Recognized() { - TestSingleToken("*=", CSharpTokenType.MultiplyAssign); + TestSingleToken("*=", SyntaxKind.MultiplyAssign); } [Fact] public void Dot_Is_Recognized() { - TestSingleToken(".", CSharpTokenType.Dot); + TestSingleToken(".", SyntaxKind.Dot); } [Fact] public void Or_Is_Recognized() { - TestSingleToken("|", CSharpTokenType.Or); + TestSingleToken("|", SyntaxKind.Or); } [Fact] public void Increment_Is_Recognized() { - TestSingleToken("++", CSharpTokenType.Increment); + TestSingleToken("++", SyntaxKind.Increment); } [Fact] public void MinusAssign_Is_Recognized() { - TestSingleToken("-=", CSharpTokenType.MinusAssign); + TestSingleToken("-=", SyntaxKind.MinusAssign); } [Fact] public void RightShift_Is_Not_Specially_Recognized() { TestTokenizer(">>", - new CSharpToken(">", CSharpTokenType.GreaterThan), - new CSharpToken(">", CSharpTokenType.GreaterThan)); + SyntaxFactory.Token(SyntaxKind.GreaterThan, ">"), + SyntaxFactory.Token(SyntaxKind.GreaterThan, ">")); } [Fact] public void Hash_Is_Recognized() { - TestSingleToken("#", CSharpTokenType.Hash); + TestSingleToken("#", SyntaxKind.Hash); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerTest.cs index cf98382ef4..5ee0715a7e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerTest.cs @@ -1,13 +1,14 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy { public class CSharpTokenizerTest : CSharpTokenizerTestBase { - private new CSharpToken IgnoreRemaining => (CSharpToken)base.IgnoreRemaining; + private new SyntaxToken IgnoreRemaining => (SyntaxToken)base.IgnoreRemaining; [Fact] public void Next_Returns_Null_When_EOF_Reached() @@ -20,8 +21,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "\r\ra", - new CSharpToken("\r", CSharpTokenType.NewLine), - new CSharpToken("\r", CSharpTokenType.NewLine), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r"), IgnoreRemaining); } @@ -30,8 +31,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "\n\na", - new CSharpToken("\n", CSharpTokenType.NewLine), - new CSharpToken("\n", CSharpTokenType.NewLine), + SyntaxFactory.Token(SyntaxKind.NewLine, "\n"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\n"), IgnoreRemaining); } @@ -41,8 +42,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // NEL: Unicode "Next Line" U+0085 TestTokenizer( "\u0085\u0085a", - new CSharpToken("\u0085", CSharpTokenType.NewLine), - new CSharpToken("\u0085", CSharpTokenType.NewLine), + SyntaxFactory.Token(SyntaxKind.NewLine, "\u0085"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\u0085"), IgnoreRemaining); } @@ -52,8 +53,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Unicode "Line Separator" U+2028 TestTokenizer( "\u2028\u2028a", - new CSharpToken("\u2028", CSharpTokenType.NewLine), - new CSharpToken("\u2028", CSharpTokenType.NewLine), + SyntaxFactory.Token(SyntaxKind.NewLine, "\u2028"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\u2028"), IgnoreRemaining); } @@ -63,8 +64,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Unicode "Paragraph Separator" U+2029 TestTokenizer( "\u2029\u2029a", - new CSharpToken("\u2029", CSharpTokenType.NewLine), - new CSharpToken("\u2029", CSharpTokenType.NewLine), + SyntaxFactory.Token(SyntaxKind.NewLine, "\u2029"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\u2029"), IgnoreRemaining); } @@ -73,8 +74,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "\r\n\r\na", - new CSharpToken("\r\n", CSharpTokenType.NewLine), - new CSharpToken("\r\n", CSharpTokenType.NewLine), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n"), IgnoreRemaining); } @@ -83,15 +84,15 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( " \f\t\u000B \n ", - new CSharpToken(" \f\t\u000B ", CSharpTokenType.WhiteSpace), - new CSharpToken("\n", CSharpTokenType.NewLine), - new CSharpToken(" ", CSharpTokenType.WhiteSpace)); + SyntaxFactory.Token(SyntaxKind.Whitespace, " \f\t\u000B "), + SyntaxFactory.Token(SyntaxKind.NewLine, "\n"), + SyntaxFactory.Token(SyntaxKind.Whitespace, " ")); } [Fact] public void Transition_Is_Recognized() { - TestSingleToken("@", CSharpTokenType.Transition); + TestSingleToken("@", SyntaxKind.Transition); } [Fact] @@ -99,8 +100,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "@(", - new CSharpToken("@", CSharpTokenType.Transition), - new CSharpToken("(", CSharpTokenType.LeftParenthesis)); + SyntaxFactory.Token(SyntaxKind.Transition, "@"), + SyntaxFactory.Token(SyntaxKind.LeftParenthesis, "(")); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerTestBase.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerTestBase.cs index 6869138c1e..60652e402f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerTestBase.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTokenizerTestBase.cs @@ -1,11 +1,13 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; + namespace Microsoft.AspNetCore.Razor.Language.Legacy { public abstract class CSharpTokenizerTestBase : TokenizerTestBase { - private static CSharpToken _ignoreRemaining = new CSharpToken(string.Empty, CSharpTokenType.Unknown); + private static SyntaxToken _ignoreRemaining = SyntaxFactory.Token(SyntaxKind.Unknown, string.Empty); internal override object IgnoreRemaining { @@ -17,14 +19,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return new CSharpTokenizer(source); } - internal void TestSingleToken(string text, CSharpTokenType expectedTokenType) + internal void TestSingleToken(string text, SyntaxKind expectedTokenKind) { - TestTokenizer(text, new CSharpToken(text, expectedTokenType)); - } - - internal void TestTokenizer(string input, params CSharpToken[] expectedTokens) - { - base.TestTokenizer(input, expectedTokens); + TestTokenizer(text, SyntaxFactory.Token(expectedTokenKind, text)); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/DirectiveCSharpTokenizerTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/DirectiveCSharpTokenizerTest.cs index 7a1e0c070a..55f2626925 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/DirectiveCSharpTokenizerTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/DirectiveCSharpTokenizerTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -12,12 +13,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "\r\n @something \r\n @this is ignored", - new CSharpToken("\r\n", CSharpTokenType.NewLine), - new CSharpToken(" ", CSharpTokenType.WhiteSpace), - new CSharpToken("@", CSharpTokenType.Transition), - new CSharpToken("something", CSharpTokenType.Identifier), - new CSharpToken(" ", CSharpTokenType.WhiteSpace), - new CSharpToken("\r\n", CSharpTokenType.NewLine)); + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n"), + SyntaxFactory.Token(SyntaxKind.Whitespace, " "), + SyntaxFactory.Token(SyntaxKind.Transition, "@"), + SyntaxFactory.Token(SyntaxKind.Identifier, "something"), + SyntaxFactory.Token(SyntaxKind.Whitespace, " "), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n")); } [Fact] @@ -25,18 +26,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "@*included*@\r\n @something \"value\"\r\n @this is ignored", - new CSharpToken("@", CSharpTokenType.RazorCommentTransition), - new CSharpToken("*", CSharpTokenType.RazorCommentStar), - new CSharpToken("included", CSharpTokenType.RazorComment), - new CSharpToken("*", CSharpTokenType.RazorCommentStar), - new CSharpToken("@", CSharpTokenType.RazorCommentTransition), - new CSharpToken("\r\n", CSharpTokenType.NewLine), - new CSharpToken(" ", CSharpTokenType.WhiteSpace), - new CSharpToken("@", CSharpTokenType.Transition), - new CSharpToken("something", CSharpTokenType.Identifier), - new CSharpToken(" ", CSharpTokenType.WhiteSpace), - new CSharpToken("\"value\"", CSharpTokenType.StringLiteral), - new CSharpToken("\r\n", CSharpTokenType.NewLine)); + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorComment, "included"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n"), + SyntaxFactory.Token(SyntaxKind.Whitespace, " "), + SyntaxFactory.Token(SyntaxKind.Transition, "@"), + SyntaxFactory.Token(SyntaxKind.Identifier, "something"), + SyntaxFactory.Token(SyntaxKind.Whitespace, " "), + SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"value\""), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n")); } internal override object CreateTokenizer(ITextDocument source) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/DirectiveHtmlTokenizerTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/DirectiveHtmlTokenizerTest.cs index cffd0a0d0d..0df36e7a81 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/DirectiveHtmlTokenizerTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/DirectiveHtmlTokenizerTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -12,9 +13,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "\r\n
Ignored
", - new HtmlToken("\r\n", HtmlTokenType.NewLine), - new HtmlToken(" ", HtmlTokenType.WhiteSpace), - new HtmlToken("<", HtmlTokenType.OpenAngle)); + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n"), + SyntaxFactory.Token(SyntaxKind.Whitespace, " "), + SyntaxFactory.Token(SyntaxKind.OpenAngle, "<")); } [Fact] @@ -22,15 +23,15 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "\r\n @*included*@
Ignored
", - new HtmlToken("\r\n", HtmlTokenType.NewLine), - new HtmlToken(" ", HtmlTokenType.WhiteSpace), - new HtmlToken("@", HtmlTokenType.RazorCommentTransition), - new HtmlToken("*", HtmlTokenType.RazorCommentStar), - new HtmlToken("included", HtmlTokenType.RazorComment), - new HtmlToken("*", HtmlTokenType.RazorCommentStar), - new HtmlToken("@", HtmlTokenType.RazorCommentTransition), - new HtmlToken(" ", HtmlTokenType.WhiteSpace), - new HtmlToken("<", HtmlTokenType.OpenAngle)); + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n"), + SyntaxFactory.Token(SyntaxKind.Whitespace, " "), + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorComment, "included"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.Whitespace, " "), + SyntaxFactory.Token(SyntaxKind.OpenAngle, "<")); } internal override object CreateTokenizer(ITextDocument source) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlMarkupParserTests.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlMarkupParserTests.cs index 839eb92353..7a08ee0e0f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlMarkupParserTests.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlMarkupParserTests.cs @@ -2,23 +2,24 @@ using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Razor.Language.Legacy; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy { public class HtmlMarkupParserTests { - private static readonly HtmlToken doubleHyphenToken = new HtmlToken("--", HtmlTokenType.DoubleHyphen); + private static readonly SyntaxToken doubleHyphenToken = SyntaxFactory.Token(SyntaxKind.DoubleHyphen, "--"); public static IEnumerable NonDashTokens { get { - yield return new[] { new HtmlToken("--", HtmlTokenType.DoubleHyphen) }; - yield return new[] { new HtmlToken("asdf", HtmlTokenType.Text) }; - yield return new[] { new HtmlToken(">", HtmlTokenType.CloseAngle) }; - yield return new[] { new HtmlToken("<", HtmlTokenType.OpenAngle) }; - yield return new[] { new HtmlToken("!", HtmlTokenType.Bang) }; + yield return new[] { SyntaxFactory.Token(SyntaxKind.DoubleHyphen, "--") }; + yield return new[] { SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "asdf") }; + yield return new[] { SyntaxFactory.Token(SyntaxKind.CloseAngle, ">") }; + yield return new[] { SyntaxFactory.Token(SyntaxKind.OpenAngle, "<") }; + yield return new[] { SyntaxFactory.Token(SyntaxKind.Bang, "!") }; } } @@ -27,7 +28,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy public void IsHyphen_ReturnsFalseForNonDashToken(object token) { // Arrange - var convertedToken = (HtmlToken)token; + var convertedToken = (SyntaxToken)token; // Act & Assert Assert.False(HtmlMarkupParser.IsHyphen(convertedToken)); @@ -37,7 +38,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy public void IsHyphen_ReturnsTrueForADashToken() { // Arrange - var dashToken = new HtmlToken("-", HtmlTokenType.Text); + var dashToken = SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "-"); // Act & Assert Assert.True(HtmlMarkupParser.IsHyphen(dashToken)); @@ -53,9 +54,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy var token = sut.AcceptAllButLastDoubleHyphens(); // Assert - Assert.Equal(doubleHyphenToken, token); - Assert.True(sut.At(HtmlTokenType.CloseAngle)); - Assert.Equal(doubleHyphenToken, sut.PreviousToken); + Assert.True(doubleHyphenToken.IsEquivalentTo(token)); + Assert.True(sut.At(SyntaxKind.CloseAngle)); + Assert.True(doubleHyphenToken.IsEquivalentTo(sut.PreviousToken)); } [Fact] @@ -68,8 +69,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy var token = sut.AcceptAllButLastDoubleHyphens(); // Assert - Assert.Equal(doubleHyphenToken, token); - Assert.True(sut.At(HtmlTokenType.CloseAngle)); + Assert.True(doubleHyphenToken.IsEquivalentTo(token)); + Assert.True(sut.At(SyntaxKind.CloseAngle)); Assert.True(HtmlMarkupParser.IsHyphen(sut.PreviousToken)); } @@ -157,8 +158,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy public void IsCommentContentEndingInvalid_ReturnsFalseForAllowedContent() { // Arrange - var expectedToken1 = new HtmlToken("a", HtmlTokenType.Text); - var sequence = Enumerable.Range((int)'a', 26).Select(item => new HtmlToken(((char)item).ToString(), HtmlTokenType.Text)); + var expectedToken1 = SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "a"); + var sequence = Enumerable.Range((int)'a', 26).Select(item => SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, ((char)item).ToString())); // Act & Assert Assert.False(HtmlMarkupParser.IsCommentContentEndingInvalid(sequence)); @@ -168,8 +169,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy public void IsCommentContentEndingInvalid_ReturnsTrueForDisallowedContent() { // Arrange - var expectedToken1 = new HtmlToken("a", HtmlTokenType.Text); - var sequence = new[] { new HtmlToken("<", HtmlTokenType.OpenAngle), new HtmlToken("!", HtmlTokenType.Bang), new HtmlToken("-", HtmlTokenType.Text) }; + var expectedToken1 = SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "a"); + var sequence = new[] + { + SyntaxFactory.Token(SyntaxKind.OpenAngle, "<"), + SyntaxFactory.Token(SyntaxKind.Bang, "!"), + SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "-") + }; // Act & Assert Assert.True(HtmlMarkupParser.IsCommentContentEndingInvalid(sequence)); @@ -179,8 +185,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy public void IsCommentContentEndingInvalid_ReturnsFalseForEmptyContent() { // Arrange - var expectedToken1 = new HtmlToken("a", HtmlTokenType.Text); - var sequence = Array.Empty(); + var expectedToken1 = SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "a"); + var sequence = Array.Empty(); // Act & Assert Assert.False(HtmlMarkupParser.IsCommentContentEndingInvalid(sequence)); @@ -188,7 +194,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy private class TestHtmlMarkupParser : HtmlMarkupParser { - public new HtmlToken PreviousToken + public new SyntaxToken PreviousToken { get => base.PreviousToken; } @@ -203,7 +209,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy this.EnsureCurrent(); } - public new HtmlToken AcceptAllButLastDoubleHyphens() + public new SyntaxToken AcceptAllButLastDoubleHyphens() { return base.AcceptAllButLastDoubleHyphens(); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlTokenizerTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlTokenizerTest.cs index 9b54d75957..472e64e28e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlTokenizerTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlTokenizerTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -17,113 +18,113 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void Text_Is_Recognized() { TestTokenizer("foo-9309&smlkmb;::-3029022,.sdkq92384", - new HtmlToken("foo-9309&smlkmb;::-3029022,.sdkq92384", HtmlTokenType.Text)); + SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "foo-9309&smlkmb;::-3029022,.sdkq92384")); } [Fact] public void Whitespace_Is_Recognized() { TestTokenizer(" \t\f ", - new HtmlToken(" \t\f ", HtmlTokenType.WhiteSpace)); + SyntaxFactory.Token(SyntaxKind.Whitespace, " \t\f ")); } [Fact] public void Newline_Is_Recognized() { TestTokenizer("\n\r\r\n", - new HtmlToken("\n", HtmlTokenType.NewLine), - new HtmlToken("\r", HtmlTokenType.NewLine), - new HtmlToken("\r\n", HtmlTokenType.NewLine)); + SyntaxFactory.Token(SyntaxKind.NewLine, "\n"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r"), + SyntaxFactory.Token(SyntaxKind.NewLine, "\r\n")); } [Fact] public void Transition_Is_Not_Recognized_Mid_Text_If_Surrounded_By_Alphanumeric_Characters() { - TestSingleToken("foo@bar", HtmlTokenType.Text); + TestSingleToken("foo@bar", SyntaxKind.HtmlTextLiteral); } [Fact] public void OpenAngle_Is_Recognized() { - TestSingleToken("<", HtmlTokenType.OpenAngle); + TestSingleToken("<", SyntaxKind.OpenAngle); } [Fact] public void Bang_Is_Recognized() { - TestSingleToken("!", HtmlTokenType.Bang); + TestSingleToken("!", SyntaxKind.Bang); } [Fact] public void Solidus_Is_Recognized() { - TestSingleToken("/", HtmlTokenType.ForwardSlash); + TestSingleToken("/", SyntaxKind.ForwardSlash); } [Fact] public void QuestionMark_Is_Recognized() { - TestSingleToken("?", HtmlTokenType.QuestionMark); + TestSingleToken("?", SyntaxKind.QuestionMark); } [Fact] public void LeftBracket_Is_Recognized() { - TestSingleToken("[", HtmlTokenType.LeftBracket); + TestSingleToken("[", SyntaxKind.LeftBracket); } [Fact] public void CloseAngle_Is_Recognized() { - TestSingleToken(">", HtmlTokenType.CloseAngle); + TestSingleToken(">", SyntaxKind.CloseAngle); } [Fact] public void RightBracket_Is_Recognized() { - TestSingleToken("]", HtmlTokenType.RightBracket); + TestSingleToken("]", SyntaxKind.RightBracket); } [Fact] public void Equals_Is_Recognized() { - TestSingleToken("=", HtmlTokenType.Equals); + TestSingleToken("=", SyntaxKind.Equals); } [Fact] public void DoubleQuote_Is_Recognized() { - TestSingleToken("\"", HtmlTokenType.DoubleQuote); + TestSingleToken("\"", SyntaxKind.DoubleQuote); } [Fact] public void SingleQuote_Is_Recognized() { - TestSingleToken("'", HtmlTokenType.SingleQuote); + TestSingleToken("'", SyntaxKind.SingleQuote); } [Fact] public void Transition_Is_Recognized() { - TestSingleToken("@", HtmlTokenType.Transition); + TestSingleToken("@", SyntaxKind.Transition); } [Fact] public void DoubleHyphen_Is_Recognized() { - TestSingleToken("--", HtmlTokenType.DoubleHyphen); + TestSingleToken("--", SyntaxKind.DoubleHyphen); } [Fact] public void SingleHyphen_Is_Not_Recognized() { - TestSingleToken("-", HtmlTokenType.Text); + TestSingleToken("-", SyntaxKind.HtmlTextLiteral); } [Fact] public void SingleHyphen_Mid_Text_Is_Not_Recognized_As_Separate_Token() { - TestSingleToken("foo-bar", HtmlTokenType.Text); + TestSingleToken("foo-bar", SyntaxKind.HtmlTextLiteral); } [Fact] @@ -131,9 +132,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "@* Foo * Bar * Baz *", - new HtmlToken("@", HtmlTokenType.RazorCommentTransition), - new HtmlToken("*", HtmlTokenType.RazorCommentStar), - new HtmlToken(" Foo * Bar * Baz *", HtmlTokenType.RazorComment)); + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorComment, " Foo * Bar * Baz *")); } [Fact] @@ -141,11 +142,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "@* Foo * Bar * Baz *@", - new HtmlToken("@", HtmlTokenType.RazorCommentTransition), - new HtmlToken("*", HtmlTokenType.RazorCommentStar), - new HtmlToken(" Foo * Bar * Baz ", HtmlTokenType.RazorComment), - new HtmlToken("*", HtmlTokenType.RazorCommentStar), - new HtmlToken("@", HtmlTokenType.RazorCommentTransition)); + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorComment, " Foo * Bar * Baz "), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@")); } [Fact] @@ -153,11 +154,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { TestTokenizer( "@* Foo Bar Baz *@", - new HtmlToken("@", HtmlTokenType.RazorCommentTransition), - new HtmlToken("*", HtmlTokenType.RazorCommentStar), - new HtmlToken(" Foo Bar Baz ", HtmlTokenType.RazorComment), - new HtmlToken("*", HtmlTokenType.RazorCommentStar), - new HtmlToken("@", HtmlTokenType.RazorCommentTransition)); + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@"), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorComment, " Foo Bar Baz "), + SyntaxFactory.Token(SyntaxKind.RazorCommentStar, "*"), + SyntaxFactory.Token(SyntaxKind.RazorCommentTransition, "@")); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlTokenizerTestBase.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlTokenizerTestBase.cs index 6416496b32..76762e5bed 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlTokenizerTestBase.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlTokenizerTestBase.cs @@ -1,11 +1,13 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; + namespace Microsoft.AspNetCore.Razor.Language.Legacy { public abstract class HtmlTokenizerTestBase : TokenizerTestBase { - private static HtmlToken _ignoreRemaining = new HtmlToken(string.Empty, HtmlTokenType.Unknown); + private static SyntaxToken _ignoreRemaining = SyntaxFactory.Token(SyntaxKind.Unknown, string.Empty); internal override object IgnoreRemaining { @@ -17,14 +19,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return new HtmlTokenizer(source); } - internal void TestSingleToken(string text, HtmlTokenType expectedTokenType) + internal void TestSingleToken(string text, SyntaxKind expectedTokenKind) { - TestTokenizer(text, new HtmlToken(text, expectedTokenType)); - } - - internal void TestTokenizer(string input, params HtmlToken[] expectedTokens) - { - base.TestTokenizer(input, expectedTokens); + TestTokenizer(text, SyntaxFactory.Token(expectedTokenKind, text)); } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/ImplicitExpressionEditHandlerTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/ImplicitExpressionEditHandlerTest.cs index f96e7920af..2b3d8aa457 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/ImplicitExpressionEditHandlerTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/ImplicitExpressionEditHandlerTest.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; +using Microsoft.AspNetCore.Razor.Language.Syntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -159,7 +160,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_SingleLeftParenthesis_CountsCorrectly() { // Arrange - var token = new CSharpToken("(", CSharpTokenType.LeftParenthesis); + var token = SyntaxFactory.Token(SyntaxKind.LeftParenthesis, "("); var count = 0; // Act @@ -174,7 +175,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_SingleRightParenthesis_CountsCorrectly() { // Arrange - var token = new CSharpToken(")", CSharpTokenType.RightParenthesis); + var token = SyntaxFactory.Token(SyntaxKind.RightParenthesis, ")"); var count = 2; // Act @@ -189,7 +190,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_IncompleteStringLiteral_CountsCorrectly() { // Arrange - var token = new CSharpToken("\"((", CSharpTokenType.StringLiteral); + var token = SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"(("); var count = 2; // Act @@ -204,7 +205,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_IncompleteCharacterLiteral_CountsCorrectly() { // Arrange - var token = new CSharpToken("'((", CSharpTokenType.CharacterLiteral); + var token = SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "'(("); var count = 2; // Act @@ -219,7 +220,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_CompleteStringLiteral_CountsCorrectly() { // Arrange - var token = new CSharpToken("\"((\"", CSharpTokenType.StringLiteral); + var token = SyntaxFactory.Token(SyntaxKind.StringLiteral, "\"((\""); var count = 2; // Act @@ -234,7 +235,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_CompleteCharacterLiteral_CountsCorrectly() { // Arrange - var token = new CSharpToken("'('", CSharpTokenType.CharacterLiteral); + var token = SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "'('"); var count = 2; // Act @@ -249,7 +250,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_InvalidParenthesis_ReturnsFalse() { // Arrange - var token = new CSharpToken(")", CSharpTokenType.RightParenthesis); + var token = SyntaxFactory.Token(SyntaxKind.RightParenthesis, ")"); var count = 0; // Act @@ -264,7 +265,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_InvalidParenthesisStringLiteral_ReturnsFalse() { // Arrange - var token = new CSharpToken("\")", CSharpTokenType.StringLiteral); + var token = SyntaxFactory.Token(SyntaxKind.StringLiteral, "\")"); var count = 0; // Act @@ -279,7 +280,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public void TryUpdateBalanceCount_InvalidParenthesisCharacterLiteral_ReturnsFalse() { // Arrange - var token = new CSharpToken("')", CSharpTokenType.CharacterLiteral); + var token = SyntaxFactory.Token(SyntaxKind.CharacterLiteral, "')"); var count = 0; // Act @@ -453,11 +454,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return span; } - private static IReadOnlyList GetTokens(SourceLocation start, string content) + private static IReadOnlyList GetTokens(SourceLocation start, string content) { var parent = GetSpan(start, content); - var tokens = parent.Tokens.Cast().ToArray(); - return tokens; + return parent.Tokens; } } } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/SpanTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/SpanTest.cs index 96c856848c..c9c4a6493f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/SpanTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/SpanTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -12,10 +13,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { // Arrange var builder = new SpanBuilder(SourceLocation.Zero); - builder.Accept(new HtmlToken("hello", HtmlTokenType.Text)); + builder.Accept(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "hello")); var span = builder.Build(); var newBuilder = new SpanBuilder(SourceLocation.Zero); - newBuilder.Accept(new HtmlToken("hi", HtmlTokenType.Text)); + newBuilder.Accept(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "hi")); var originalLength = span.Length; // Act @@ -33,7 +34,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { // Arrange var spanBuilder = new SpanBuilder(SourceLocation.Zero); - spanBuilder.Accept(new HtmlToken("hello", HtmlTokenType.Text)); + spanBuilder.Accept(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "hello")); var span = spanBuilder.Build(); var blockBuilder = new BlockBuilder() { @@ -44,7 +45,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy span.Parent = block; var originalBlockLength = block.Length; var newSpanBuilder = new SpanBuilder(SourceLocation.Zero); - newSpanBuilder.Accept(new HtmlToken("hi", HtmlTokenType.Text)); + newSpanBuilder.Accept(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "hi")); // Act span.ReplaceWith(newSpanBuilder); @@ -64,7 +65,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy Kind = SpanKindInternal.Transition, ChunkGenerator = new ExpressionChunkGenerator(), }; - spanBuilder.Accept(new CSharpToken("@", CSharpTokenType.Transition)); + spanBuilder.Accept(SyntaxFactory.Token(SyntaxKind.Transition, "@")); var span = spanBuilder.Build(); // Act diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TokenizerLookaheadTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TokenizerLookaheadTest.cs index 23a1df23dc..fda3b93565 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TokenizerLookaheadTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TokenizerLookaheadTest.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -64,7 +65,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Act var i = 3; - IEnumerable previousTokens = null; + IEnumerable previousTokens = null; var tokenFound = tokenizer.LookaheadUntil((s, p) => { previousTokens = p; @@ -77,9 +78,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // For the very first element, there will be no previous items, so null is expected var orderIndex = 0; Assert.Null(previousTokens.ElementAt(orderIndex++)); - Assert.Equal(new HtmlToken("asdf", HtmlTokenType.Text), previousTokens.ElementAt(orderIndex++)); - Assert.Equal(new HtmlToken("--", HtmlTokenType.DoubleHyphen), previousTokens.ElementAt(orderIndex++)); - Assert.Equal(new HtmlToken("fvd", HtmlTokenType.Text), previousTokens.ElementAt(orderIndex++)); + AssertTokenEqual(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "asdf"), previousTokens.ElementAt(orderIndex++)); + AssertTokenEqual(SyntaxFactory.Token(SyntaxKind.DoubleHyphen, "--"), previousTokens.ElementAt(orderIndex++)); + AssertTokenEqual(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "fvd"), previousTokens.ElementAt(orderIndex++)); } [Fact] @@ -89,7 +90,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var tokenizer = CreateContentTokenizer("asdf--fvd"); // Act - var tokens = new Stack(); + var tokens = new Stack(); var tokenFound = tokenizer.LookaheadUntil((s, p) => { tokens.Push(s); @@ -99,9 +100,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Assert Assert.False(tokenFound); Assert.Equal(3, tokens.Count); - Assert.Equal(new HtmlToken("fvd", HtmlTokenType.Text), tokens.Pop()); - Assert.Equal(new HtmlToken("--", HtmlTokenType.DoubleHyphen), tokens.Pop()); - Assert.Equal(new HtmlToken("asdf", HtmlTokenType.Text), tokens.Pop()); + AssertTokenEqual(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "fvd"), tokens.Pop()); + AssertTokenEqual(SyntaxFactory.Token(SyntaxKind.DoubleHyphen, "--"), tokens.Pop()); + AssertTokenEqual(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "asdf"), tokens.Pop()); } [Fact] @@ -111,18 +112,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy var tokenizer = CreateContentTokenizer("asdf--fvd"); // Act - var tokens = new Stack(); + var tokens = new Stack(); var tokenFound = tokenizer.LookaheadUntil((s, p) => { tokens.Push(s); - return s.Type == HtmlTokenType.DoubleHyphen; + return s.Kind == SyntaxKind.DoubleHyphen; }); // Assert Assert.True(tokenFound); Assert.Equal(2, tokens.Count); - Assert.Equal(new HtmlToken("--", HtmlTokenType.DoubleHyphen), tokens.Pop()); - Assert.Equal(new HtmlToken("asdf", HtmlTokenType.Text), tokens.Pop()); + AssertTokenEqual(SyntaxFactory.Token(SyntaxKind.DoubleHyphen, "--"), tokens.Pop()); + AssertTokenEqual(SyntaxFactory.Token(SyntaxKind.HtmlTextLiteral, "asdf"), tokens.Pop()); } private static TestTokenizerBackedParser CreateContentTokenizer(string content) @@ -135,7 +136,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy return tokenizer; } - private class ExposedTokenizer : Tokenizer + private static void AssertTokenEqual(SyntaxToken expected, SyntaxToken actual) + { + Assert.True(expected.IsEquivalentTo(actual), "Tokens not equal."); + } + + private class ExposedTokenizer : Tokenizer { public ExposedTokenizer(string input) : base(new SeekableTextReader(input, filePath: null)) @@ -150,7 +156,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - public override CSharpTokenType RazorCommentStarType + public override SyntaxKind RazorCommentStarKind { get { @@ -158,7 +164,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - public override CSharpTokenType RazorCommentTransitionType + public override SyntaxKind RazorCommentTransitionKind { get { @@ -166,7 +172,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - public override CSharpTokenType RazorCommentType + public override SyntaxKind RazorCommentKind { get { @@ -182,9 +188,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - protected override CSharpToken CreateToken( + protected override SyntaxToken CreateToken( string content, - CSharpTokenType type, + SyntaxKind type, IReadOnlyList errors) { throw new NotImplementedException(); @@ -196,9 +202,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - private class TestTokenizerBackedParser : TokenizerBackedParser + private class TestTokenizerBackedParser : TokenizerBackedParser { - internal TestTokenizerBackedParser(LanguageCharacteristics language, ParserContext context) : base(language, context) + internal TestTokenizerBackedParser(LanguageCharacteristics language, ParserContext context) : base(language, context) { } @@ -207,12 +213,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy throw new NotImplementedException(); } - protected override bool TokenTypeEquals(HtmlTokenType x, HtmlTokenType y) + protected override bool TokenKindEquals(SyntaxKind x, SyntaxKind y) { throw new NotImplementedException(); } - internal new bool LookaheadUntil(Func, bool> condition) + internal new bool LookaheadUntil(Func, bool> condition) { return base.LookaheadUntil(condition); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TokenizerTestBase.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TokenizerTestBase.cs index 307ccad3a7..21ccddba3b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TokenizerTestBase.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TokenizerTestBase.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics; using System.Text; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy @@ -13,18 +14,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy internal abstract object IgnoreRemaining { get; } internal abstract object CreateTokenizer(ITextDocument source); - internal void TestTokenizer(string input, params TSymbol[] expectedSymbols) - where TSymbolType : struct - where TSymbol : TokenBase + internal void TestTokenizer(string input, params SyntaxToken[] expectedSymbols) { // Arrange var success = true; var output = new StringBuilder(); using (var source = new SeekableTextReader(input, filePath: null)) { - var tokenizer = (Tokenizer)CreateTokenizer(source); + var tokenizer = (Tokenizer)CreateTokenizer(source); var counter = 0; - TSymbol current = null; + SyntaxToken current = null; while ((current = tokenizer.NextToken()) != null) { if (counter >= expectedSymbols.Length) @@ -34,11 +33,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } else if (ReferenceEquals(expectedSymbols[counter], IgnoreRemaining)) { - output.AppendLine(string.Format("P: Ignored {0}", current)); + output.AppendLine(string.Format("P: Ignored |{0}|", current)); } else { - if (!Equals(expectedSymbols[counter], current)) + if (!expectedSymbols[counter].IsEquivalentTo(current)) { output.AppendLine(string.Format("F: Expected: {0}; Actual: {1}", expectedSymbols[counter], current)); success = false; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/SourceChangeTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/SourceChangeTest.cs index 470b69720a..d569974b67 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/SourceChangeTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/SourceChangeTest.cs @@ -3,6 +3,7 @@ using System; using Microsoft.AspNetCore.Razor.Language.Legacy; +using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax; using Xunit; namespace Microsoft.AspNetCore.Razor.Language @@ -104,8 +105,8 @@ namespace Microsoft.AspNetCore.Razor.Language { // Arrange var builder = new SpanBuilder(new SourceLocation(0, 0, 0)); - builder.Accept(new RawTextToken(new SourceLocation(0, 0, 0), "Hello, ")); - builder.Accept(new RawTextToken(new SourceLocation(7, 0, 7), "World")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "Hello, ")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "World")); var span = new Span(builder); @@ -123,8 +124,8 @@ namespace Microsoft.AspNetCore.Razor.Language { // Arrange var builder = new SpanBuilder(new SourceLocation(13, 0, 0)); - builder.Accept(new RawTextToken(new SourceLocation(13, 0, 13), "Hello, ")); - builder.Accept(new RawTextToken(new SourceLocation(20, 0, 20), "World")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "Hello, ")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "World")); var span = new Span(builder); @@ -142,8 +143,8 @@ namespace Microsoft.AspNetCore.Razor.Language { // Arrange var builder = new SpanBuilder(new SourceLocation(13, 0, 0)); - builder.Accept(new RawTextToken(new SourceLocation(13, 0, 13), "Hello, ")); - builder.Accept(new RawTextToken(new SourceLocation(20, 0, 20), "World")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "Hello, ")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "World")); var span = new Span(builder); @@ -161,8 +162,8 @@ namespace Microsoft.AspNetCore.Razor.Language { // Arrange var builder = new SpanBuilder(new SourceLocation(13, 0, 0)); - builder.Accept(new RawTextToken(new SourceLocation(13, 0, 13), "Hello, ")); - builder.Accept(new RawTextToken(new SourceLocation(20, 0, 20), "World")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "Hello, ")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "World")); var span = new Span(builder); @@ -180,8 +181,8 @@ namespace Microsoft.AspNetCore.Razor.Language { // Arrange var builder = new SpanBuilder(new SourceLocation(13, 0, 0)); - builder.Accept(new RawTextToken(new SourceLocation(13, 0, 13), "Hello, ")); - builder.Accept(new RawTextToken(new SourceLocation(20, 0, 20), "World")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "Hello, ")); + builder.Accept(SyntaxFactory.Token(SyntaxKind.Unknown, "World")); var span = new Span(builder); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.stree.txt index 4d7733a74b..96c1e627ca 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 11 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [functions] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[functions]; + SyntaxKind.Identifier;[functions]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (10:0,10) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [] - CodeBlockEditHandler;Accepts:Any;CodeBlock - (11:0,11) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.stree.txt index 18a654401d..62f1357ad5 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.stree.txt @@ -1,10 +1,10 @@ Directive block - Gen - 16 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [functions] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[functions]; + SyntaxKind.Identifier;[functions]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (10:0,10) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [LFfoo] - CodeBlockEditHandler;Accepts:Any;CodeBlock - (11:0,11) - Tokens:2 - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[foo]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.stree.txt index 25e7638666..2fa1260312 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.stree.txt @@ -1,16 +1,16 @@ Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Header] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[Header]; + SyntaxKind.Identifier;[Header]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (16:0,16) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 0 - (17:0,17) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.stree.txt index d59300fc29..b72e31e696 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.stree.txt @@ -1,29 +1,29 @@ Directive block - Gen - 29 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Header] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[Header]; + SyntaxKind.Identifier;[Header]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (16:0,16) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (17:0,17) Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Tag block - Gen - 3 - (19:1,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (19:1,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [Foo] - [22..25) - FullWidth: 3 - Slots: 1 - SyntaxKind.HtmlTextLiteralToken;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (25:1,6) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (25:1,6) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/VerbatimBlockAutoCompleteAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/VerbatimBlockAutoCompleteAtEOF.stree.txt index 5c1bcb1c4a..b2da8414ab 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/VerbatimBlockAutoCompleteAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/VerbatimBlockAutoCompleteAtEOF.stree.txt @@ -1,7 +1,7 @@ Statement block - Gen - 2 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[}];AtEOL - (2:0,2) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/VerbatimBlockAutoCompleteAtStartOfFile.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/VerbatimBlockAutoCompleteAtStartOfFile.stree.txt index 9be89463a8..c1da7bb08d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/VerbatimBlockAutoCompleteAtStartOfFile.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpAutoCompleteTest/VerbatimBlockAutoCompleteAtStartOfFile.stree.txt @@ -1,21 +1,21 @@ Statement block - Gen - 11 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [LF] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[}];AtEOL - (2:0,2) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup block - Gen - 7 - (4:1,0) Tag block - Gen - 3 - (4:1,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (4:1,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Tag block - Gen - 4 - (7:1,3) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (7:1,3) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (11:1,7) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AcceptsElseIfWithNoCondition.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AcceptsElseIfWithNoCondition.stree.txt index 7b74209f11..868839ebf6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AcceptsElseIfWithNoCondition.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AcceptsElseIfWithNoCondition.stree.txt @@ -1,60 +1,60 @@ Statement block - Gen - 106 - (0:0,0) Code span - Gen - [if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"foo } bar");LF} else if { foo(); }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:58 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AcceptsTrailingDotIntoImplicitExpressionWhenEmbeddedInCode.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AcceptsTrailingDotIntoImplicitExpressionWhenEmbeddedInCode.stree.txt index a32c45341c..5ea684fd05 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AcceptsTrailingDotIntoImplicitExpressionWhenEmbeddedInCode.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AcceptsTrailingDotIntoImplicitExpressionWhenEmbeddedInCode.stree.txt @@ -1,18 +1,18 @@ Statement block - Gen - 17 - (0:0,0) Code span - Gen - [if(foo) { ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:7 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 5 - (10:0,10) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (10:0,10) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[ATD];K14 - (11:0,11) - Tokens:2 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; Code span - Gen - [ }] - SpanEditHandler;Accepts:Any - (15:0,15) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AllowsEmptyBlockStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AllowsEmptyBlockStatement.stree.txt index 78000ba7a0..e52cb3277b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AllowsEmptyBlockStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/AllowsEmptyBlockStatement.stree.txt @@ -1,10 +1,10 @@ Statement block - Gen - 13 - (0:0,0) Code span - Gen - [if(false) { }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:8 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/BalancingBracketsIgnoresStringLiteralCharactersAndBrackets.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/BalancingBracketsIgnoresStringLiteralCharactersAndBrackets.stree.txt index e2a2903cf4..6fa6c5ed36 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/BalancingBracketsIgnoresStringLiteralCharactersAndBrackets.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/BalancingBracketsIgnoresStringLiteralCharactersAndBrackets.stree.txt @@ -1,19 +1,19 @@ Statement block - Gen - 47 - (0:0,0) Code span - Gen - [if(foo) {LF // bar } " baz 'LF zoop();LF}] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:17 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[// bar } " baz ']; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[zoop]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[// bar } " baz ']; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[zoop]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/BalancingBracketsIgnoresStringLiteralCharactersAndBracketsInsideBlockComments.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/BalancingBracketsIgnoresStringLiteralCharactersAndBracketsInsideBlockComments.stree.txt index f9d3e2b176..7d34a81381 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/BalancingBracketsIgnoresStringLiteralCharactersAndBracketsInsideBlockComments.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/BalancingBracketsIgnoresStringLiteralCharactersAndBracketsInsideBlockComments.stree.txt @@ -1,21 +1,21 @@ Statement block - Gen - 54 - (0:0,0) Code span - Gen - [if(foo) {LF /* bar } " */ ' baz } 'LF zoop();LF}] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:19 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* bar } " */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.CharacterLiteral;[' baz } ']; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[zoop]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* bar } " */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CharacterLiteral;[' baz } ']; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[zoop]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt index 4f557730af..6b754ce0a0 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt @@ -1,6 +1,6 @@ Directive block - Gen - 11 - (0:0,0) Code span - Gen - [using FooLF] - SpanEditHandler;Accepts:AnyExceptNewline - (0:0,0) - Tokens:4 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlock.stree.txt index b30314d849..ead956f330 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlock.stree.txt @@ -1,26 +1,26 @@ Statement block - Gen - 40 - (0:0,0) Code span - Gen - [do { var foo = bar; } while(foo != bar);] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:24 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingSemicolon.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingSemicolon.stree.txt index ca898906ac..e7b6d30e06 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingSemicolon.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingSemicolon.stree.txt @@ -1,25 +1,25 @@ Statement block - Gen - 39 - (0:0,0) Code span - Gen - [do { var foo = bar; } while(foo != bar)] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:23 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely.stree.txt index ba8d12a4e0..45a35ab1d6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely.stree.txt @@ -1,16 +1,16 @@ Statement block - Gen - 21 - (0:0,0) Code span - Gen - [do { var foo = bar; }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:14 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileCondition.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileCondition.stree.txt index f5ab356933..acc83fbd92 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileCondition.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileCondition.stree.txt @@ -1,18 +1,18 @@ Statement block - Gen - 27 - (0:0,0) Code span - Gen - [do { var foo = bar; } while] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:16 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon.stree.txt index e93c870c6f..84dbbd25a4 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon.stree.txt @@ -1,19 +1,19 @@ Statement block - Gen - 28 - (0:0,0) Code span - Gen - [do { var foo = bar; } while;] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:17 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesMarkupInDoWhileBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesMarkupInDoWhileBlock.stree.txt index ea36eb7e97..0a727dbe47 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesMarkupInDoWhileBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesMarkupInDoWhileBlock.stree.txt @@ -1,50 +1,50 @@ Statement block - Gen - 58 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [do { var foo = bar;] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:12 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; Markup block - Gen - 12 - (20:0,20) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (20:0,20) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (21:0,21) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Foo] - SpanEditHandler;Accepts:Any - (24:0,24) - Tokens:1 - HtmlTokenType.Text;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (27:0,27) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (27:0,27) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (31:0,31) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo++; } while (foo);] - SpanEditHandler;Accepts:None - (32:0,32) - Tokens:15 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Increment;[++]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Increment;[++]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesNotAllowMultipleFinallyBlocks.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesNotAllowMultipleFinallyBlocks.stree.txt index c9a0cb5fa2..8ae4de426a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesNotAllowMultipleFinallyBlocks.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesNotAllowMultipleFinallyBlocks.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 55 - (0:0,0) Code span - Gen - [try { var foo = new { } } finally { var foo = new { } }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesNotParseOnSwitchCharacterNotFollowedByOpenAngleOrColon.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesNotParseOnSwitchCharacterNotFollowedByOpenAngleOrColon.stree.txt index 7eb0dd4ec7..a2187f4354 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesNotParseOnSwitchCharacterNotFollowedByOpenAngleOrColon.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesNotParseOnSwitchCharacterNotFollowedByOpenAngleOrColon.stree.txt @@ -1,17 +1,17 @@ Statement block - Gen - 30 - (0:0,0) Code span - Gen - [if(foo) { @"Foo".ToString(); }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:15 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;[@"Foo"]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ToString]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;[@"Foo"]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ToString]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesntCaptureWhitespaceAfterUsing.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesntCaptureWhitespaceAfterUsing.stree.txt index 5c5013b233..955f9551aa 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesntCaptureWhitespaceAfterUsing.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/DoesntCaptureWhitespaceAfterUsing.stree.txt @@ -1,5 +1,5 @@ Directive block - Gen - 9 - (0:0,0) Code span - Gen - [using Foo] - SpanEditHandler;Accepts:AnyExceptNewline - (0:0,0) - Tokens:3 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/HasErrorsIfNamespaceAliasMissingSemicolon.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/HasErrorsIfNamespaceAliasMissingSemicolon.stree.txt index ceb649cba3..d2ea231421 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/HasErrorsIfNamespaceAliasMissingSemicolon.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/HasErrorsIfNamespaceAliasMissingSemicolon.stree.txt @@ -1,13 +1,13 @@ Directive block - Gen - 29 - (0:0,0) Code span - Gen - [using Foo.Bar.Baz = FooBarBaz] - SpanEditHandler;Accepts:AnyExceptNewline - (0:0,0) - Tokens:11 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[FooBarBaz]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[FooBarBaz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/HasErrorsIfNamespaceImportMissingSemicolon.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/HasErrorsIfNamespaceImportMissingSemicolon.stree.txt index 0e214796db..92f8d6a426 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/HasErrorsIfNamespaceImportMissingSemicolon.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/HasErrorsIfNamespaceImportMissingSemicolon.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 17 - (0:0,0) Code span - Gen - [using Foo.Bar.Baz] - SpanEditHandler;Accepts:AnyExceptNewline - (0:0,0) - Tokens:7 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Baz]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithAtDoesntCauseError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithAtDoesntCauseError.stree.txt index f0d580e422..88eb4a4448 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithAtDoesntCauseError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithAtDoesntCauseError.stree.txt @@ -1,25 +1,25 @@ Statement block - Gen - 28 - (0:0,0) Code span - Gen - [if (true) { ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:8 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Statement block - Gen - 14 - (12:0,12) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if(false) { }] - SpanEditHandler;Accepts:Any - (13:0,13) - Tokens:8 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; Code span - Gen - [ }] - SpanEditHandler;Accepts:Any - (26:0,26) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithCSharpAt.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithCSharpAt.stree.txt index 80065e6122..4d2b182664 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithCSharpAt.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithCSharpAt.stree.txt @@ -1,41 +1,41 @@ Statement block - Gen - 49 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ if (true) { var val = @x; if (val != 3) { } } ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:35 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[val]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Transition;[@]; - CSharpTokenType.Identifier;[x]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[val]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[3]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[val]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Transition;[@]; + SyntaxKind.Identifier;[x]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[val]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[3]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (48:0,48) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithMarkupSetsDotAsMarkup.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithMarkupSetsDotAsMarkup.stree.txt index 28fa9d02af..01014abcd4 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithMarkupSetsDotAsMarkup.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithMarkupSetsDotAsMarkup.stree.txt @@ -1,50 +1,50 @@ Statement block - Gen - 51 - (0:0,0) Code span - Gen - [if (true) { ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:8 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Statement block - Gen - 37 - (12:0,12) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if(false) {] - SpanEditHandler;Accepts:Any - (13:0,13) - Tokens:6 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 24 - (24:0,24) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (24:0,24) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 5 - (25:0,25) Markup span - Gen - [
] - SpanEditHandler;Accepts:None - (25:0,25) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[div]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[div]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (30:0,30) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 10 - (30:0,30) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (30:0,30) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [something] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (31:0,31) - Tokens:1 - CSharpTokenType.Identifier;[something]; + SyntaxKind.Identifier;[something]; Markup span - Gen - [.] - SpanEditHandler;Accepts:Any - (40:0,40) - Tokens:1 - HtmlTokenType.Text;[.]; + SyntaxKind.HtmlTextLiteral;[.]; Tag block - Gen - 6 - (41:0,41) Markup span - Gen - [
] - SpanEditHandler;Accepts:None - (41:0,41) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[div]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[div]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (47:0,47) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [}] - SpanEditHandler;Accepts:Any - (48:0,48) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Code span - Gen - [ }] - SpanEditHandler;Accepts:Any - (49:0,49) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsersCanNestRecursively.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsersCanNestRecursively.stree.txt index 13ca10275e..065a7b6352 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsersCanNestRecursively.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsersCanNestRecursively.stree.txt @@ -1,179 +1,179 @@ Statement block - Gen - 351 - (0:0,0) Code span - Gen - [foreach(var c in db.Categories) {LF] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:15 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[c]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[in]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[db]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Categories]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[foreach]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[c]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[in]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[db]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Categories]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; Markup block - Gen - 307 - (35:1,0) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (35:1,0) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 5 - (47:1,12) Markup span - Gen - [
] - SpanEditHandler;Accepts:None - (47:1,12) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[div]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[div]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF ] - SpanEditHandler;Accepts:Any - (52:1,17) - Tokens:2 - HtmlTokenType.NewLine;[LF]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 4 - (70:2,16) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (70:2,16) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[h1]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[h1]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (74:2,20) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 7 - (74:2,20) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (74:2,20) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [c.Name] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (75:2,21) - Tokens:3 - CSharpTokenType.Identifier;[c]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Name]; + SyntaxKind.Identifier;[c]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Name]; Tag block - Gen - 5 - (81:2,27) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (81:2,27) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[h1]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[h1]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF ] - SpanEditHandler;Accepts:Any - (86:2,32) - Tokens:2 - HtmlTokenType.NewLine;[LF]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 4 - (104:3,16) Markup span - Gen - [
    ] - SpanEditHandler;Accepts:None - (104:3,16) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[ul]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[ul]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (108:3,20) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Statement block - Gen - 189 - (110:4,0) Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (110:4,0) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (130:4,20) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foreach(var p in c.Products) {LF] - SpanEditHandler;Accepts:Any - (131:4,21) - Tokens:15 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[p]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[in]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[c]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Products]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[foreach]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[p]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[in]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[c]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Products]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; Markup block - Gen - 113 - (163:5,0) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (163:5,0) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 4 - (187:5,24) Markup span - Gen - [
  • ] - SpanEditHandler;Accepts:None - (187:5,24) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[li]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[li]; + SyntaxKind.CloseAngle;[>]; Tag block - Gen - 67 - (191:5,28) Markup span - Gen - [ - 64 - (193:5,30) Markup span - Gen - [ href="] - SpanEditHandler;Accepts:Any - (193:5,30) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[href]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.DoubleQuote;["]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[href]; + SyntaxKind.Equals;[=]; + SyntaxKind.DoubleQuote;["]; Markup block - Gen - 56 - (200:5,37) Expression block - Gen - 56 - (200:5,37) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (200:5,37) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [Html.ActionUrl("Products", "Detail", new { id = p.Id })] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (201:5,38) - Tokens:24 - CSharpTokenType.Identifier;[Html]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ActionUrl]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;["Products"]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["Detail"]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[id]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[p]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Id]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Identifier;[Html]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ActionUrl]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;["Products"]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["Detail"]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[id]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[p]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Id]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; Markup span - Gen - ["] - SpanEditHandler;Accepts:Any - (256:5,93) - Tokens:1 - HtmlTokenType.DoubleQuote;["]; + SyntaxKind.DoubleQuote;["]; Markup span - Gen - [>] - SpanEditHandler;Accepts:None - (257:5,94) - Tokens:1 - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (258:5,95) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 7 - (258:5,95) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (258:5,95) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [p.Name] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (259:5,96) - Tokens:3 - CSharpTokenType.Identifier;[p]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Name]; + SyntaxKind.Identifier;[p]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Name]; Tag block - Gen - 4 - (265:5,102) Markup span - Gen - [] - SpanEditHandler;Accepts:None - (265:5,102) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[a]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[a]; + SyntaxKind.CloseAngle;[>]; Tag block - Gen - 5 - (269:5,106) Markup span - Gen - [
  • ] - SpanEditHandler;Accepts:None - (269:5,106) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[li]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[li]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:None - (274:5,111) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Code span - Gen - [ }LF] - SpanEditHandler;Accepts:None - (276:6,0) - Tokens:3 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (299:7,0) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 5 - (315:7,16) Markup span - Gen - [
] - SpanEditHandler;Accepts:None - (315:7,16) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[ul]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[ul]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF ] - SpanEditHandler;Accepts:Any - (320:7,21) - Tokens:2 - HtmlTokenType.NewLine;[LF]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 6 - (334:8,12) Markup span - Gen - [
] - SpanEditHandler;Accepts:None - (334:8,12) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[div]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[div]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:None - (340:8,18) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Code span - Gen - [ }] - SpanEditHandler;Accepts:None - (342:9,0) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesElseIfBranchesOfIfStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesElseIfBranchesOfIfStatement.stree.txt index 5563401047..c86d52c614 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesElseIfBranchesOfIfStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesElseIfBranchesOfIfStatement.stree.txt @@ -1,95 +1,95 @@ Statement block - Gen - 180 - (0:0,0) Code span - Gen - [if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"foo } bar");LF} else if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"bar } baz");LF}] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:93 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart.stree.txt index 45b2fc09d2..5cdffb390c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart.stree.txt @@ -1,24 +1,24 @@ Statement block - Gen - 25 - (0:0,0) Code span - Gen - [if(foo) { ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:7 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 13 - (10:0,10) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (10:0,10) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo[4].bar()] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[ATD];K14 - (11:0,11) - Tokens:8 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.IntegerLiteral;[4]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.IntegerLiteral;[4]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; Code span - Gen - [ }] - SpanEditHandler;Accepts:Any - (23:0,23) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByOpenParen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByOpenParen.stree.txt index 09618cf66e..1bfc6b33f3 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByOpenParen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByOpenParen.stree.txt @@ -1,25 +1,25 @@ Statement block - Gen - 24 - (0:0,0) Code span - Gen - [if(foo) { ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:7 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 12 - (10:0,10) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (10:0,10) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (11:0,11) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [foo + bar] - SpanEditHandler;Accepts:Any - (12:0,12) - Tokens:5 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Plus;[+]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Plus;[+]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; Code span - Gen - [ }] - SpanEditHandler;Accepts:Any - (22:0,22) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatement.stree.txt index 05d2542f80..cb4f3cd094 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatement.stree.txt @@ -1,239 +1,239 @@ Statement block - Gen - 459 - (0:0,0) Code span - Gen - [if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"foo } bar");LF} else if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"bar } baz");LF} else if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"bar } baz");LF} else if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"bar } baz");LF} else if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"bar } baz");LF}] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:237 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch.stree.txt index 766f7e4ddd..62a654f7b7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch.stree.txt @@ -1,157 +1,157 @@ Statement block - Gen - 313 - (0:0,0) Code span - Gen - [if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"foo } bar");LF} else if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"bar } baz");LF} else if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"bar } baz");LF} else { Debug.WriteLine(@"bar } baz"); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:155 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesNamespaceAliasWithSemicolonForUsingKeywordIfIsInValidFormat.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesNamespaceAliasWithSemicolonForUsingKeywordIfIsInValidFormat.stree.txt index 9b0810ec74..c6cb9e90a8 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesNamespaceAliasWithSemicolonForUsingKeywordIfIsInValidFormat.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesNamespaceAliasWithSemicolonForUsingKeywordIfIsInValidFormat.stree.txt @@ -1,10 +1,10 @@ Directive block - Gen - 28 - (0:0,0) Code span - Gen - [using FooBarBaz = FooBarBaz;] - SpanEditHandler;Accepts:AnyExceptNewline - (0:0,0) - Tokens:8 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[FooBarBaz]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[FooBarBaz]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[FooBarBaz]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[FooBarBaz]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesNamespaceImportWithSemicolonForUsingKeywordIfIsInValidFormat.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesNamespaceImportWithSemicolonForUsingKeywordIfIsInValidFormat.stree.txt index d9f8d37923..5fa73eb8f2 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesNamespaceImportWithSemicolonForUsingKeywordIfIsInValidFormat.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ParsesNamespaceImportWithSemicolonForUsingKeywordIfIsInValidFormat.stree.txt @@ -1,10 +1,10 @@ Directive block - Gen - 18 - (0:0,0) Code span - Gen - [using Foo.Bar.Baz;] - SpanEditHandler;Accepts:AnyExceptNewline - (0:0,0) - Tokens:8 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword.stree.txt index c19dcce9b3..9bd2fe906d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword.stree.txt @@ -1,46 +1,46 @@ Statement block - Gen - 82 - (0:0,0) Code span - Gen - [for(int i = 0; i < 10; new Foo { Bar = "baz" }) { Debug.WriteLine(@"foo } bar"); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:44 - CSharpTokenType.Keyword;[for]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[for]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword.stree.txt index 8e095ff484..a6ba84a761 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword.stree.txt @@ -1,46 +1,46 @@ Statement block - Gen - 86 - (0:0,0) Code span - Gen - [foreach(int i = 0; i < 10; new Foo { Bar = "baz" }) { Debug.WriteLine(@"foo } bar"); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:44 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[foreach]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches.stree.txt index bb4eee2f14..712f8110b9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches.stree.txt @@ -1,46 +1,46 @@ Statement block - Gen - 81 - (0:0,0) Code span - Gen - [if(int i = 0; i < 10; new Foo { Bar = "baz" }) { Debug.WriteLine(@"foo } bar"); }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:44 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword.stree.txt index f0e5015b28..23b29665ec 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword.stree.txt @@ -1,54 +1,54 @@ Statement block - Gen - 161 - (0:0,0) Code span - Gen - [switch(foo) {LF case 0:LF break;LF case 1:LF {LF break;LF }LF case 2:LF return;LF default:LF return;LF}] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:52 - CSharpTokenType.Keyword;[switch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[case]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Colon;[:]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[break]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[case]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[1]; - CSharpTokenType.Colon;[:]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[break]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[case]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[2]; - CSharpTokenType.Colon;[:]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[return]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[default]; - CSharpTokenType.Colon;[:]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[return]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[switch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[case]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Colon;[:]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[break]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[case]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[1]; + SyntaxKind.Colon;[:]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[break]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[case]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[2]; + SyntaxKind.Colon;[:]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[return]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[default]; + SyntaxKind.Colon;[:]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[return]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword.stree.txt index 261becea48..8867fa66fb 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword.stree.txt @@ -1,46 +1,46 @@ Statement block - Gen - 84 - (0:0,0) Code span - Gen - [while(int i = 0; i < 10; new Foo { Bar = "baz" }) { Debug.WriteLine(@"foo } bar"); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:44 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen.stree.txt index aaabf8bbd5..18268ec09d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen.stree.txt @@ -1,46 +1,46 @@ Statement block - Gen - 84 - (0:0,0) Code span - Gen - [using(int i = 0; i < 10; new Foo { Bar = "baz" }) { Debug.WriteLine(@"foo } bar"); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:44 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[using]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCatchClausesAfterFinallyBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCatchClausesAfterFinallyBlock.stree.txt index c9a0cb5fa2..8ae4de426a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCatchClausesAfterFinallyBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCatchClausesAfterFinallyBlock.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 55 - (0:0,0) Code span - Gen - [try { var foo = new { } } finally { var foo = new { } }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCodeAfterElseBranch.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCodeAfterElseBranch.stree.txt index 8aea7b10e3..7ed1071296 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCodeAfterElseBranch.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCodeAfterElseBranch.stree.txt @@ -1,109 +1,109 @@ Statement block - Gen - 220 - (0:0,0) Code span - Gen - [if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"foo } bar");LF} else if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"bar } baz");LF} else { Debug.WriteLine(@"bar } baz"); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:107 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bar } baz"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bar } baz"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingIfIfStatementNotFollowedByElse.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingIfIfStatementNotFollowedByElse.stree.txt index a6fde6d036..66455be822 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingIfIfStatementNotFollowedByElse.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingIfIfStatementNotFollowedByElse.stree.txt @@ -1,47 +1,47 @@ Statement block - Gen - 87 - (0:0,0) Code span - Gen - [if(int i = 0; i < 10; new Foo { Bar = "baz" }) {LF Debug.WriteLine(@"foo } bar");LF}] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:45 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenCatchAndFinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenCatchAndFinallyClause.stree.txt index 4dd24cad32..73bc070d63 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenCatchAndFinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenCatchAndFinallyClause.stree.txt @@ -1,41 +1,41 @@ Statement block - Gen - 75 - (0:0,0) Code span - Gen - [try { bar(); } catch(bar) { baz(); } /* Foo */ /* Bar */ finally { biz(); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:39 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Foo */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Bar */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[biz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Foo */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Bar */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[biz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenDoAndWhileClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenDoAndWhileClause.stree.txt index 89aeaa49b0..55417a8113 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenDoAndWhileClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenDoAndWhileClause.stree.txt @@ -1,26 +1,26 @@ Statement block - Gen - 54 - (0:0,0) Code span - Gen - [do { var foo = bar; } /* Foo */ /* Bar */ while(true);] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:24 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Foo */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Bar */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Foo */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Bar */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenElseIfAndElseClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenElseIfAndElseClause.stree.txt index 8beb9c4062..af30d4aa67 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenElseIfAndElseClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenElseIfAndElseClause.stree.txt @@ -1,46 +1,46 @@ Statement block - Gen - 78 - (0:0,0) Code span - Gen - [if(foo) { bar(); } else if(bar) { baz(); } /* Foo */ /* Bar */ else { biz(); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:44 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Foo */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Bar */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[biz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Foo */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Bar */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[biz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenIfAndElseClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenIfAndElseClause.stree.txt index c00834cb33..5c0454a7c6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenIfAndElseClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenIfAndElseClause.stree.txt @@ -1,30 +1,30 @@ Statement block - Gen - 54 - (0:0,0) Code span - Gen - [if(foo) { bar(); } /* Foo */ /* Bar */ else { baz(); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:28 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Foo */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Bar */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Foo */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Bar */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenIfAndElseIfClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenIfAndElseIfClause.stree.txt index 35a7c0c0e2..6d0d09b6b4 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenIfAndElseIfClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenIfAndElseIfClause.stree.txt @@ -1,35 +1,35 @@ Statement block - Gen - 62 - (0:0,0) Code span - Gen - [if(foo) { bar(); } /* Foo */ /* Bar */ else if(bar) { baz(); }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:33 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Foo */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Bar */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Foo */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Bar */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenTryAndCatchClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenTryAndCatchClause.stree.txt index 4fb861d57f..7d9cdf7fb9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenTryAndCatchClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenTryAndCatchClause.stree.txt @@ -1,30 +1,30 @@ Statement block - Gen - 56 - (0:0,0) Code span - Gen - [try { bar(); } /* Foo */ /* Bar */ catch(bar) { baz(); }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:28 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Foo */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Bar */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Foo */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Bar */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenTryAndFinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenTryAndFinallyClause.stree.txt index 659643d83f..fc6549a8d0 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenTryAndFinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenTryAndFinallyClause.stree.txt @@ -1,27 +1,27 @@ Statement block - Gen - 53 - (0:0,0) Code span - Gen - [try { bar(); } /* Foo */ /* Bar */ finally { baz(); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:25 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Foo */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* Bar */]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Foo */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* Bar */]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsExceptionLessCatchClauses.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsExceptionLessCatchClauses.stree.txt index bb84c5607a..cfdfe10393 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsExceptionLessCatchClauses.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsExceptionLessCatchClauses.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 53 - (0:0,0) Code span - Gen - [try { var foo = new { } } catch { var foo = new { } }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenCatchAndFinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenCatchAndFinallyClause.stree.txt index b09a7b573c..1c1dd32483 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenCatchAndFinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenCatchAndFinallyClause.stree.txt @@ -1,41 +1,41 @@ Statement block - Gen - 72 - (0:0,0) Code span - Gen - [try { bar(); } catch(bar) { baz(); }LF// FooLF// BarLFfinally { biz(); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:39 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Foo]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Bar]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[biz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Foo]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Bar]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[biz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenDoAndWhileClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenDoAndWhileClause.stree.txt index 17b8ff17eb..2882f0ab41 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenDoAndWhileClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenDoAndWhileClause.stree.txt @@ -1,26 +1,26 @@ Statement block - Gen - 51 - (0:0,0) Code span - Gen - [do { var foo = bar; }LF// FooLF// BarLFwhile(true);] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:24 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Foo]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Bar]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Foo]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Bar]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenElseIfAndElseClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenElseIfAndElseClause.stree.txt index eb193d4c42..0fc2eef2b1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenElseIfAndElseClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenElseIfAndElseClause.stree.txt @@ -1,46 +1,46 @@ Statement block - Gen - 75 - (0:0,0) Code span - Gen - [if(foo) { bar(); } else if(bar) { baz(); }LF// FooLF// BarLFelse { biz(); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:44 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Foo]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Bar]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[biz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Foo]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Bar]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[biz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenIfAndElseClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenIfAndElseClause.stree.txt index 5494eeaffe..ab73bc4446 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenIfAndElseClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenIfAndElseClause.stree.txt @@ -1,30 +1,30 @@ Statement block - Gen - 51 - (0:0,0) Code span - Gen - [if(foo) { bar(); }LF// FooLF// BarLFelse { baz(); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:28 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Foo]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Bar]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Foo]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Bar]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenIfAndElseIfClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenIfAndElseIfClause.stree.txt index 9359227eaf..a151fa562e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenIfAndElseIfClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenIfAndElseIfClause.stree.txt @@ -1,35 +1,35 @@ Statement block - Gen - 59 - (0:0,0) Code span - Gen - [if(foo) { bar(); }LF// FooLF// BarLFelse if(bar) { baz(); }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:33 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Foo]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Bar]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Foo]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Bar]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenTryAndCatchClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenTryAndCatchClause.stree.txt index fd741d9327..51faa5f9e7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenTryAndCatchClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenTryAndCatchClause.stree.txt @@ -1,30 +1,30 @@ Statement block - Gen - 53 - (0:0,0) Code span - Gen - [try { bar(); }LF// FooLF// BarLFcatch(bar) { baz(); }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:28 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Foo]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Bar]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Foo]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Bar]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenTryAndFinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenTryAndFinallyClause.stree.txt index 4f6a067875..1bdb46e8d9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenTryAndFinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenTryAndFinallyClause.stree.txt @@ -1,27 +1,27 @@ Statement block - Gen - 50 - (0:0,0) Code span - Gen - [try { bar(); }LF// FooLF// BarLFfinally { baz(); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:25 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Foo]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Comment;[// Bar]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Foo]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.CSharpComment;[// Bar]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinAdditionalCatchClauses.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinAdditionalCatchClauses.stree.txt index 12d1fbf839..429002de25 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinAdditionalCatchClauses.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinAdditionalCatchClauses.stree.txt @@ -1,100 +1,100 @@ Statement block - Gen - 141 - (0:0,0) Code span - Gen - [try { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } } catch(Foo Bar Baz) {] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:78 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (128:0,128) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (128:0,128) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (129:0,129) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (129:0,129) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Foo] - SpanEditHandler;Accepts:Any - (132:0,132) - Tokens:1 - HtmlTokenType.Text;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (135:0,135) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (135:0,135) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (139:0,139) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [}] - SpanEditHandler;Accepts:Any - (140:0,140) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinCatchClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinCatchClause.stree.txt index eb1512a038..a80e22267b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinCatchClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinCatchClause.stree.txt @@ -1,50 +1,50 @@ Statement block - Gen - 59 - (0:0,0) Code span - Gen - [try { var foo = new { } } catch(Foo Bar Baz) {] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:28 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (46:0,46) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (46:0,46) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (47:0,47) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (47:0,47) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Foo] - SpanEditHandler;Accepts:Any - (50:0,50) - Tokens:1 - HtmlTokenType.Text;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (53:0,53) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (53:0,53) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (57:0,57) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [}] - SpanEditHandler;Accepts:Any - (58:0,58) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinFinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinFinallyClause.stree.txt index 4af8d90e1a..7703a2d780 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinFinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinFinallyClause.stree.txt @@ -1,43 +1,43 @@ Statement block - Gen - 48 - (0:0,0) Code span - Gen - [try { var foo = new { } } finally {] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:21 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (35:0,35) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (35:0,35) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (36:0,36) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (36:0,36) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Foo] - SpanEditHandler;Accepts:Any - (39:0,39) - Tokens:1 - HtmlTokenType.Text;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (42:0,42) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (42:0,42) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (46:0,46) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [}] - SpanEditHandler;Accepts:None - (47:0,47) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinTryClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinTryClause.stree.txt index f7fc9e38f9..252ca0317a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinTryClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinTryClause.stree.txt @@ -1,25 +1,25 @@ Statement block - Gen - 18 - (0:0,0) Code span - Gen - [try {] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:3 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (5:0,5) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (5:0,5) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (6:0,6) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (6:0,6) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Foo] - SpanEditHandler;Accepts:Any - (9:0,9) - Tokens:1 - HtmlTokenType.Text;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (12:0,12) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [}] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenCatchAndFinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenCatchAndFinallyClause.stree.txt index 7ebe9d2b86..4fc3ef825f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenCatchAndFinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenCatchAndFinallyClause.stree.txt @@ -1,63 +1,63 @@ Statement block - Gen - 75 - (0:0,0) Code span - Gen - [try { bar(); } catch(bar) { baz(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:25 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (37:0,37) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (37:0,37) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (38:0,38) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Foo ] - SpanEditHandler;Accepts:Any - (39:0,39) - Tokens:1 - CSharpTokenType.RazorComment;[ Foo ]; + SyntaxKind.RazorComment;[ Foo ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (44:0,44) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (45:0,45) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (46:0,46) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (47:0,47) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (47:0,47) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (48:0,48) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Bar ] - SpanEditHandler;Accepts:Any - (49:0,49) - Tokens:1 - CSharpTokenType.RazorComment;[ Bar ]; + SyntaxKind.RazorComment;[ Bar ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (54:0,54) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (55:0,55) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ finally { biz(); }] - SpanEditHandler;Accepts:None - (56:0,56) - Tokens:11 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[biz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[biz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenDoAndWhileClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenDoAndWhileClause.stree.txt index e31ec364b4..7c172925ca 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenDoAndWhileClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenDoAndWhileClause.stree.txt @@ -1,48 +1,48 @@ Statement block - Gen - 54 - (0:0,0) Code span - Gen - [do { var foo = bar; } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:15 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (22:0,22) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (22:0,22) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (23:0,23) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Foo ] - SpanEditHandler;Accepts:Any - (24:0,24) - Tokens:1 - CSharpTokenType.RazorComment;[ Foo ]; + SyntaxKind.RazorComment;[ Foo ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (29:0,29) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (30:0,30) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (31:0,31) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (32:0,32) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (32:0,32) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (33:0,33) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Bar ] - SpanEditHandler;Accepts:Any - (34:0,34) - Tokens:1 - CSharpTokenType.RazorComment;[ Bar ]; + SyntaxKind.RazorComment;[ Bar ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (39:0,39) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (40:0,40) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ while(true);] - SpanEditHandler;Accepts:None - (41:0,41) - Tokens:6 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenElseIfAndElseClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenElseIfAndElseClause.stree.txt index 36f17bd744..ad49650008 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenElseIfAndElseClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenElseIfAndElseClause.stree.txt @@ -1,68 +1,68 @@ Statement block - Gen - 78 - (0:0,0) Code span - Gen - [if(foo) { bar(); } else if(bar) { baz(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:30 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (43:0,43) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (43:0,43) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (44:0,44) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Foo ] - SpanEditHandler;Accepts:Any - (45:0,45) - Tokens:1 - CSharpTokenType.RazorComment;[ Foo ]; + SyntaxKind.RazorComment;[ Foo ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (50:0,50) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (51:0,51) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (52:0,52) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (53:0,53) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (53:0,53) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (54:0,54) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Bar ] - SpanEditHandler;Accepts:Any - (55:0,55) - Tokens:1 - CSharpTokenType.RazorComment;[ Bar ]; + SyntaxKind.RazorComment;[ Bar ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (60:0,60) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (61:0,61) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ else { baz(); }] - SpanEditHandler;Accepts:None - (62:0,62) - Tokens:11 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenIfAndElseClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenIfAndElseClause.stree.txt index 6a9926895b..713331f34e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenIfAndElseClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenIfAndElseClause.stree.txt @@ -1,52 +1,52 @@ Statement block - Gen - 54 - (0:0,0) Code span - Gen - [if(foo) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:14 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (19:0,19) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (19:0,19) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (20:0,20) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Foo ] - SpanEditHandler;Accepts:Any - (21:0,21) - Tokens:1 - CSharpTokenType.RazorComment;[ Foo ]; + SyntaxKind.RazorComment;[ Foo ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (26:0,26) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (27:0,27) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (28:0,28) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (29:0,29) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (29:0,29) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (30:0,30) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Bar ] - SpanEditHandler;Accepts:Any - (31:0,31) - Tokens:1 - CSharpTokenType.RazorComment;[ Bar ]; + SyntaxKind.RazorComment;[ Bar ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (36:0,36) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (37:0,37) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ else { baz(); }] - SpanEditHandler;Accepts:None - (38:0,38) - Tokens:11 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenIfAndElseIfClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenIfAndElseIfClause.stree.txt index f25afcea4d..ec29570e46 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenIfAndElseIfClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenIfAndElseIfClause.stree.txt @@ -1,57 +1,57 @@ Statement block - Gen - 62 - (0:0,0) Code span - Gen - [if(foo) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:14 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (19:0,19) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (19:0,19) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (20:0,20) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Foo ] - SpanEditHandler;Accepts:Any - (21:0,21) - Tokens:1 - CSharpTokenType.RazorComment;[ Foo ]; + SyntaxKind.RazorComment;[ Foo ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (26:0,26) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (27:0,27) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (28:0,28) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (29:0,29) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (29:0,29) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (30:0,30) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Bar ] - SpanEditHandler;Accepts:Any - (31:0,31) - Tokens:1 - CSharpTokenType.RazorComment;[ Bar ]; + SyntaxKind.RazorComment;[ Bar ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (36:0,36) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (37:0,37) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ else if(bar) { baz(); }] - SpanEditHandler;Accepts:Any - (38:0,38) - Tokens:16 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenTryAndCatchClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenTryAndCatchClause.stree.txt index 7ca64561f4..2fb8732823 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenTryAndCatchClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenTryAndCatchClause.stree.txt @@ -1,51 +1,51 @@ Statement block - Gen - 55 - (0:0,0) Code span - Gen - [try { bar(); }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:10 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; Comment block - Gen - 9 - (14:0,14) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (14:0,14) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Foo ] - SpanEditHandler;Accepts:Any - (16:0,16) - Tokens:1 - CSharpTokenType.RazorComment;[ Foo ]; + SyntaxKind.RazorComment;[ Foo ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (22:0,22) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (23:0,23) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (24:0,24) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (24:0,24) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (25:0,25) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Bar ] - SpanEditHandler;Accepts:Any - (26:0,26) - Tokens:1 - CSharpTokenType.RazorComment;[ Bar ]; + SyntaxKind.RazorComment;[ Bar ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (31:0,31) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (32:0,32) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ catch(bar) { baz(); }] - SpanEditHandler;Accepts:Any - (33:0,33) - Tokens:14 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenTryAndFinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenTryAndFinallyClause.stree.txt index bb040a642a..73825a078d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenTryAndFinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenTryAndFinallyClause.stree.txt @@ -1,49 +1,49 @@ Statement block - Gen - 53 - (0:0,0) Code span - Gen - [try { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:11 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (15:0,15) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Foo ] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:1 - CSharpTokenType.RazorComment;[ Foo ]; + SyntaxKind.RazorComment;[ Foo ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (22:0,22) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (23:0,23) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (24:0,24) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 9 - (25:0,25) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (25:0,25) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (26:0,26) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ Bar ] - SpanEditHandler;Accepts:Any - (27:0,27) - Tokens:1 - CSharpTokenType.RazorComment;[ Bar ]; + SyntaxKind.RazorComment;[ Bar ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (32:0,32) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (33:0,33) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [ finally { biz(); }] - SpanEditHandler;Accepts:None - (34:0,34) - Tokens:11 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[biz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[biz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithFinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithFinallyClause.stree.txt index c9a0cb5fa2..8ae4de426a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithFinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithFinallyClause.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 55 - (0:0,0) Code span - Gen - [try { var foo = new { } } finally { var foo = new { } }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithMultipleCatchClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithMultipleCatchClause.stree.txt index b4bab579d7..46447b2fe9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithMultipleCatchClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithMultipleCatchClause.stree.txt @@ -1,94 +1,94 @@ Statement block - Gen - 148 - (0:0,0) Code span - Gen - [try { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:92 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithNoAdditionalClauses.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithNoAdditionalClauses.stree.txt index 8db73b2757..8a1d739940 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithNoAdditionalClauses.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithNoAdditionalClauses.stree.txt @@ -1,19 +1,19 @@ Statement block - Gen - 25 - (0:0,0) Code span - Gen - [try { var foo = new { } }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:17 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithOneCatchClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithOneCatchClause.stree.txt index e83ac8d8ba..54e1530181 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithOneCatchClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithOneCatchClause.stree.txt @@ -1,44 +1,44 @@ Statement block - Gen - 66 - (0:0,0) Code span - Gen - [try { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:42 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsUsingsNestedWithinOtherBlocks.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsUsingsNestedWithinOtherBlocks.stree.txt index 4618359626..429b126cbd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsUsingsNestedWithinOtherBlocks.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/SupportsUsingsNestedWithinOtherBlocks.stree.txt @@ -1,55 +1,55 @@ Statement block - Gen - 96 - (0:0,0) Code span - Gen - [if(foo) { using(int i = 0; i < 10; new Foo { Bar = "baz" }) { Debug.WriteLine(@"foo } bar"); } }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:53 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[using]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["baz"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[using]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["baz"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.stree.txt index c1ef9144c7..ea93ea30db 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.stree.txt @@ -1,16 +1,16 @@ Statement block - Gen - 38 - (0:0,0) Code span - Gen - [foreach(var f in Foo) { /* foo bar baz] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:14 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[f]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[in]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[/* foo bar baz];RZ1001(24:0,24 [1] ) + SyntaxKind.Keyword;[foreach]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[f]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[in]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[/* foo bar baz];RZ1001(24:0,24 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesParenBalancingAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesParenBalancingAtEOF.stree.txt index 74aaae6293..9f50f95894 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesParenBalancingAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesParenBalancingAtEOF.stree.txt @@ -1,11 +1,11 @@ Expression block - Gen - 15 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [Html.En(code()] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:7 - CSharpTokenType.Identifier;[Html]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[En]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[code]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Identifier;[Html]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[En]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[code]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleLineCommentAtEndOfFile.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleLineCommentAtEndOfFile.stree.txt index 132a174cc4..6151639077 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleLineCommentAtEndOfFile.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleLineCommentAtEndOfFile.stree.txt @@ -1,16 +1,16 @@ Statement block - Gen - 38 - (0:0,0) Code span - Gen - [foreach(var f in Foo) { // foo bar baz] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:14 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[f]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[in]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[// foo bar baz]; + SyntaxKind.Keyword;[foreach]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[f]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[in]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[// foo bar baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleSlashAtEndOfFile.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleSlashAtEndOfFile.stree.txt index fc3d51a91d..f2643653cd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleSlashAtEndOfFile.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleSlashAtEndOfFile.stree.txt @@ -1,22 +1,22 @@ Statement block - Gen - 37 - (0:0,0) Code span - Gen - [foreach(var f in Foo) { / foo bar baz] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:20 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[f]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[in]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Slash;[/]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; + SyntaxKind.Keyword;[foreach]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[f]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[in]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Slash;[/]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesUsingKeywordAtEOFAndOutputsFileCodeBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesUsingKeywordAtEOFAndOutputsFileCodeBlock.stree.txt index 96f6f0f501..b0fd67916f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesUsingKeywordAtEOFAndOutputsFileCodeBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesUsingKeywordAtEOFAndOutputsFileCodeBlock.stree.txt @@ -1,4 +1,4 @@ Statement block - Gen - 25 - (0:0,0) Code span - Gen - [using ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:2 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ThenBalancesBracesIfFirstIdentifierIsLockKeyword.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ThenBalancesBracesIfFirstIdentifierIsLockKeyword.stree.txt index d1aea3ef3c..7d68d60c18 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ThenBalancesBracesIfFirstIdentifierIsLockKeyword.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/ThenBalancesBracesIfFirstIdentifierIsLockKeyword.stree.txt @@ -1,18 +1,18 @@ Statement block - Gen - 44 - (0:0,0) Code span - Gen - [lock(foo) { Debug.WriteLine(@"foo } bar"); }] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:16 - CSharpTokenType.Keyword;[lock]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Debug]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WriteLine]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"foo } bar"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[lock]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Debug]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WriteLine]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"foo } bar"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TreatsAtSignsAfterFirstPairAsPartOfCSharpStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TreatsAtSignsAfterFirstPairAsPartOfCSharpStatement.stree.txt index 2adfba5136..83909c4da0 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TreatsAtSignsAfterFirstPairAsPartOfCSharpStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TreatsAtSignsAfterFirstPairAsPartOfCSharpStatement.stree.txt @@ -1,22 +1,22 @@ Statement block - Gen - 27 - (0:0,0) Code span - Gen - [if(foo) { ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:7 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [@] - SpanEditHandler;Accepts:Any - (10:0,10) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [@@@class.Foo() }] - SpanEditHandler;Accepts:Any - (11:0,11) - Tokens:10 - CSharpTokenType.Transition;[@]; - CSharpTokenType.Transition;[@]; - CSharpTokenType.Transition;[@]; - CSharpTokenType.Keyword;[class]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Transition;[@]; + SyntaxKind.Transition;[@]; + SyntaxKind.Transition;[@]; + SyntaxKind.Keyword;[class]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TreatsDoubleAtSignAsEscapeSequenceIfAtStatementStart.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TreatsDoubleAtSignAsEscapeSequenceIfAtStatementStart.stree.txt index 2b2e1a980f..cfd3620a03 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TreatsDoubleAtSignAsEscapeSequenceIfAtStatementStart.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/TreatsDoubleAtSignAsEscapeSequenceIfAtStatementStart.stree.txt @@ -1,20 +1,20 @@ Statement block - Gen - 25 - (0:0,0) Code span - Gen - [if(foo) { ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:7 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [@] - SpanEditHandler;Accepts:Any - (10:0,10) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [@class.Foo() }] - SpanEditHandler;Accepts:Any - (11:0,11) - Tokens:8 - CSharpTokenType.Transition;[@]; - CSharpTokenType.Keyword;[class]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Transition;[@]; + SyntaxKind.Keyword;[class]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionAtBeginningOfAttributeValue_DoesNotThrow.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionAtBeginningOfAttributeValue_DoesNotThrow.stree.txt index ac7bda2f5e..10465beb7d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionAtBeginningOfAttributeValue_DoesNotThrow.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionAtBeginningOfAttributeValue_DoesNotThrow.stree.txt @@ -1,31 +1,31 @@ Statement block - Gen - 22 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 20 - (1:0,1) Tag block - Gen - 20 - (1:0,1) Markup span - Gen - [ - 12 - (6:0,6) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (6:0,6) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 2 - (12:0,12) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [def] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.Text;[def]; + SyntaxKind.HtmlTextLiteral;[def]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:None - (18:0,18) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (21:0,21) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionAtEndOfAttributeValue_DoesNotThrow.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionAtEndOfAttributeValue_DoesNotThrow.stree.txt index d7426b2aac..66603539f8 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionAtEndOfAttributeValue_DoesNotThrow.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionAtEndOfAttributeValue_DoesNotThrow.stree.txt @@ -1,31 +1,31 @@ Statement block - Gen - 22 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 20 - (1:0,1) Tag block - Gen - 20 - (1:0,1) Markup span - Gen - [ - 12 - (6:0,6) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (6:0,6) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [abc] - SpanEditHandler;Accepts:Any - (12:0,12) - Tokens:1 - HtmlTokenType.Text;[abc]; + SyntaxKind.HtmlTextLiteral;[abc]; Markup block - Gen - 2 - (15:0,15) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:None - (18:0,18) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (21:0,21) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionBetweenAttributeValue_DoesNotThrow.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionBetweenAttributeValue_DoesNotThrow.stree.txt index 6ec5d3f78a..29e255ef10 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionBetweenAttributeValue_DoesNotThrow.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionBetweenAttributeValue_DoesNotThrow.stree.txt @@ -1,35 +1,35 @@ Statement block - Gen - 27 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 25 - (1:0,1) Tag block - Gen - 25 - (1:0,1) Markup span - Gen - [ - 17 - (6:0,6) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (6:0,6) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [abc] - SpanEditHandler;Accepts:Any - (12:0,12) - Tokens:1 - HtmlTokenType.Text;[abc]; + SyntaxKind.HtmlTextLiteral;[abc]; Markup block - Gen - 3 - (15:0,15) Markup span - Gen - [ @] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Transition;[@]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (17:0,17) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [ def] - SpanEditHandler;Accepts:Any - (18:0,18) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[def]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[def]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (22:0,22) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:None - (23:0,23) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (26:0,26) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (26:0,26) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInAttributeValue_DoesNotThrow.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInAttributeValue_DoesNotThrow.stree.txt index 89200d1412..c20d7906bc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInAttributeValue_DoesNotThrow.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInAttributeValue_DoesNotThrow.stree.txt @@ -1,29 +1,29 @@ Statement block - Gen - 19 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 17 - (1:0,1) Tag block - Gen - 17 - (1:0,1) Markup span - Gen - [ - 9 - (6:0,6) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (6:0,6) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 2 - (12:0,12) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (18:0,18) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (18:0,18) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInEmail_DoesNotThrow.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInEmail_DoesNotThrow.stree.txt index 5ff6c98e4d..3974665864 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInEmail_DoesNotThrow.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInEmail_DoesNotThrow.stree.txt @@ -1,42 +1,42 @@ Statement block - Gen - 44 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 42 - (1:0,1) Tag block - Gen - 42 - (1:0,1) Markup span - Gen - [ - 34 - (6:0,6) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (6:0,6) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [abc@def.com] - SpanEditHandler;Accepts:Any - (12:0,12) - Tokens:1 - HtmlTokenType.Text;[abc@def.com]; + SyntaxKind.HtmlTextLiteral;[abc@def.com]; Markup span - Gen - [ abc] - SpanEditHandler;Accepts:Any - (23:0,23) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[abc]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[abc]; Markup block - Gen - 2 - (27:0,27) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (27:0,27) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (28:0,28) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [def.com] - SpanEditHandler;Accepts:Any - (29:0,29) - Tokens:1 - HtmlTokenType.Text;[def.com]; + SyntaxKind.HtmlTextLiteral;[def.com]; Markup block - Gen - 3 - (36:0,36) Markup span - Gen - [ @] - SpanEditHandler;Accepts:None - (36:0,36) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Transition;[@]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (38:0,38) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (39:0,39) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:None - (40:0,40) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (43:0,43) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (43:0,43) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInRegex_DoesNotThrow.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInRegex_DoesNotThrow.stree.txt index ae6eb40508..65eb01c19f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInRegex_DoesNotThrow.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionInRegex_DoesNotThrow.stree.txt @@ -1,75 +1,75 @@ Statement block - Gen - 117 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 115 - (1:0,1) Tag block - Gen - 115 - (1:0,1) Markup span - Gen - [ - 107 - (6:0,6) Markup span - Gen - [ foo="] - SpanEditHandler;Accepts:Any - (6:0,6) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.DoubleQuote;["]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.DoubleQuote;["]; Markup span - Gen - [/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+] - SpanEditHandler;Accepts:Any - (12:0,12) - Tokens:14 - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[^]; - HtmlTokenType.LeftBracket;[[]; - HtmlTokenType.Text;[a-z0-9]; - HtmlTokenType.Bang;[!]; - HtmlTokenType.Text;[#$%&]; - HtmlTokenType.SingleQuote;[']; - HtmlTokenType.Text;[*+\]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.QuestionMark;[?]; - HtmlTokenType.Text;[^_`{|}~.-]; - HtmlTokenType.RightBracket;[]]; - HtmlTokenType.Text;[+]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[^]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.HtmlTextLiteral;[a-z0-9]; + SyntaxKind.Bang;[!]; + SyntaxKind.HtmlTextLiteral;[#$%&]; + SyntaxKind.SingleQuote;[']; + SyntaxKind.HtmlTextLiteral;[*+\]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.Equals;[=]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.HtmlTextLiteral;[^_`{|}~.-]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.HtmlTextLiteral;[+]; Markup block - Gen - 2 - (44:0,44) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (44:0,44) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (45:0,45) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [[a-z0-9]([a-z0-9-]*[a-z0-9])?\.([a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i] - SpanEditHandler;Accepts:Any - (46:0,46) - Tokens:30 - HtmlTokenType.LeftBracket;[[]; - HtmlTokenType.Text;[a-z0-9]; - HtmlTokenType.RightBracket;[]]; - HtmlTokenType.Text;[(]; - HtmlTokenType.LeftBracket;[[]; - HtmlTokenType.Text;[a-z0-9-]; - HtmlTokenType.RightBracket;[]]; - HtmlTokenType.Text;[*]; - HtmlTokenType.LeftBracket;[[]; - HtmlTokenType.Text;[a-z0-9]; - HtmlTokenType.RightBracket;[]]; - HtmlTokenType.Text;[)]; - HtmlTokenType.QuestionMark;[?]; - HtmlTokenType.Text;[\.(]; - HtmlTokenType.LeftBracket;[[]; - HtmlTokenType.Text;[a-z0-9]; - HtmlTokenType.RightBracket;[]]; - HtmlTokenType.Text;[(]; - HtmlTokenType.LeftBracket;[[]; - HtmlTokenType.Text;[a-z0-9-]; - HtmlTokenType.RightBracket;[]]; - HtmlTokenType.Text;[*]; - HtmlTokenType.LeftBracket;[[]; - HtmlTokenType.Text;[a-z0-9]; - HtmlTokenType.RightBracket;[]]; - HtmlTokenType.Text;[)]; - HtmlTokenType.QuestionMark;[?]; - HtmlTokenType.Text;[)*$]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[i]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.HtmlTextLiteral;[a-z0-9]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.HtmlTextLiteral;[(]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.HtmlTextLiteral;[a-z0-9-]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.HtmlTextLiteral;[*]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.HtmlTextLiteral;[a-z0-9]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.HtmlTextLiteral;[)]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.HtmlTextLiteral;[\.(]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.HtmlTextLiteral;[a-z0-9]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.HtmlTextLiteral;[(]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.HtmlTextLiteral;[a-z0-9-]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.HtmlTextLiteral;[*]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.HtmlTextLiteral;[a-z0-9]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.HtmlTextLiteral;[)]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.HtmlTextLiteral;[)*$]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[i]; Markup span - Gen - ["] - SpanEditHandler;Accepts:Any - (112:0,112) - Tokens:1 - HtmlTokenType.DoubleQuote;["]; + SyntaxKind.DoubleQuote;["]; Markup span - Gen - [ />] - SpanEditHandler;Accepts:None - (113:0,113) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (116:0,116) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (116:0,116) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt index c50182aa59..2e6538a248 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt @@ -1,144 +1,144 @@ Statement block - Gen - 120 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 118 - (1:0,1) Tag block - Gen - 118 - (1:0,1) Markup span - Gen - [ - 15 - (6:0,6) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (6:0,6) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 2 - (12:0,12) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup block - Gen - 6 - (14:0,14) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 6 - (14:0,14) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (14:0,14) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [2+3] - SpanEditHandler;Accepts:Any - (16:0,16) - Tokens:3 - CSharpTokenType.IntegerLiteral;[2]; - CSharpTokenType.Plus;[+]; - CSharpTokenType.IntegerLiteral;[3]; + SyntaxKind.IntegerLiteral;[2]; + SyntaxKind.Plus;[+]; + SyntaxKind.IntegerLiteral;[3]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (19:0,19) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (20:0,20) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 28 - (21:0,21) Markup span - Gen - [ bar='] - SpanEditHandler;Accepts:Any - (21:0,21) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[bar]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[bar]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 6 - (27:0,27) Expression block - Gen - 6 - (27:0,27) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (27:0,27) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (28:0,28) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [2+3] - SpanEditHandler;Accepts:Any - (29:0,29) - Tokens:3 - CSharpTokenType.IntegerLiteral;[2]; - CSharpTokenType.Plus;[+]; - CSharpTokenType.IntegerLiteral;[3]; + SyntaxKind.IntegerLiteral;[2]; + SyntaxKind.Plus;[+]; + SyntaxKind.IntegerLiteral;[3]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (32:0,32) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; Markup block - Gen - 2 - (33:0,33) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (33:0,33) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (34:0,34) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup block - Gen - 13 - (35:0,35) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (35:0,35) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 13 - (35:0,35) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (35:0,35) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [DateTime.Now] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (36:0,36) - Tokens:3 - CSharpTokenType.Identifier;[DateTime]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Now]; + SyntaxKind.Identifier;[DateTime]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Now]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (48:0,48) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 22 - (49:0,49) Markup span - Gen - [ baz='] - SpanEditHandler;Accepts:Any - (49:0,49) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[baz]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[baz]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 13 - (55:0,55) Expression block - Gen - 13 - (55:0,55) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (55:0,55) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [DateTime.Now] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (56:0,56) - Tokens:3 - CSharpTokenType.Identifier;[DateTime]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Now]; + SyntaxKind.Identifier;[DateTime]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Now]; Markup block - Gen - 2 - (68:0,68) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (68:0,68) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (69:0,69) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (70:0,70) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 23 - (71:0,71) Markup span - Gen - [ bat='] - SpanEditHandler;Accepts:Any - (71:0,71) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[bat]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[bat]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 13 - (77:0,77) Expression block - Gen - 13 - (77:0,77) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (77:0,77) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [DateTime.Now] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (78:0,78) - Tokens:3 - CSharpTokenType.Identifier;[DateTime]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Now]; + SyntaxKind.Identifier;[DateTime]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Now]; Markup block - Gen - 3 - (90:0,90) Markup span - Gen - [ @] - SpanEditHandler;Accepts:None - (90:0,90) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Transition;[@]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (92:0,92) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (93:0,93) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 22 - (94:0,94) Markup span - Gen - [ zoo='] - SpanEditHandler;Accepts:Any - (94:0,94) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[zoo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[zoo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 2 - (100:0,100) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (100:0,100) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (101:0,101) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup block - Gen - 13 - (102:0,102) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (102:0,102) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 13 - (102:0,102) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (102:0,102) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [DateTime.Now] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (103:0,103) - Tokens:3 - CSharpTokenType.Identifier;[DateTime]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Now]; + SyntaxKind.Identifier;[DateTime]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Now]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (115:0,115) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:None - (116:0,116) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (119:0,119) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (119:0,119) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.stree.txt index 2f4c6d6bfd..a7c10778ad 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.stree.txt @@ -1,21 +1,21 @@ Statement block - Gen - 14 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 13 - (1:0,1) Tag block - Gen - 13 - (1:0,1) Markup span - Gen - [ - 2 - (12:0,12) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithUnexpectedTransitionsInAttributeValue_Throws.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithUnexpectedTransitionsInAttributeValue_Throws.stree.txt index cfd73bfa96..a843664279 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithUnexpectedTransitionsInAttributeValue_Throws.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpBlockTest/WithUnexpectedTransitionsInAttributeValue_Throws.stree.txt @@ -1,38 +1,38 @@ Statement block - Gen - 20 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 18 - (1:0,1) Tag block - Gen - 18 - (1:0,1) Markup span - Gen - [ - 10 - (6:0,6) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (6:0,6) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 1 - (12:0,12) Expression block - Gen - 1 - (12:0,12) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (13:0,13) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Markup block - Gen - 2 - (13:0,13) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (13:0,13) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 1 - (14:0,14) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (14:0,14) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (15:0,15) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (15:0,15) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (19:0,19) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (19:0,19) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt index 0b3a224f4b..91b0beabbc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt @@ -1,10 +1,10 @@ Directive block - Gen - 18 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo"] - SpanEditHandler;Accepts:AnyExceptNewline - (14:0,14) - Tokens:2 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.StringLiteral;["];RZ1000(17:0,17 [1] ) + SyntaxKind.Identifier;[Foo]; + SyntaxKind.StringLiteral;["];RZ1000(17:0,17 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_InvalidLookupText_AddsError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_InvalidLookupText_AddsError.stree.txt index 138d746a0d..977061be03 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_InvalidLookupText_AddsError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_InvalidLookupText_AddsError.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo] - SpanEditHandler;Accepts:AnyExceptNewline - (14:0,14) - Tokens:1 - CSharpTokenType.Identifier;[Foo]; + SyntaxKind.Identifier;[Foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_NoValue_Invalid.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_NoValue_Invalid.stree.txt index 9f107f20c1..db3e274bec 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_NoValue_Invalid.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_NoValue_Invalid.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 16 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [""] - SpanEditHandler;Accepts:AnyExceptNewline - (14:0,14) - Tokens:1 - CSharpTokenType.StringLiteral;[""]; + SyntaxKind.StringLiteral;[""]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_RequiresValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_RequiresValue.stree.txt index 56dc421136..9d3d11160a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_RequiresValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_RequiresValue.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 14 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [] - SpanEditHandler;Accepts:AnyExceptNewline - (14:0,14) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_SingleQuotes_AddsError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_SingleQuotes_AddsError.stree.txt index e6d7ba0e8f..8651e23015 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_SingleQuotes_AddsError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_SingleQuotes_AddsError.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ['*, Foo'] - SpanEditHandler;Accepts:AnyExceptNewline - (14:0,14) - Tokens:1 - CSharpTokenType.CharacterLiteral;['*, Foo']; + SyntaxKind.CharacterLiteral;['*, Foo']; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt index 817474e23d..7f43ee1408 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 18 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Foo] - SpanEditHandler;Accepts:AnyExceptNewline - (14:0,14) - Tokens:1 - CSharpTokenType.StringLiteral;["Foo];RZ1000(14:0,14 [1] ) + SyntaxKind.StringLiteral;["Foo];RZ1000(14:0,14 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_SupportsSpaces.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_SupportsSpaces.stree.txt index 7b55abb278..5e446716ca 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_SupportsSpaces.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_SupportsSpaces.stree.txt @@ -1,13 +1,13 @@ Directive block - Gen - 32 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo, Bar ] - SpanEditHandler;Accepts:AnyExceptNewline - (18:0,18) - Tokens:5 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_WithQuotes_InvalidLookupText_AddsError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_WithQuotes_InvalidLookupText_AddsError.stree.txt index e009495ff2..b575e68b24 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_WithQuotes_InvalidLookupText_AddsError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/AddTagHelperDirective_WithQuotes_InvalidLookupText_AddsError.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 19 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Foo"] - SpanEditHandler;Accepts:AnyExceptNewline - (14:0,14) - Tokens:1 - CSharpTokenType.StringLiteral;["Foo"]; + SyntaxKind.StringLiteral;["Foo"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/BuiltInDirectiveDoesNotErorrIfNotAtStartOfLineBecauseOfWhitespace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/BuiltInDirectiveDoesNotErorrIfNotAtStartOfLineBecauseOfWhitespace.stree.txt index 642f0611e8..6743a54535 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/BuiltInDirectiveDoesNotErorrIfNotAtStartOfLineBecauseOfWhitespace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/BuiltInDirectiveDoesNotErorrIfNotAtStartOfLineBecauseOfWhitespace.stree.txt @@ -1,12 +1,12 @@ Directive block - Gen - 26 - (0:0,0) Code span - Gen - [LF ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:2 - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (4:1,2) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (5:1,3) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (17:1,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["*, Foo"] - SpanEditHandler;Accepts:AnyExceptNewline - (18:1,16) - Tokens:1 - CSharpTokenType.StringLiteral;["*, Foo"]; + SyntaxKind.StringLiteral;["*, Foo"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/BuiltInDirectiveErrorsIfNotAtStartOfLine.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/BuiltInDirectiveErrorsIfNotAtStartOfLine.stree.txt index 2d4ada75c3..0c436551de 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/BuiltInDirectiveErrorsIfNotAtStartOfLine.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/BuiltInDirectiveErrorsIfNotAtStartOfLine.stree.txt @@ -1,18 +1,18 @@ Statement block - Gen - 28 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Directive block - Gen - 22 - (3:0,3) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (3:0,3) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [addTagHelper] - SpanEditHandler;Accepts:None - (4:0,4) - Tokens:1 - CSharpTokenType.Identifier;[addTagHelper]; + SyntaxKind.Identifier;[addTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["*, Foo"] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.StringLiteral;["*, Foo"]; + SyntaxKind.StringLiteral;["*, Foo"]; Code span - Gen - [LF] - SpanEditHandler;Accepts:Any - (25:0,25) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (27:1,0) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsNullableTypes.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsNullableTypes.stree.txt index 9c4daa1e93..e796a38187 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsNullableTypes.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsNullableTypes.stree.txt @@ -1,71 +1,71 @@ Directive block - Gen - 176 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [string?] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:2 - CSharpTokenType.Keyword;[string]; - CSharpTokenType.QuestionMark;[?]; + SyntaxKind.Keyword;[string]; + SyntaxKind.QuestionMark;[?]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [string?[]] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (16:0,16) - Tokens:4 - CSharpTokenType.Keyword;[string]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Keyword;[string]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.RightBracket;[]]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (25:0,25) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [global::System.Int32?] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (26:0,26) - Tokens:6 - CSharpTokenType.Identifier;[global]; - CSharpTokenType.DoubleColon;[::]; - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Int32]; - CSharpTokenType.QuestionMark;[?]; + SyntaxKind.Identifier;[global]; + SyntaxKind.DoubleColon;[::]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Int32]; + SyntaxKind.QuestionMark;[?]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (47:0,47) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [KeyValuePair?] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (48:0,48) - Tokens:8 - CSharpTokenType.Identifier;[KeyValuePair]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.QuestionMark;[?]; + SyntaxKind.Identifier;[KeyValuePair]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.QuestionMark;[?]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (77:0,77) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [KeyValuePair?[]] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (78:0,78) - Tokens:10 - CSharpTokenType.Identifier;[KeyValuePair]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Identifier;[KeyValuePair]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.RightBracket;[]]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (109:0,109) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [global::System.Collections.Generic.KeyValuePair?[]] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (110:0,110) - Tokens:18 - CSharpTokenType.Identifier;[global]; - CSharpTokenType.DoubleColon;[::]; - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Collections]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Generic]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[KeyValuePair]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Identifier;[global]; + SyntaxKind.DoubleColon;[::]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Collections]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Generic]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[KeyValuePair]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.RightBracket;[]]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsTupleTypes.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsTupleTypes.stree.txt index f9e21e7409..e348f65d1c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsTupleTypes.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsTupleTypes.stree.txt @@ -1,155 +1,155 @@ Directive block - Gen - 246 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [(bool, int)] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:6 - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[bool]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[bool]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[int]; + SyntaxKind.RightParenthesis;[)]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (19:0,19) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [(int aa, string bb)?] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (20:0,20) - Tokens:11 - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[aa]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bb]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.QuestionMark;[?]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[aa]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bb]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.QuestionMark;[?]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (40:0,40) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [( int? q , bool w )] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (41:0,41) - Tokens:14 - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[q]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[bool]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[w]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[int]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[q]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[bool]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[w]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightParenthesis;[)]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (70:0,70) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [( int ? q, bool ?w ,(long ? [])) ?] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (71:0,71) - Tokens:26 - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[q]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[bool]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Identifier;[w]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[long]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.QuestionMark;[?]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[q]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[bool]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Identifier;[w]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Comma;[,]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[long]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.QuestionMark;[?]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (108:0,108) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [(List<(int, string)?> aa, string bb)] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (109:0,109) - Tokens:19 - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[List]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[aa]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bb]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[List]; + SyntaxKind.LessThan;[<]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[aa]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bb]; + SyntaxKind.RightParenthesis;[)]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (145:0,145) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [(string ss, (int u, List<(string, int)> k, (Char c, bool b, List l)), global::System.Int32[] a)] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (146:0,146) - Tokens:56 - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[ss]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[u]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[List]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[k]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Char]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[c]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[bool]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[b]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[List]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[l]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[global]; - CSharpTokenType.DoubleColon;[::]; - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Int32]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[a]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[ss]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[u]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[List]; + SyntaxKind.LessThan;[<]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[int]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[k]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Char]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[c]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[bool]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[b]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[List]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Keyword;[int]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[l]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[global]; + SyntaxKind.DoubleColon;[::]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Int32]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[a]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsTupleTypes_IgnoresTrailingWhitespace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsTupleTypes_IgnoresTrailingWhitespace.stree.txt index 6116fb54b7..1288ab0423 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsTupleTypes_IgnoresTrailingWhitespace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsTupleTypes_IgnoresTrailingWhitespace.stree.txt @@ -1,17 +1,17 @@ Directive block - Gen - 23 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [(bool, int?)] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:7 - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[bool]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[bool]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[int]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.RightParenthesis;[)]; None span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (20:0,20) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsWhiteSpaceAroundTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsWhiteSpaceAroundTokens.stree.txt index 28cca39386..3fc7f067ed 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsWhiteSpaceAroundTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_AllowsWhiteSpaceAroundTokens.stree.txt @@ -1,21 +1,21 @@ Directive block - Gen - 67 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (11:0,11) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (45:0,45) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Some_Member] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (52:0,52) - Tokens:1 - CSharpTokenType.Identifier;[Some_Member]; + SyntaxKind.Identifier;[Some_Member]; None span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (63:0,63) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleEOFIncompleteNamespaceTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleEOFIncompleteNamespaceTokens.stree.txt index 1fee4f1796..3b99d640e7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleEOFIncompleteNamespaceTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleEOFIncompleteNamespaceTokens.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleEOFInvalidNamespaceTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleEOFInvalidNamespaceTokens.stree.txt index 1fee4f1796..3b99d640e7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleEOFInvalidNamespaceTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleEOFInvalidNamespaceTokens.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleIncompleteNamespaceTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleIncompleteNamespaceTokens.stree.txt index 1fee4f1796..3b99d640e7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleIncompleteNamespaceTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleIncompleteNamespaceTokens.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleInvalidNamespaceTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleInvalidNamespaceTokens.stree.txt index 1fee4f1796..3b99d640e7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleInvalidNamespaceTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_CanHandleInvalidNamespaceTokens.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsExtraContentAfterDirective.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsExtraContentAfterDirective.stree.txt index b108f825f7..e0ec07d042 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsExtraContentAfterDirective.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsExtraContentAfterDirective.stree.txt @@ -1,11 +1,11 @@ Directive block - Gen - 16 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["hello"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["hello"]; + SyntaxKind.StringLiteral;["hello"]; None span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsForInvalidMemberTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsForInvalidMemberTokens.stree.txt index 66c8f9e22b..65702b1dfe 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsForInvalidMemberTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsForInvalidMemberTokens.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenEOFBeforeDirectiveBlockStart.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenEOFBeforeDirectiveBlockStart.stree.txt index 785e17335e..2980c189a7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenEOFBeforeDirectiveBlockStart.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenEOFBeforeDirectiveBlockStart.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 15 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Hello"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["Hello"]; + SyntaxKind.StringLiteral;["Hello"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenExtraContentBeforeBlockStart.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenExtraContentBeforeBlockStart.stree.txt index d4346b5102..3d1c39c455 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenExtraContentBeforeBlockStart.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenExtraContentBeforeBlockStart.stree.txt @@ -1,11 +1,11 @@ Directive block - Gen - 16 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Hello"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["Hello"]; + SyntaxKind.StringLiteral;["Hello"]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenMissingEndBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenMissingEndBrace.stree.txt index 15be232395..23bf6be939 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenMissingEndBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_ErrorsWhenMissingEndBrace.stree.txt @@ -1,15 +1,15 @@ Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Hello"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["Hello"]; + SyntaxKind.StringLiteral;["Hello"]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (16:0,16) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [] - CodeBlockEditHandler;Accepts:Any;CodeBlock - (17:0,17) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScopedMultipleOccurring_CanHaveDuplicates.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScopedMultipleOccurring_CanHaveDuplicates.stree.txt index f9f16307e7..1eb4ae5fe3 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScopedMultipleOccurring_CanHaveDuplicates.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScopedMultipleOccurring_CanHaveDuplicates.stree.txt @@ -1,39 +1,39 @@ Markup block - Gen - 85 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 44 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:WhiteSpace - (42:0,42) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (44:1,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 41 - (44:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (44:1,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (45:1,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (51:1,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.UTF8Encoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (52:1,8) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[UTF8Encoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[UTF8Encoding]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (85:1,41) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScopedSinglyOccurring_ErrorsIfDuplicate.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScopedSinglyOccurring_ErrorsIfDuplicate.stree.txt index ed97532104..a2b52e60ef 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScopedSinglyOccurring_ErrorsIfDuplicate.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScopedSinglyOccurring_ErrorsIfDuplicate.stree.txt @@ -1,39 +1,39 @@ Markup block - Gen - 85 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 44 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:WhiteSpace - (42:0,42) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (44:1,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 41 - (44:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (44:1,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (45:1,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (51:1,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.UTF8Encoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (52:1,8) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[UTF8Encoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[UTF8Encoding]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (85:1,41) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScoped_CanBeBeneathOtherDirectives.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScoped_CanBeBeneathOtherDirectives.stree.txt index dabeb41382..fb7061d0b7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScoped_CanBeBeneathOtherDirectives.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScoped_CanBeBeneathOtherDirectives.stree.txt @@ -1,33 +1,33 @@ Markup block - Gen - 59 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 44 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:WhiteSpace - (42:0,42) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (44:1,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 15 - (44:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (44:1,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [something] - SpanEditHandler;Accepts:None - (45:1,1) - Tokens:1 - CSharpTokenType.Identifier;[something]; + SyntaxKind.Identifier;[something]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (54:1,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Else] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (55:1,11) - Tokens:1 - CSharpTokenType.Identifier;[Else]; + SyntaxKind.Identifier;[Else]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (59:1,15) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScoped_CanBeBeneathOtherWhiteSpaceCommentsAndDirectives.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScoped_CanBeBeneathOtherWhiteSpaceCommentsAndDirectives.stree.txt index 15bd38868f..bf5881b70d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScoped_CanBeBeneathOtherWhiteSpaceCommentsAndDirectives.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_FileScoped_CanBeBeneathOtherWhiteSpaceCommentsAndDirectives.stree.txt @@ -1,66 +1,66 @@ Markup block - Gen - 130 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Comment block - Gen - 43 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ There are two directives beneath this ] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - HtmlTokenType.RazorComment;[ There are two directives beneath this ]; + SyntaxKind.RazorComment;[ There are two directives beneath this ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (41:0,41) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (42:0,42) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (43:0,43) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Directive block - Gen - 44 - (45:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (45:1,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (46:1,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (52:1,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (53:1,8) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:WhiteSpace - (87:1,42) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (89:2,0) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Directive block - Gen - 17 - (91:3,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (91:3,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [something] - SpanEditHandler;Accepts:None - (92:3,1) - Tokens:1 - CSharpTokenType.Identifier;[something]; + SyntaxKind.Identifier;[something]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (101:3,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Else] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (102:3,11) - Tokens:1 - CSharpTokenType.Identifier;[Else]; + SyntaxKind.Identifier;[Else]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:WhiteSpace - (106:3,15) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (108:4,0) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Tag block - Gen - 3 - (110:5,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (110:5,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [This is extra] - [113..126) - FullWidth: 13 - Slots: 1 SyntaxKind.List - [This is extra] - [113..126) - FullWidth: 13 - Slots: 5 - SyntaxKind.HtmlTextLiteralToken;[This]; + SyntaxKind.HtmlTextLiteral;[This]; SyntaxKind.Whitespace;[ ]; - SyntaxKind.HtmlTextLiteralToken;[is]; + SyntaxKind.HtmlTextLiteral;[is]; SyntaxKind.Whitespace;[ ]; - SyntaxKind.HtmlTextLiteralToken;[extra]; + SyntaxKind.HtmlTextLiteral;[extra]; Tag block - Gen - 4 - (126:5,16) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (126:5,16) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_NoErrorsSemicolonAfterDirective.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_NoErrorsSemicolonAfterDirective.stree.txt index 6feb3829cd..d28485d535 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_NoErrorsSemicolonAfterDirective.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_NoErrorsSemicolonAfterDirective.stree.txt @@ -1,15 +1,15 @@ Directive block - Gen - 19 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["hello"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["hello"]; + SyntaxKind.StringLiteral;["hello"]; None span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [;] - SpanEditHandler;Accepts:WhiteSpace - (16:0,16) - Tokens:1 - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Semicolon;[;]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (17:0,17) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForNonStringValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForNonStringValue.stree.txt index 8dfad4bd3c..af13378283 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForNonStringValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForNonStringValue.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForPartialQuotedValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForPartialQuotedValue.stree.txt index fd51b1bf91..b106f203a3 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForPartialQuotedValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForPartialQuotedValue.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForSingleQuotedValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForSingleQuotedValue.stree.txt index b65823863d..ca27834a84 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForSingleQuotedValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForSingleQuotedValue.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForUnquotedValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForUnquotedValue.stree.txt index fd51b1bf91..b106f203a3 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForUnquotedValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForUnquotedValue.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_TokensMustBeSeparatedBySpace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_TokensMustBeSeparatedBySpace.stree.txt index 7c8de4fbc1..43d2b27721 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_TokensMustBeSeparatedBySpace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_TokensMustBeSeparatedBySpace.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["string1"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["string1"]; + SyntaxKind.StringLiteral;["string1"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsCodeBlocks.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsCodeBlocks.stree.txt index 64c88fe4f9..faf3b4f685 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsCodeBlocks.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsCodeBlocks.stree.txt @@ -1,27 +1,27 @@ Directive block - Gen - 32 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Name"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["Name"]; + SyntaxKind.StringLiteral;["Name"]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (14:0,14) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (15:0,15) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ foo(); bar(); ] - CodeBlockEditHandler;Accepts:Any;CodeBlock - (16:0,16) - Tokens:11 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (31:0,31) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsMemberTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsMemberTokens.stree.txt index c51aa18acd..e63d0ff801 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsMemberTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsMemberTokens.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 19 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Some_Member] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.Identifier;[Some_Member]; + SyntaxKind.Identifier;[Some_Member]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsMultipleTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsMultipleTokens.stree.txt index 1cca925839..83fb1047bc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsMultipleTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsMultipleTokens.stree.txt @@ -1,23 +1,23 @@ Directive block - Gen - 64 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (42:0,42) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Some_Member] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (43:0,43) - Tokens:1 - CSharpTokenType.Identifier;[Some_Member]; + SyntaxKind.Identifier;[Some_Member]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (54:0,54) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["AString"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (55:0,55) - Tokens:1 - CSharpTokenType.StringLiteral;["AString"]; + SyntaxKind.StringLiteral;["AString"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsRazorBlocks.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsRazorBlocks.stree.txt index fad1a9c949..61aa78cef2 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsRazorBlocks.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsRazorBlocks.stree.txt @@ -1,38 +1,38 @@ Directive block - Gen - 33 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Header"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["Header"]; + SyntaxKind.StringLiteral;["Header"]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (17:0,17) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 14 - (18:0,18) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (18:0,18) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (19:0,19) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (19:0,19) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [F{o}o] - [22..27) - FullWidth: 5 - Slots: 1 SyntaxKind.List - [F{o}o] - [22..27) - FullWidth: 5 - Slots: 5 - SyntaxKind.HtmlTextLiteralToken;[F]; - SyntaxKind.HtmlTextLiteralToken;[{]; - SyntaxKind.HtmlTextLiteralToken;[o]; - SyntaxKind.HtmlTextLiteralToken;[}]; - SyntaxKind.HtmlTextLiteralToken;[o]; + SyntaxKind.HtmlTextLiteral;[F]; + SyntaxKind.HtmlTextLiteral;[{]; + SyntaxKind.HtmlTextLiteral;[o]; + SyntaxKind.HtmlTextLiteral;[}]; + SyntaxKind.HtmlTextLiteral;[o]; Tag block - Gen - 4 - (27:0,27) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (27:0,27) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (31:0,31) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (32:0,32) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsStringTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsStringTokens.stree.txt index 3413cd7516..d94bfcdf22 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsStringTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsStringTokens.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["AString"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["AString"]; + SyntaxKind.StringLiteral;["AString"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsTypeTokens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsTypeTokens.stree.txt index 4032e9314f..7c8000d42a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsTypeTokens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/DirectiveDescriptor_UnderstandsTypeTokens.stree.txt @@ -1,15 +1,15 @@ Directive block - Gen - 42 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Directives_CanUseReservedWord_Class.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Directives_CanUseReservedWord_Class.stree.txt index 32fae95183..d11826133f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Directives_CanUseReservedWord_Class.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Directives_CanUseReservedWord_Class.stree.txt @@ -1,5 +1,5 @@ Directive block - Gen - 6 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [class] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Keyword;[class]; + SyntaxKind.Keyword;[class]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Directives_CanUseReservedWord_Namespace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Directives_CanUseReservedWord_Namespace.stree.txt index 2beaf1fc4f..a947b9a3ba 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Directives_CanUseReservedWord_Namespace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Directives_CanUseReservedWord_Namespace.stree.txt @@ -1,5 +1,5 @@ Directive block - Gen - 10 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [namespace] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Keyword;[namespace]; + SyntaxKind.Keyword;[namespace]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/EmptyFunctionsDirective.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/EmptyFunctionsDirective.stree.txt index f4f2d2009c..01ec82ec2f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/EmptyFunctionsDirective.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/EmptyFunctionsDirective.stree.txt @@ -1,13 +1,13 @@ Directive block - Gen - 14 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [functions] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[functions]; + SyntaxKind.Identifier;[functions]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (11:0,11) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ ] - CodeBlockEditHandler;Accepts:Any;CodeBlock - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/ExtensibleDirectiveDoesNotErorrIfNotAtStartOfLineBecauseOfWhitespace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/ExtensibleDirectiveDoesNotErorrIfNotAtStartOfLineBecauseOfWhitespace.stree.txt index cb071c8170..31df6e1a99 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/ExtensibleDirectiveDoesNotErorrIfNotAtStartOfLineBecauseOfWhitespace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/ExtensibleDirectiveDoesNotErorrIfNotAtStartOfLineBecauseOfWhitespace.stree.txt @@ -1,18 +1,18 @@ Directive block - Gen - 46 - (0:0,0) Code span - Gen - [LF ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:2 - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (4:1,2) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (5:1,3) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (11:1,9) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (12:1,10) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/ExtensibleDirectiveErrorsIfNotAtStartOfLine.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/ExtensibleDirectiveErrorsIfNotAtStartOfLine.stree.txt index ceac2d5c09..c56f5bd7c2 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/ExtensibleDirectiveErrorsIfNotAtStartOfLine.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/ExtensibleDirectiveErrorsIfNotAtStartOfLine.stree.txt @@ -1,26 +1,26 @@ Statement block - Gen - 48 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Directive block - Gen - 44 - (3:0,3) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (3:0,3) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (4:0,4) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Text.Encoding.ASCIIEncoding] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (11:0,11) - Tokens:7 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:WhiteSpace - (45:0,45) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (47:1,0) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (47:1,0) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsArrays.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsArrays.stree.txt index 4dba3c76e7..0c45193f60 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsArrays.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsArrays.stree.txt @@ -1,20 +1,20 @@ Markup block - Gen - 22 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [inherits] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[inherits]; + SyntaxKind.Identifier;[inherits]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [string[[]][]] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (10:0,10) - Tokens:7 - CSharpTokenType.Keyword;[string]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Keyword;[string]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.RightBracket;[]]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (22:0,22) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsNestedGenerics.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsNestedGenerics.stree.txt index 598a5043f8..e82761c275 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsNestedGenerics.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsNestedGenerics.stree.txt @@ -1,30 +1,30 @@ Markup block - Gen - 87 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 87 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [inherits] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[inherits]; + SyntaxKind.Identifier;[inherits]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.Web.Mvc.WebViewPage>] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (10:0,10) - Tokens:17 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Web]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Mvc]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[WebViewPage]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Identifier;[IEnumerable]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Identifier;[MvcApplication2]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Models]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[RegisterModel]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.GreaterThan;[>]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Web]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Mvc]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[WebViewPage]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Identifier;[IEnumerable]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Identifier;[MvcApplication2]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Models]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[RegisterModel]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.GreaterThan;[>]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (87:0,87) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsTypeKeywords.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsTypeKeywords.stree.txt index a65a1bba4c..8df8ddbc06 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsTypeKeywords.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/InheritsDirectiveSupportsTypeKeywords.stree.txt @@ -1,14 +1,14 @@ Markup block - Gen - 16 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 16 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [inherits] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[inherits]; + SyntaxKind.Identifier;[inherits]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [string] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.Keyword;[string]; + SyntaxKind.Keyword;[string]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (16:0,16) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_AreSkipped.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_AreSkipped.stree.txt index 5b7ca1b209..ad6b300588 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_AreSkipped.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_AreSkipped.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithBraces_AreParsed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithBraces_AreParsed.stree.txt index 1951c2e8a1..1c4a2b4b21 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithBraces_AreParsed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithBraces_AreParsed.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 29 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["{formaction}?/{id}?"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["{formaction}?/{id}?"]; + SyntaxKind.StringLiteral;["{formaction}?/{id}?"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithMultipleOptionalTokens_AreParsed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithMultipleOptionalTokens_AreParsed.stree.txt index 4f534b5d86..7a68703a63 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithMultipleOptionalTokens_AreParsed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithMultipleOptionalTokens_AreParsed.stree.txt @@ -1,15 +1,15 @@ Directive block - Gen - 43 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["{formaction}?/{id}?"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["{formaction}?/{id}?"]; + SyntaxKind.StringLiteral;["{formaction}?/{id}?"]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (29:0,29) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [System.String] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (30:0,30) - Tokens:3 - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[String]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[String]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithSimpleTokens_AreParsed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithSimpleTokens_AreParsed.stree.txt index 1e6bb057fa..685bc237dc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithSimpleTokens_AreParsed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalDirectiveTokens_WithSimpleTokens_AreParsed.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["simple-value"] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.StringLiteral;["simple-value"]; + SyntaxKind.StringLiteral;["simple-value"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalMemberTokens_WithMemberSpecified_IsParsed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalMemberTokens_WithMemberSpecified_IsParsed.stree.txt index 114b39032d..7c888f9b50 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalMemberTokens_WithMemberSpecified_IsParsed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalMemberTokens_WithMemberSpecified_IsParsed.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 27 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [TestDirective] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[TestDirective]; + SyntaxKind.Identifier;[TestDirective]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (14:0,14) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [PropertyName] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.Identifier;[PropertyName]; + SyntaxKind.Identifier;[PropertyName]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalMemberTokens_WithMissingMember_IsParsed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalMemberTokens_WithMissingMember_IsParsed.stree.txt index ee0063aa4b..b30717580f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalMemberTokens_WithMissingMember_IsParsed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/OptionalMemberTokens_WithMissingMember_IsParsed.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 15 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [TestDirective] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[TestDirective]; + SyntaxKind.Identifier;[TestDirective]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (14:0,14) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parse_FunctionsDirective.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parse_FunctionsDirective.stree.txt index 119a7b047b..b37799f88c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parse_FunctionsDirective.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parse_FunctionsDirective.stree.txt @@ -1,23 +1,23 @@ Directive block - Gen - 28 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [functions] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[functions]; + SyntaxKind.Identifier;[functions]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (11:0,11) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ foo(); bar(); ] - CodeBlockEditHandler;Accepts:Any;CodeBlock - (12:0,12) - Tokens:11 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (27:0,27) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parse_SectionDirective.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parse_SectionDirective.stree.txt index 77d3e85124..a2e285f4e8 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parse_SectionDirective.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parse_SectionDirective.stree.txt @@ -1,38 +1,38 @@ Directive block - Gen - 32 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Header] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[Header]; + SyntaxKind.Identifier;[Header]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (15:0,15) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (16:0,16) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 14 - (17:0,17) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (18:0,18) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (18:0,18) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [F{o}o] - [21..26) - FullWidth: 5 - Slots: 1 SyntaxKind.List - [F{o}o] - [21..26) - FullWidth: 5 - Slots: 5 - SyntaxKind.HtmlTextLiteralToken;[F]; - SyntaxKind.HtmlTextLiteralToken;[{]; - SyntaxKind.HtmlTextLiteralToken;[o]; - SyntaxKind.HtmlTextLiteralToken;[}]; - SyntaxKind.HtmlTextLiteralToken;[o]; + SyntaxKind.HtmlTextLiteral;[F]; + SyntaxKind.HtmlTextLiteral;[{]; + SyntaxKind.HtmlTextLiteral;[o]; + SyntaxKind.HtmlTextLiteral;[}]; + SyntaxKind.HtmlTextLiteral;[o]; Tag block - Gen - 4 - (26:0,26) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (26:0,26) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (30:0,30) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (31:0,31) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parser_ParsesNamespaceDirectiveToken_WithMultipleSegments.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parser_ParsesNamespaceDirectiveToken_WithMultipleSegments.stree.txt index 9776383715..a07dd55b60 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parser_ParsesNamespaceDirectiveToken_WithMultipleSegments.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parser_ParsesNamespaceDirectiveToken_WithMultipleSegments.stree.txt @@ -1,13 +1,13 @@ Directive block - Gen - 29 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [BaseNamespace.Foo.Bar] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:5 - CSharpTokenType.Identifier;[BaseNamespace]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Bar]; + SyntaxKind.Identifier;[BaseNamespace]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Bar]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parser_ParsesNamespaceDirectiveToken_WithSingleSegment.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parser_ParsesNamespaceDirectiveToken_WithSingleSegment.stree.txt index 8a637f25e1..7599942a0e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parser_ParsesNamespaceDirectiveToken_WithSingleSegment.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/Parser_ParsesNamespaceDirectiveToken_WithSingleSegment.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [custom] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[custom]; + SyntaxKind.Identifier;[custom]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (7:0,7) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [BaseNamespace] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.Identifier;[BaseNamespace]; + SyntaxKind.Identifier;[BaseNamespace]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt index 7d2f6da517..fa786c89b2 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt @@ -1,10 +1,10 @@ Directive block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [removeTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[removeTagHelper]; + SyntaxKind.Identifier;[removeTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo"] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:2 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.StringLiteral;["];RZ1000(20:0,20 [1] ) + SyntaxKind.Identifier;[Foo]; + SyntaxKind.StringLiteral;["];RZ1000(20:0,20 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_InvalidLookupText_AddsError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_InvalidLookupText_AddsError.stree.txt index 860f903187..52f4bbd066 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_InvalidLookupText_AddsError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_InvalidLookupText_AddsError.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 20 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [removeTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[removeTagHelper]; + SyntaxKind.Identifier;[removeTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.Identifier;[Foo]; + SyntaxKind.Identifier;[Foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_NoValue_Invalid.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_NoValue_Invalid.stree.txt index 73ba9fd131..9de0dc9204 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_NoValue_Invalid.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_NoValue_Invalid.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 19 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [removeTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[removeTagHelper]; + SyntaxKind.Identifier;[removeTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [""] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.StringLiteral;[""]; + SyntaxKind.StringLiteral;[""]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_RequiresValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_RequiresValue.stree.txt index 2666ac8a58..f1360457eb 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_RequiresValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_RequiresValue.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [removeTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[removeTagHelper]; + SyntaxKind.Identifier;[removeTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_SingleQuotes_AddsError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_SingleQuotes_AddsError.stree.txt index acf4682a63..621303f00f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_SingleQuotes_AddsError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_SingleQuotes_AddsError.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 25 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [removeTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[removeTagHelper]; + SyntaxKind.Identifier;[removeTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ['*, Foo'] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.CharacterLiteral;['*, Foo']; + SyntaxKind.CharacterLiteral;['*, Foo']; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt index 5483dd02f2..71e71a706d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [removeTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[removeTagHelper]; + SyntaxKind.Identifier;[removeTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Foo] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.StringLiteral;["Foo];RZ1000(17:0,17 [1] ) + SyntaxKind.StringLiteral;["Foo];RZ1000(17:0,17 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_SupportsSpaces.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_SupportsSpaces.stree.txt index 2bcd74c5e6..0caf7acefa 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_SupportsSpaces.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_SupportsSpaces.stree.txt @@ -1,13 +1,13 @@ Directive block - Gen - 35 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [removeTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[removeTagHelper]; + SyntaxKind.Identifier;[removeTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo, Bar ] - SpanEditHandler;Accepts:AnyExceptNewline - (21:0,21) - Tokens:5 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_WithQuotes_InvalidLookupText_AddsError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_WithQuotes_InvalidLookupText_AddsError.stree.txt index 2f9b4b42d9..990c68d908 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_WithQuotes_InvalidLookupText_AddsError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/RemoveTagHelperDirective_WithQuotes_InvalidLookupText_AddsError.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [removeTagHelper] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[removeTagHelper]; + SyntaxKind.Identifier;[removeTagHelper]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Foo"] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.StringLiteral;["Foo"]; + SyntaxKind.StringLiteral;["Foo"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt index 6377f48d15..a867381f99 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_EndQuoteRequiresDoubleQuotesAroundValue.stree.txt @@ -1,11 +1,11 @@ Directive block - Gen - 24 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [tagHelperPrefix] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[tagHelperPrefix]; + SyntaxKind.Identifier;[tagHelperPrefix]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo "] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:3 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["];RZ1000(23:0,23 [1] ) + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["];RZ1000(23:0,23 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_NoValueSucceeds.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_NoValueSucceeds.stree.txt index 5a5e18da25..98001f302e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_NoValueSucceeds.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_NoValueSucceeds.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 19 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [tagHelperPrefix] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[tagHelperPrefix]; + SyntaxKind.Identifier;[tagHelperPrefix]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [""] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.StringLiteral;[""]; + SyntaxKind.StringLiteral;[""]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_RequiresValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_RequiresValue.stree.txt index d63b77168e..72ad65f693 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_RequiresValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_RequiresValue.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [tagHelperPrefix] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[tagHelperPrefix]; + SyntaxKind.Identifier;[tagHelperPrefix]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt index 277fbd3a51..f0fcdb64d6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_StartQuoteRequiresDoubleQuotesAroundValue.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [tagHelperPrefix] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[tagHelperPrefix]; + SyntaxKind.Identifier;[tagHelperPrefix]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Foo] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.StringLiteral;["Foo];RZ1000(17:0,17 [1] ) + SyntaxKind.StringLiteral;["Foo];RZ1000(17:0,17 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_Succeeds.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_Succeeds.stree.txt index 7e9a17d299..cf01151baf 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_Succeeds.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_Succeeds.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 20 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [tagHelperPrefix] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[tagHelperPrefix]; + SyntaxKind.Identifier;[tagHelperPrefix]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.Identifier;[Foo]; + SyntaxKind.Identifier;[Foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_WithQuotes_Succeeds.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_WithQuotes_Succeeds.stree.txt index 1c5a3a9321..c1e856bde9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_WithQuotes_Succeeds.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpDirectivesTest/TagHelperPrefixDirective_WithQuotes_Succeeds.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [tagHelperPrefix] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[tagHelperPrefix]; + SyntaxKind.Identifier;[tagHelperPrefix]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - ["Foo"] - SpanEditHandler;Accepts:AnyExceptNewline - (17:0,17) - Tokens:1 - CSharpTokenType.StringLiteral;["Foo"]; + SyntaxKind.StringLiteral;["Foo"]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CapturesWhitespaceToEOLInInvalidUsingStmtAndTreatsAsFileCode.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CapturesWhitespaceToEOLInInvalidUsingStmtAndTreatsAsFileCode.stree.txt index 6f18195cab..c7cdd8cb0f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CapturesWhitespaceToEOLInInvalidUsingStmtAndTreatsAsFileCode.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CapturesWhitespaceToEOLInInvalidUsingStmtAndTreatsAsFileCode.stree.txt @@ -1,5 +1,5 @@ Statement block - Gen - 17 - (0:0,0) Code span - Gen - [using LF] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:3 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyHandlesInCorrectTransitionsIfImplicitExpressionParensUnclosed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyHandlesInCorrectTransitionsIfImplicitExpressionParensUnclosed.stree.txt index c0c22405e9..5285577e78 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyHandlesInCorrectTransitionsIfImplicitExpressionParensUnclosed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyHandlesInCorrectTransitionsIfImplicitExpressionParensUnclosed.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 7 - (0:0,0) Code span - Gen - [Href(LF] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (0:0,0) - Tokens:3 - CSharpTokenType.Identifier;[Href]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Identifier;[Href]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesAtSignInDelimitedBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesAtSignInDelimitedBlock.stree.txt index 604a9bb8b6..6ef5983ab5 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesAtSignInDelimitedBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesAtSignInDelimitedBlock.stree.txt @@ -1,17 +1,17 @@ Expression block - Gen - 46 - (0:0,0) MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [Request["description"] ?? @photo.Description] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:11 - CSharpTokenType.Identifier;[Request]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.StringLiteral;["description"]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NullCoalesce;[??]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Transition;[@]; - CSharpTokenType.Identifier;[photo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Description]; + SyntaxKind.Identifier;[Request]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.StringLiteral;["description"]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NullCoalesce;[??]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Transition;[@]; + SyntaxKind.Identifier;[photo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Description]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (45:0,45) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement.stree.txt index 5f1e30a96d..4871aac162 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement.stree.txt @@ -1,45 +1,45 @@ Statement block - Gen - 64 - (0:0,0) Code span - Gen - [if(foo) {LF var foo = "foo bar bazLF ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:17 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["foo bar baz];RZ1000(25:1,14 [1] ) - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["foo bar baz];RZ1000(25:1,14 [1] ) + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Markup block - Gen - 20 - (43:2,4) Tag block - Gen - 3 - (43:2,4) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (43:2,4) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Foo is ] - SpanEditHandler;Accepts:Any - (46:2,7) - Tokens:4 - HtmlTokenType.Text;[Foo]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[is]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.HtmlTextLiteral;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[is]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 4 - (53:2,14) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (53:2,14) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (54:2,15) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Tag block - Gen - 4 - (57:2,18) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (57:2,18) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:None - (61:2,22) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Code span - Gen - [}] - SpanEditHandler;Accepts:Any - (63:3,0) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyRecoversFromMissingCloseParenInExpressionWithinCode.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyRecoversFromMissingCloseParenInExpressionWithinCode.stree.txt index 7832ba2cb6..0cf4859a3d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyRecoversFromMissingCloseParenInExpressionWithinCode.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyRecoversFromMissingCloseParenInExpressionWithinCode.stree.txt @@ -1,24 +1,24 @@ Statement block - Gen - 29 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [string.Format(] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:4 - CSharpTokenType.Keyword;[string]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Format]; - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Format]; + SyntaxKind.LeftParenthesis;[(]; Markup block - Gen - 13 - (15:0,15) Tag block - Gen - 6 - (15:0,15) Markup span - Gen - [] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[html]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[html]; + SyntaxKind.CloseAngle;[>]; Tag block - Gen - 7 - (21:0,21) Markup span - Gen - [] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[html]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[html]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (28:0,28) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (28:0,28) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/HandlesQuotesAfterTransition.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/HandlesQuotesAfterTransition.stree.txt index 8f8de632d0..7eb747e6cd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/HandlesQuotesAfterTransition.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/HandlesQuotesAfterTransition.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 1 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/IncludesUnexpectedCharacterInSingleStatementControlFlowStatementError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/IncludesUnexpectedCharacterInSingleStatementControlFlowStatementError.stree.txt index 14a29b0b80..1442776795 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/IncludesUnexpectedCharacterInSingleStatementControlFlowStatementError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/IncludesUnexpectedCharacterInSingleStatementControlFlowStatementError.stree.txt @@ -1,20 +1,20 @@ Statement block - Gen - 27 - (0:0,0) Code span - Gen - [if(foo)) { var bar = foo; }] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:18 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodOutputsOpenCurlyAsCodeSpanIfEofFoundAfterOpenCurlyBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodOutputsOpenCurlyAsCodeSpanIfEofFoundAfterOpenCurlyBrace.stree.txt index 2a25f6f7de..491e283506 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodOutputsOpenCurlyAsCodeSpanIfEofFoundAfterOpenCurlyBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodOutputsOpenCurlyAsCodeSpanIfEofFoundAfterOpenCurlyBrace.stree.txt @@ -1,5 +1,5 @@ Statement block - Gen - 1 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[}];AtEOL - (1:0,1) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodOutputsZeroLengthCodeSpanIfStatementBlockEmpty.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodOutputsZeroLengthCodeSpanIfStatementBlockEmpty.stree.txt index 898717d0f5..2128b17448 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodOutputsZeroLengthCodeSpanIfStatementBlockEmpty.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodOutputsZeroLengthCodeSpanIfStatementBlockEmpty.stree.txt @@ -1,7 +1,7 @@ Statement block - Gen - 2 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodParsesNothingIfFirstCharacterIsNotIdentifierStartOrParenOrBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodParsesNothingIfFirstCharacterIsNotIdentifierStartOrParenOrBrace.stree.txt index 8f8de632d0..7eb747e6cd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodParsesNothingIfFirstCharacterIsNotIdentifierStartOrParenOrBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodParsesNothingIfFirstCharacterIsNotIdentifierStartOrParenOrBrace.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 1 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.stree.txt index d7a2344f3c..ec0a48c2ac 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.stree.txt @@ -1,13 +1,13 @@ Statement block - Gen - 8 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [LF ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[}];AtEOL - (1:0,1) - Tokens:2 - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 1 - (7:1,4) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (7:1,4) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[ATD];K14 - (8:1,5) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (8:1,5) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfNewlineFollowsTransition.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfNewlineFollowsTransition.stree.txt index 8f8de632d0..7eb747e6cd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfNewlineFollowsTransition.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfNewlineFollowsTransition.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 1 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfWhitespaceBetweenTransitionAndBlockStartInEmbeddedExpr.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfWhitespaceBetweenTransitionAndBlockStartInEmbeddedExpr.stree.txt index cea41801d1..806ac87b47 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfWhitespaceBetweenTransitionAndBlockStartInEmbeddedExpr.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfWhitespaceBetweenTransitionAndBlockStartInEmbeddedExpr.stree.txt @@ -1,18 +1,18 @@ Statement block - Gen - 16 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [LF ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:2 - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 1 - (7:1,4) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (7:1,4) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[ATD];K14 - (8:1,5) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Code span - Gen - [ {}LF] - SpanEditHandler;Accepts:Any - (8:1,5) - Tokens:4 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (15:2,0) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/OutputsErrorIfAtSignFollowedByLessThanSignAtStatementStart.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/OutputsErrorIfAtSignFollowedByLessThanSignAtStatementStart.stree.txt index 691f6016fb..4ebf09e732 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/OutputsErrorIfAtSignFollowedByLessThanSignAtStatementStart.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/OutputsErrorIfAtSignFollowedByLessThanSignAtStatementStart.stree.txt @@ -1,30 +1,30 @@ Statement block - Gen - 23 - (0:0,0) Code span - Gen - [if(foo) {] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:6 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 13 - (9:0,9) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (9:0,9) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (10:0,10) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Tag block - Gen - 3 - (11:0,11) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (11:0,11) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Bar] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.Text;[Bar]; + SyntaxKind.HtmlTextLiteral;[Bar]; Tag block - Gen - 4 - (17:0,17) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (17:0,17) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [}] - SpanEditHandler;Accepts:Any - (22:0,22) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfCatchBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfCatchBlockUnterminatedAtEOF.stree.txt index dce1789d78..7a8d568054 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfCatchBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfCatchBlockUnterminatedAtEOF.stree.txt @@ -1,47 +1,47 @@ Statement block - Gen - 70 - (0:0,0) Code span - Gen - [try { baz(); } catch(Foo) { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:45 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.stree.txt index 08147658a8..e16058b434 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.stree.txt @@ -1,36 +1,36 @@ Directive block - Gen - 54 - (0:0,0) MetaCode span - Gen - [functions] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Identifier;[functions]; + SyntaxKind.Identifier;[functions]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (10:0,10) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ var foo = bar; if(foo != null) { bar(); } ] - CodeBlockEditHandler;Accepts:Any;CodeBlock - (11:0,11) - Tokens:28 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfDoBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfDoBlockUnterminatedAtEOF.stree.txt index 73e25271f0..dffd45efb6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfDoBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfDoBlockUnterminatedAtEOF.stree.txt @@ -1,33 +1,33 @@ Statement block - Gen - 47 - (0:0,0) Code span - Gen - [do { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:31 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseBlockUnterminatedAtEOF.stree.txt index 652f403cec..1c52331a42 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseBlockUnterminatedAtEOF.stree.txt @@ -1,47 +1,47 @@ Statement block - Gen - 68 - (0:0,0) Code span - Gen - [if(foo) { baz(); } else { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:45 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseIfBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseIfBlockUnterminatedAtEOF.stree.txt index 4750dbca0e..a37cd60847 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseIfBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseIfBlockUnterminatedAtEOF.stree.txt @@ -1,49 +1,49 @@ Statement block - Gen - 71 - (0:0,0) Code span - Gen - [if(foo) { baz(); } else if { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:47 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF.stree.txt index de02008232..ed2107e5d1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF.stree.txt @@ -1,32 +1,32 @@ Statement block - Gen - 44 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ var foo = bar; if(foo != null) { bar(); } ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[}];AtEOL - (1:0,1) - Tokens:28 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfFinallyBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfFinallyBlockUnterminatedAtEOF.stree.txt index 17ec773583..96559bd778 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfFinallyBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfFinallyBlockUnterminatedAtEOF.stree.txt @@ -1,44 +1,44 @@ Statement block - Gen - 67 - (0:0,0) Code span - Gen - [try { baz(); } finally { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:42 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForBlockUnterminatedAtEOF.stree.txt index f896c4413c..d65c73a1b9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForBlockUnterminatedAtEOF.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 54 - (0:0,0) Code span - Gen - [for (foo) { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[for]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[for]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForeachBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForeachBlockUnterminatedAtEOF.stree.txt index f040273553..611834ba29 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForeachBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForeachBlockUnterminatedAtEOF.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 58 - (0:0,0) Code span - Gen - [foreach (foo) { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[foreach]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfIfBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfIfBlockUnterminatedAtEOF.stree.txt index 8940e51eb3..9dcb914c02 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfIfBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfIfBlockUnterminatedAtEOF.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 53 - (0:0,0) Code span - Gen - [if (foo) { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfLockBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfLockBlockUnterminatedAtEOF.stree.txt index 2db346c06b..408980c538 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfLockBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfLockBlockUnterminatedAtEOF.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 55 - (0:0,0) Code span - Gen - [lock (foo) { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[lock]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[lock]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfSwitchBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfSwitchBlockUnterminatedAtEOF.stree.txt index 274707aa24..c9988fb22c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfSwitchBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfSwitchBlockUnterminatedAtEOF.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 57 - (0:0,0) Code span - Gen - [switch (foo) { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[switch]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[switch]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfTryBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfTryBlockUnterminatedAtEOF.stree.txt index b8edb26e7e..29ed508ce6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfTryBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfTryBlockUnterminatedAtEOF.stree.txt @@ -1,33 +1,33 @@ Statement block - Gen - 48 - (0:0,0) Code span - Gen - [try { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:31 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfUsingBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfUsingBlockUnterminatedAtEOF.stree.txt index 50ee1fda7f..61ae015863 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfUsingBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfUsingBlockUnterminatedAtEOF.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 56 - (0:0,0) Code span - Gen - [using (foo) { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfWhileBlockUnterminatedAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfWhileBlockUnterminatedAtEOF.stree.txt index cef398b06c..21cd2742d9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfWhileBlockUnterminatedAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfWhileBlockUnterminatedAtEOF.stree.txt @@ -1,37 +1,37 @@ Statement block - Gen - 56 - (0:0,0) Code span - Gen - [while (foo) { var foo = bar; if(foo != null) { bar(); } ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:35 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NotEqual;[!=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NotEqual;[!=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[null]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/RequiresControlFlowStatementsToHaveBraces.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/RequiresControlFlowStatementsToHaveBraces.stree.txt index b7e771e87f..03c1ddc544 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/RequiresControlFlowStatementsToHaveBraces.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/RequiresControlFlowStatementsToHaveBraces.stree.txt @@ -1,66 +1,66 @@ Statement block - Gen - 58 - (0:0,0) Code span - Gen - [if(foo) ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:5 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; Markup block - Gen - 11 - (8:0,8) Tag block - Gen - 3 - (8:0,8) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (8:0,8) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Bar] - SpanEditHandler;Accepts:Any - (11:0,11) - Tokens:1 - HtmlTokenType.Text;[Bar]; + SyntaxKind.HtmlTextLiteral;[Bar]; Tag block - Gen - 4 - (14:0,14) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (14:0,14) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (18:0,18) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [else if(bar) ] - SpanEditHandler;Accepts:Any - (19:0,19) - Tokens:7 - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; Markup block - Gen - 11 - (32:0,32) Tag block - Gen - 3 - (32:0,32) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (32:0,32) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Baz] - SpanEditHandler;Accepts:Any - (35:0,35) - Tokens:1 - HtmlTokenType.Text;[Baz]; + SyntaxKind.HtmlTextLiteral;[Baz]; Tag block - Gen - 4 - (38:0,38) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (38:0,38) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (42:0,42) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [else ] - SpanEditHandler;Accepts:Any - (43:0,43) - Tokens:2 - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; Markup block - Gen - 10 - (48:0,48) Tag block - Gen - 3 - (48:0,48) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (48:0,48) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Boz] - SpanEditHandler;Accepts:Any - (51:0,51) - Tokens:1 - HtmlTokenType.Text;[Boz]; + SyntaxKind.HtmlTextLiteral;[Boz]; Tag block - Gen - 4 - (54:0,54) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (54:0,54) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (58:0,58) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ResumesIfStatementAfterOpenParen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ResumesIfStatementAfterOpenParen.stree.txt index f1e59db50a..f1685dc452 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ResumesIfStatementAfterOpenParen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ResumesIfStatementAfterOpenParen.stree.txt @@ -1,28 +1,28 @@ Statement block - Gen - 24 - (0:0,0) Code span - Gen - [if(LFelse {] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:6 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (11:1,6) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (11:1,6) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (12:1,7) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (12:1,7) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Foo] - SpanEditHandler;Accepts:Any - (15:1,10) - Tokens:1 - HtmlTokenType.Text;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (18:1,13) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (18:1,13) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (22:1,17) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [}] - SpanEditHandler;Accepts:None - (23:1,18) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfBracketInImplicitExpressionUnclosed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfBracketInImplicitExpressionUnclosed.stree.txt index 72e23a8a3c..7edce35666 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfBracketInImplicitExpressionUnclosed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfBracketInImplicitExpressionUnclosed.stree.txt @@ -1,12 +1,12 @@ Expression block - Gen - 22 - (0:0,0) Code span - Gen - [Foo[Bar[Baz]LFBizLFBoz] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (0:0,0) - Tokens:10 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[Biz]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[Boz]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[Biz]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[Boz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfIfParenInExplicitExprUnclosed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfIfParenInExplicitExprUnclosed.stree.txt index 78cdf0005e..5bc5080b04 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfIfParenInExplicitExprUnclosed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfIfParenInExplicitExprUnclosed.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 13 - (0:0,0) MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [foo barLFbaz] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:5 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[baz]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfParenInImplicitExprUnclosed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfParenInImplicitExprUnclosed.stree.txt index 8a2b46772d..487be52e9e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfParenInImplicitExprUnclosed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtEOFIfParenInImplicitExprUnclosed.stree.txt @@ -1,12 +1,12 @@ Expression block - Gen - 22 - (0:0,0) Code span - Gen - [Foo(Bar(Baz)LFBizLFBoz] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (0:0,0) - Tokens:10 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[Biz]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[Boz]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[Biz]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[Boz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfBracketInImplicitExprUnclosed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfBracketInImplicitExprUnclosed.stree.txt index ec70a45174..6f02e88cec 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfBracketInImplicitExprUnclosed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfBracketInImplicitExprUnclosed.stree.txt @@ -1,11 +1,11 @@ Expression block - Gen - 19 - (0:0,0) Code span - Gen - [Foo[Bar[Baz]LFBizLF] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (0:0,0) - Tokens:9 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[Biz]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[Biz]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfIfParenInExplicitExprUnclosed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfIfParenInExplicitExprUnclosed.stree.txt index c23684a3e4..526cc8c992 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfIfParenInExplicitExprUnclosed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfIfParenInExplicitExprUnclosed.stree.txt @@ -1,8 +1,8 @@ Expression block - Gen - 10 - (0:0,0) MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [foo barLF] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:4 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfParenInImplicitExpressionUnclosed.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfParenInImplicitExpressionUnclosed.stree.txt index e8a7af923b..74a5b4d8e8 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfParenInImplicitExpressionUnclosed.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/ShouldReportErrorAndTerminateAtMarkupIfParenInImplicitExpressionUnclosed.stree.txt @@ -1,11 +1,11 @@ Expression block - Gen - 19 - (0:0,0) Code span - Gen - [Foo(Bar(Baz)LFBizLF] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (0:0,0) - Tokens:9 - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[Biz]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[Biz]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesForeachBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesForeachBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt index 7bbc78e8ff..4ea2cc9be1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesForeachBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesForeachBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt @@ -1,8 +1,8 @@ Statement block - Gen - 17 - (0:0,0) Code span - Gen - [foreach(foo barLF] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:6 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[foreach]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesIfBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesIfBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt index d12e4eeb98..2fb112facd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesIfBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesIfBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt @@ -1,8 +1,8 @@ Statement block - Gen - 12 - (0:0,0) Code span - Gen - [if(foo barLF] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:6 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing.stree.txt index 83c5c0e7bc..c8a7548e04 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing.stree.txt @@ -1,21 +1,21 @@ Statement block - Gen - 41 - (0:0,0) Code span - Gen - [if(foo) {LF var p = "foo bar bazLF;LF}] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:19 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[p]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["foo bar baz];RZ1000(23:1,12 [1] ) - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[p]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["foo bar baz];RZ1000(23:1,12 [1] ) + SyntaxKind.NewLine;[LF]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.stree.txt index f62bdc8820..5626bc0158 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.stree.txt @@ -1,16 +1,16 @@ Statement block - Gen - 45 - (0:0,0) Code span - Gen - [if(foo) { var foo = "blah blah blah blah blah] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:14 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;["blah blah blah blah blah];RZ1000(20:0,20 [1] ) + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;["blah blah blah blah blah];RZ1000(20:0,20 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesUsingBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesUsingBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt index c0593ccb6f..cb18b098c3 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesUsingBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesUsingBlockAtEOLWhenRecoveringFromMissingCloseParen.stree.txt @@ -1,8 +1,8 @@ Statement block - Gen - 15 - (0:0,0) Code span - Gen - [using(foo barLF] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:6 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[using]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.stree.txt index b657dfb7d1..e3dff85a70 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.stree.txt @@ -1,16 +1,16 @@ Statement block - Gen - 60 - (0:0,0) Code span - Gen - [if(foo) { var foo = @"blah LFblah; LF

Foo

LFblah LFblah] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:14 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.StringLiteral;[@"blah LFblah; LF

Foo

LFblah LFblah];RZ1000(20:0,20 [1] ) + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.StringLiteral;[@"blah LFblah; LF

Foo

LFblah LFblah];RZ1000(20:0,20 [1] ) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesWhileClauseInDoStmtAtEOLWhenRecoveringFromMissingCloseParen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesWhileClauseInDoStmtAtEOLWhenRecoveringFromMissingCloseParen.stree.txt index 9f5bb09d03..995a7e16d8 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesWhileClauseInDoStmtAtEOLWhenRecoveringFromMissingCloseParen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/TerminatesWhileClauseInDoStmtAtEOLWhenRecoveringFromMissingCloseParen.stree.txt @@ -1,14 +1,14 @@ Statement block - Gen - 22 - (0:0,0) Code span - Gen - [do { } while(foo barLF] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:12 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/WithHelperDirectiveProducesError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/WithHelperDirectiveProducesError.stree.txt index 1454016ba1..e9fc23c08a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/WithHelperDirectiveProducesError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/WithHelperDirectiveProducesError.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 7 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [helper] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[helper]; + SyntaxKind.Identifier;[helper]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/WithNestedCodeBlockProducesError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/WithNestedCodeBlockProducesError.stree.txt index bf52f4c935..c4e84ca787 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/WithNestedCodeBlockProducesError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpErrorTest/WithNestedCodeBlockProducesError.stree.txt @@ -1,20 +1,20 @@ Statement block - Gen - 11 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if { ] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:4 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Statement block - Gen - 3 - (6:0,6) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (6:0,6) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (7:0,7) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (8:0,8) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (8:0,8) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Code span - Gen - [ }] - SpanEditHandler;Accepts:Any - (9:0,9) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptConsecutiveEscapedQuotesInNonVerbatimStrings.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptConsecutiveEscapedQuotesInNonVerbatimStrings.stree.txt index ab2776cd54..23eb18e378 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptConsecutiveEscapedQuotesInNonVerbatimStrings.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptConsecutiveEscapedQuotesInNonVerbatimStrings.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 9 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - ["\"\""] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.StringLiteral;["\"\""]; + SyntaxKind.StringLiteral;["\"\""]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (8:0,8) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptConsecutiveEscapedQuotesInVerbatimStrings.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptConsecutiveEscapedQuotesInVerbatimStrings.stree.txt index 173672adb1..6b9fcb7197 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptConsecutiveEscapedQuotesInVerbatimStrings.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptConsecutiveEscapedQuotesInVerbatimStrings.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 10 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [@""""""] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.StringLiteral;[@""""""]; + SyntaxKind.StringLiteral;[@""""""]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (9:0,9) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptEscapedQuoteInNonVerbatimStrings.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptEscapedQuoteInNonVerbatimStrings.stree.txt index 28ef6bad21..f0cd494583 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptEscapedQuoteInNonVerbatimStrings.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptEscapedQuoteInNonVerbatimStrings.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 7 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - ["\""] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.StringLiteral;["\""]; + SyntaxKind.StringLiteral;["\""]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (6:0,6) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptEscapedQuoteInVerbatimStrings.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptEscapedQuoteInVerbatimStrings.stree.txt index e8c4fd0f60..302eae7f86 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptEscapedQuoteInVerbatimStrings.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptEscapedQuoteInVerbatimStrings.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [@""""] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.StringLiteral;[@""""]; + SyntaxKind.StringLiteral;[@""""]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (7:0,7) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultiLineVerbatimStrings.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultiLineVerbatimStrings.stree.txt index c30fec9476..031978a70f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultiLineVerbatimStrings.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultiLineVerbatimStrings.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 23 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [@"LFFooLFBarLFBazLF"] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.StringLiteral;[@"LFFooLFBarLFBazLF"]; + SyntaxKind.StringLiteral;[@"LFFooLFBarLFBazLF"]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (22:4,1) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleEscapedQuotesInNonVerbatimStrings.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleEscapedQuotesInNonVerbatimStrings.stree.txt index 054fbe06a9..196693b74a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleEscapedQuotesInNonVerbatimStrings.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleEscapedQuotesInNonVerbatimStrings.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - ["\"hello, world\""] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.StringLiteral;["\"hello, world\""]; + SyntaxKind.StringLiteral;["\"hello, world\""]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (20:0,20) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleEscapedQuotesInVerbatimStrings.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleEscapedQuotesInVerbatimStrings.stree.txt index a77e2669da..3db6a694d2 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleEscapedQuotesInVerbatimStrings.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleEscapedQuotesInVerbatimStrings.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [@"""hello, world"""] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.StringLiteral;[@"""hello, world"""]; + SyntaxKind.StringLiteral;[@"""hello, world"""]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleRepeatedEscapedQuoteInVerbatimStrings.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleRepeatedEscapedQuoteInVerbatimStrings.stree.txt index 173672adb1..6b9fcb7197 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleRepeatedEscapedQuoteInVerbatimStrings.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldAcceptMultipleRepeatedEscapedQuoteInVerbatimStrings.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 10 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [@""""""] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.StringLiteral;[@""""""]; + SyntaxKind.StringLiteral;[@""""""]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (9:0,9) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldOutputZeroLengthCodeSpanIfEOFOccursAfterStartOfExplicitExpr.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldOutputZeroLengthCodeSpanIfEOFOccursAfterStartOfExplicitExpr.stree.txt index f477a803b1..796bf69308 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldOutputZeroLengthCodeSpanIfEOFOccursAfterStartOfExplicitExpr.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldOutputZeroLengthCodeSpanIfEOFOccursAfterStartOfExplicitExpr.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 2 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldOutputZeroLengthCodeSpanIfExplicitExpressionIsEmpty.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldOutputZeroLengthCodeSpanIfExplicitExpressionIsEmpty.stree.txt index ac2afba6aa..86c59ee8dc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldOutputZeroLengthCodeSpanIfExplicitExpressionIsEmpty.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpExplicitExpressionTest/ShouldOutputZeroLengthCodeSpanIfExplicitExpressionIsEmpty.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 3 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (2:0,2) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/AcceptsNonEnglishCharactersThatAreValidIdentifiers.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/AcceptsNonEnglishCharactersThatAreValidIdentifiers.stree.txt index 7d0e4caeab..d441e4c205 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/AcceptsNonEnglishCharactersThatAreValidIdentifiers.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/AcceptsNonEnglishCharactersThatAreValidIdentifiers.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [हळूँजद॔] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[हळूँजद॔]; + SyntaxKind.Identifier;[हळूँजद॔]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotAcceptSemicolonIfExpressionTerminatedByWhitespace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotAcceptSemicolonIfExpressionTerminatedByWhitespace.stree.txt index 8967206fd1..725e28d010 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotAcceptSemicolonIfExpressionTerminatedByWhitespace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotAcceptSemicolonIfExpressionTerminatedByWhitespace.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotAtEOFInImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotAtEOFInImplicitExpression.stree.txt index a319543617..b8261129c1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotAtEOFInImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotAtEOFInImplicitExpression.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr1.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr1.stree.txt index a319543617..b8261129c1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr1.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr1.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr2.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr2.stree.txt index a319543617..b8261129c1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr2.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr2.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeSemicolonAfterDot.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeSemicolonAfterDot.stree.txt index a319543617..b8261129c1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeSemicolonAfterDot.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/DoesNotIncludeSemicolonAfterDot.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/IgnoresSemicolonAtEndOfDottedIdentifiers.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/IgnoresSemicolonAtEndOfDottedIdentifiers.stree.txt index b130a21495..060942ec7d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/IgnoresSemicolonAtEndOfDottedIdentifiers.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/IgnoresSemicolonAtEndOfDottedIdentifiers.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 12 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar.baz] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:5 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[baz]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/IgnoresSemicolonAtEndOfSimpleImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/IgnoresSemicolonAtEndOfSimpleImplicitExpression.stree.txt index 8967206fd1..725e28d010 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/IgnoresSemicolonAtEndOfSimpleImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/IgnoresSemicolonAtEndOfSimpleImplicitExpression.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/NestedImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/NestedImplicitExpression.stree.txt index ca459f326c..5da270085a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/NestedImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/NestedImplicitExpression.stree.txt @@ -1,18 +1,18 @@ Statement block - Gen - 18 - (0:0,0) Code span - Gen - [if (true) { ] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:8 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 4 - (12:0,12) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (12:0,12) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[ATD];K14 - (13:0,13) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Code span - Gen - [ }] - SpanEditHandler;Accepts:Any - (16:0,16) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputExpressionIfModuleTokenNotFollowedByBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputExpressionIfModuleTokenNotFollowedByBrace.stree.txt index e32608be70..e92c3fce23 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputExpressionIfModuleTokenNotFollowedByBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputExpressionIfModuleTokenNotFollowedByBrace.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 13 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [module.foo()] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:5 - CSharpTokenType.Identifier;[module]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Identifier;[module]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputsZeroLengthCodeSpanIfEOFOccursAfterTransition.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputsZeroLengthCodeSpanIfEOFOccursAfterTransition.stree.txt index 8f8de632d0..7eb747e6cd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputsZeroLengthCodeSpanIfEOFOccursAfterTransition.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputsZeroLengthCodeSpanIfEOFOccursAfterTransition.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 1 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputsZeroLengthCodeSpanIfInvalidCharacterFollowsTransition.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputsZeroLengthCodeSpanIfInvalidCharacterFollowsTransition.stree.txt index 8f8de632d0..7eb747e6cd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputsZeroLengthCodeSpanIfInvalidCharacterFollowsTransition.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputsZeroLengthCodeSpanIfInvalidCharacterFollowsTransition.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 1 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesDottedIdentifiersAsImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesDottedIdentifiersAsImplicitExpression.stree.txt index b130a21495..060942ec7d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesDottedIdentifiersAsImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesDottedIdentifiersAsImplicitExpression.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 12 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar.baz] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:5 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[baz]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket1.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket1.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket1.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket1.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket10.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket10.stree.txt index a03e6f1514..b75c89c993 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket10.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket10.stree.txt @@ -1,10 +1,10 @@ Expression block - Gen - 9 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[-1]] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:6 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Minus;[-]; - CSharpTokenType.IntegerLiteral;[1]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Minus;[-]; + SyntaxKind.IntegerLiteral;[1]; + SyntaxKind.RightBracket;[]]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket11.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket11.stree.txt index 2445b36952..646f168e3a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket11.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket11.stree.txt @@ -1,12 +1,12 @@ Expression block - Gen - 15 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[abc]?[def] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:8 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[abc]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[def]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[abc]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[def]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket12.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket12.stree.txt index fcfaadd462..bbad538e45 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket12.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket12.stree.txt @@ -1,13 +1,13 @@ Expression block - Gen - 14 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[abc]?[2]] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:9 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[abc]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.IntegerLiteral;[2]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[abc]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.IntegerLiteral;[2]; + SyntaxKind.RightBracket;[]]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket13.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket13.stree.txt index 3c1fe5005f..dcf3351109 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket13.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket13.stree.txt @@ -1,16 +1,16 @@ Expression block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[abc]?.more?[def]] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:12 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[abc]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[more]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[def]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[abc]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[more]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[def]; + SyntaxKind.RightBracket;[]]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket14.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket14.stree.txt index 24b8db6eaf..0ab6dbedb2 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket14.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket14.stree.txt @@ -1,15 +1,15 @@ Expression block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[abc]?.more?.abc] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:11 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[abc]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[more]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[abc]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[abc]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[more]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[abc]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket15.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket15.stree.txt index d8b3eb81dd..862674dabb 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket15.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket15.stree.txt @@ -1,13 +1,13 @@ Expression block - Gen - 19 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[null ?? true]] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:9 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NullCoalesce;[??]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Keyword;[null]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NullCoalesce;[??]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightBracket;[]]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket16.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket16.stree.txt index 6cef2a04b9..24550faa6d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket16.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket16.stree.txt @@ -1,17 +1,17 @@ Expression block - Gen - 20 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[abc?.gef?[-1]]] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:13 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[abc]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[gef]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Minus;[-]; - CSharpTokenType.IntegerLiteral;[1]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[abc]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[gef]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Minus;[-]; + SyntaxKind.IntegerLiteral;[1]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.RightBracket;[]]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket2.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket2.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket2.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket2.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket3.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket3.stree.txt index 6323d68f11..c0e4634e0e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket3.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket3.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 6 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket4.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket4.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket4.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket4.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket5.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket5.stree.txt index a46eeb9133..0fc1f37efc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket5.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket5.stree.txt @@ -1,8 +1,8 @@ Expression block - Gen - 10 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[more] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:4 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[more]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[more]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket6.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket6.stree.txt index b57c6e2517..bdadd39b5e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket6.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket6.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[0]] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:5 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.RightBracket;[]]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.RightBracket;[]]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket7.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket7.stree.txt index 6323d68f11..c0e4634e0e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket7.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket7.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 6 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket8.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket8.stree.txt index 61ca8525a6..c58999c69b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket8.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket8.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 11 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?[more.] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:5 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.Identifier;[more]; - CSharpTokenType.Dot;[.]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.Identifier;[more]; + SyntaxKind.Dot;[.]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket9.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket9.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket9.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket9.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot1.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot1.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot1.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot1.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot10.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot10.stree.txt index 957c73bbe7..f67c21be69 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot10.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot10.stree.txt @@ -1,8 +1,8 @@ Expression block - Gen - 10 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?.more] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:4 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[more]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[more]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot11.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot11.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot11.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot11.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot12.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot12.stree.txt index 0a0c3e1a67..1bdaa5ec4a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot12.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot12.stree.txt @@ -1,13 +1,13 @@ Expression block - Gen - 19 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?.more(false)?.] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:9 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[more]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[more]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot13.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot13.stree.txt index 8f54d19b74..c3f560c41f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot13.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot13.stree.txt @@ -1,14 +1,14 @@ Expression block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?.more(false)?.abc] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:10 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[more]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[abc]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[more]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[abc]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot14.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot14.stree.txt index bfb8b54625..b205008652 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot14.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot14.stree.txt @@ -1,18 +1,18 @@ Expression block - Gen - 29 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?.more(null ?? true)?.abc] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:14 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[more]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[null]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NullCoalesce;[??]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[abc]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[more]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[null]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NullCoalesce;[??]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[abc]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot2.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot2.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot2.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot2.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot3.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot3.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot3.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot3.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot4.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot4.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot4.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot4.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot5.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot5.stree.txt index 3860072ffb..82907ca1e1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot5.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot5.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 6 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?.] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot6.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot6.stree.txt index d0922098d3..9e2bfc0869 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot6.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot6.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[val]; + SyntaxKind.Identifier;[val]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot7.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot7.stree.txt index 3860072ffb..82907ca1e1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot7.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot7.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 6 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?.] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot8.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot8.stree.txt index 3860072ffb..82907ca1e1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot8.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot8.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 6 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?.] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot9.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot9.stree.txt index 957c73bbe7..f67c21be69 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot9.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot9.stree.txt @@ -1,8 +1,8 @@ Expression block - Gen - 10 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [val?.more] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:4 - CSharpTokenType.Identifier;[val]; - CSharpTokenType.QuestionMark;[?]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[more]; + SyntaxKind.Identifier;[val]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[more]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesSingleIdentifierAsImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesSingleIdentifierAsImplicitExpression.stree.txt index 8967206fd1..725e28d010 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesSingleIdentifierAsImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesSingleIdentifierAsImplicitExpression.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesBracketsAndBalancesThemInImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesBracketsAndBalancesThemInImplicitExpression.stree.txt index b600515ce2..8631741216 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesBracketsAndBalancesThemInImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesBracketsAndBalancesThemInImplicitExpression.stree.txt @@ -1,25 +1,25 @@ Expression block - Gen - 34 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar[4 * (8 + 7)]["fo\"o"].baz] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:21 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.IntegerLiteral;[4]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Star;[*]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.IntegerLiteral;[8]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Plus;[+]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[7]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.StringLiteral;["fo\"o"]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[baz]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.IntegerLiteral;[4]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Star;[*]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.IntegerLiteral;[8]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Plus;[+]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[7]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.StringLiteral;["fo\"o"]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesParenthesesAndBalancesThemInImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesParenthesesAndBalancesThemInImplicitExpression.stree.txt index 860b824f83..ad8aad0d56 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesParenthesesAndBalancesThemInImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesParenthesesAndBalancesThemInImplicitExpression.stree.txt @@ -1,63 +1,63 @@ Expression block - Gen - 115 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo().bar("bi\"z", 4)("chained method; call").baz(@"bo""z", '\'', () => { return 4; }, (4+5+new { foo = bar[4] }))] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:59 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;["bi\"z"]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[4]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;["chained method; call"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;[@"bo""z"]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.CharacterLiteral;['\'']; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.GreaterThanEqual;[=>]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[return]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[4]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.IntegerLiteral;[4]; - CSharpTokenType.Plus;[+]; - CSharpTokenType.IntegerLiteral;[5]; - CSharpTokenType.Plus;[+]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftBracket;[[]; - CSharpTokenType.IntegerLiteral;[4]; - CSharpTokenType.RightBracket;[]]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;["bi\"z"]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[4]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;["chained method; call"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;[@"bo""z"]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CharacterLiteral;['\'']; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.GreaterThanEqual;[=>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[return]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[4]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.IntegerLiteral;[4]; + SyntaxKind.Plus;[+]; + SyntaxKind.IntegerLiteral;[5]; + SyntaxKind.Plus;[+]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftBracket;[[]; + SyntaxKind.IntegerLiteral;[4]; + SyntaxKind.RightBracket;[]]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/StopsBalancingParenthesesAtEOF.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/StopsBalancingParenthesesAtEOF.stree.txt index baef337685..11fbcd48bc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/StopsBalancingParenthesesAtEOF.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/StopsBalancingParenthesesAtEOF.stree.txt @@ -1,8 +1,8 @@ Expression block - Gen - 7 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo(()] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:4 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/SupportsSlashesWithinComplexImplicitExpressions.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/SupportsSlashesWithinComplexImplicitExpressions.stree.txt index 00f9a55723..e6d5d2ef7c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/SupportsSlashesWithinComplexImplicitExpressions.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/SupportsSlashesWithinComplexImplicitExpressions.stree.txt @@ -1,39 +1,39 @@ Expression block - Gen - 103 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [DataGridColumn.Template("Years of Service", e => (int)Math.Round((DateTime.Now - dt).TotalDays / 365))] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:35 - CSharpTokenType.Identifier;[DataGridColumn]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Template]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;["Years of Service"]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[e]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.GreaterThanEqual;[=>]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Identifier;[Math]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Round]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[DateTime]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Now]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Minus;[-]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[dt]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[TotalDays]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Slash;[/]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[365]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Identifier;[DataGridColumn]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Template]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;["Years of Service"]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[e]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.GreaterThanEqual;[=>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Identifier;[Math]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Round]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[DateTime]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Now]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Minus;[-]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[dt]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[TotalDays]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Slash;[/]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[365]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesAfterIdentifierUnlessFollowedByDotOrParenInImplicitExpr.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesAfterIdentifierUnlessFollowedByDotOrParenInImplicitExpr.stree.txt index a319543617..b8261129c1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesAfterIdentifierUnlessFollowedByDotOrParenInImplicitExpr.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesAfterIdentifierUnlessFollowedByDotOrParenInImplicitExpr.stree.txt @@ -1,7 +1,7 @@ Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExprBeforeDotIfDotNotFollowedByIdentifierStartChar.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExprBeforeDotIfDotNotFollowedByIdentifierStartChar.stree.txt index 505ddd1f05..198a6f8da7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExprBeforeDotIfDotNotFollowedByIdentifierStartChar.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExprBeforeDotIfDotNotFollowedByIdentifierStartChar.stree.txt @@ -1,11 +1,11 @@ Expression block - Gen - 14 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo().bar.baz] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:7 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[baz]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtHtmlEndTag.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtHtmlEndTag.stree.txt index 505ddd1f05..198a6f8da7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtHtmlEndTag.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtHtmlEndTag.stree.txt @@ -1,11 +1,11 @@ Expression block - Gen - 14 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo().bar.baz] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:7 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[baz]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtHtmlStartTag.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtHtmlStartTag.stree.txt index 505ddd1f05..198a6f8da7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtHtmlStartTag.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtHtmlStartTag.stree.txt @@ -1,11 +1,11 @@ Expression block - Gen - 14 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo().bar.baz] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:7 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[baz]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[baz]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtLastValidPointIfDotFollowedByWhitespace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtLastValidPointIfDotFollowedByWhitespace.stree.txt index 8967206fd1..725e28d010 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtLastValidPointIfDotFollowedByWhitespace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionAtLastValidPointIfDotFollowedByWhitespace.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionIfCloseParenFollowedByAnyWhiteSpace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionIfCloseParenFollowedByAnyWhiteSpace.stree.txt index 7dc1a3a043..da76ba6424 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionIfCloseParenFollowedByAnyWhiteSpace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionIfCloseParenFollowedByAnyWhiteSpace.stree.txt @@ -1,9 +1,9 @@ Expression block - Gen - 10 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo.bar()] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:5 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionIfIdentifierFollowedByAnyWhiteSpace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionIfIdentifierFollowedByAnyWhiteSpace.stree.txt index 8967206fd1..725e28d010 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionIfIdentifierFollowedByAnyWhiteSpace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpImplicitExpressionTest/TerminatesImplicitExpressionIfIdentifierFollowedByAnyWhiteSpace.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedCodeBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedCodeBlock.stree.txt index f34e002cbb..512300af6c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedCodeBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedCodeBlock.stree.txt @@ -1,29 +1,29 @@ Statement block - Gen - 35 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [while(true) { { { { foo(); } } } }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:25 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedExplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedExplicitExpression.stree.txt index e7571bdb11..7431ac8024 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedExplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedExplicitExpression.stree.txt @@ -1,23 +1,23 @@ Statement block - Gen - 23 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [while(true) { ] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:7 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 6 - (15:0,15) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [foo] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (20:0,20) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; Code span - Gen - [ }] - SpanEditHandler;Accepts:None - (21:0,21) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedImplicitExpression.stree.txt index 2f0e49b1ad..90eb32855a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedImplicitExpression.stree.txt @@ -1,19 +1,19 @@ Statement block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [while(true) { ] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:7 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 4 - (15:0,15) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[ATD];K14 - (16:0,16) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Code span - Gen - [ }] - SpanEditHandler;Accepts:None - (19:0,19) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedKeywordStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedKeywordStatement.stree.txt index f7c3782b99..8bb927c9e5 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedKeywordStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedKeywordStatement.stree.txt @@ -1,43 +1,43 @@ Statement block - Gen - 55 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [while(true) { for(int i = 0; i < 10; i++) { foo(); } }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:39 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[for]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.Increment;[++]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[for]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Increment;[++]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedMarkupBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedMarkupBlock.stree.txt index 8293783918..c5121d3905 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedMarkupBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedMarkupBlock.stree.txt @@ -1,30 +1,30 @@ Statement block - Gen - 29 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [while(true) {] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:6 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 14 - (14:0,14) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (15:0,15) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Hello] - SpanEditHandler;Accepts:Any - (18:0,18) - Tokens:1 - HtmlTokenType.Text;[Hello]; + SyntaxKind.HtmlTextLiteral;[Hello]; Tag block - Gen - 4 - (23:0,23) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (23:0,23) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:None - (27:0,27) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [}] - SpanEditHandler;Accepts:None - (28:0,28) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedSimpleStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedSimpleStatement.stree.txt index 5a2eb3d2e3..9c3cab8153 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedSimpleStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedSimpleStatement.stree.txt @@ -1,17 +1,17 @@ Statement block - Gen - 23 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [while(true) { foo(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:13 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/EmptyRazorComment.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/EmptyRazorComment.stree.txt index 23850e4407..0fa26e309a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/EmptyRazorComment.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/EmptyRazorComment.stree.txt @@ -1,16 +1,16 @@ Markup block - Gen - 4 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Comment block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (2:0,2) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (3:0,3) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (4:0,4) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/MultipleRazorCommentInMarkup.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/MultipleRazorCommentInMarkup.stree.txt index 7c36168330..8916eb268a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/MultipleRazorCommentInMarkup.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/MultipleRazorCommentInMarkup.stree.txt @@ -1,43 +1,43 @@ Markup block - Gen - 25 - (0:0,0) Tag block - Gen - 3 - (0:0,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (3:0,3) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (5:1,0) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 4 - (7:1,2) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (7:1,2) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (8:1,3) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (9:1,4) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (9:1,4) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (10:1,5) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [ LF] - SpanEditHandler;Accepts:Any - (11:1,6) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NewLine;[LF]; Comment block - Gen - 4 - (15:2,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (15:2,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (16:2,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (17:2,2) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (17:2,2) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (18:2,3) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (19:2,4) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Tag block - Gen - 4 - (21:3,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (21:3,0) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/MultipleRazorCommentsInSameLineInMarkup.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/MultipleRazorCommentsInSameLineInMarkup.stree.txt index 89fc73cdc8..20ca27d14b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/MultipleRazorCommentsInSameLineInMarkup.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/MultipleRazorCommentsInSameLineInMarkup.stree.txt @@ -1,42 +1,42 @@ Markup block - Gen - 21 - (0:0,0) Tag block - Gen - 3 - (0:0,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (3:0,3) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Comment block - Gen - 4 - (5:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (5:1,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (6:1,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (7:1,2) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (7:1,2) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (8:1,3) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (9:1,4) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (9:1,4) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 4 - (11:1,6) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (11:1,6) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (12:1,7) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (13:1,8) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (13:1,8) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (14:1,9) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (15:1,10) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Tag block - Gen - 4 - (17:2,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (17:2,0) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInClosingTagBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInClosingTagBlock.stree.txt index 4ac1dd74e2..313e55405c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInClosingTagBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInClosingTagBlock.stree.txt @@ -1,25 +1,25 @@ Markup block - Gen - 33 - (0:0,0) Tag block - Gen - 6 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[text]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[text]; + SyntaxKind.CloseAngle;[>]; Tag block - Gen - 7 - (6:0,6) Markup span - Gen - [ - 19 - (13:0,13) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (13:0,13) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (14:0,14) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ razor comment ] - SpanEditHandler;Accepts:Any - (15:0,15) - Tokens:1 - HtmlTokenType.RazorComment;[ razor comment ]; + SyntaxKind.RazorComment;[ razor comment ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (30:0,30) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (31:0,31) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [>] - SpanEditHandler;Accepts:Any - (32:0,32) - Tokens:1 - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInImplicitExpressionMethodCall.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInImplicitExpressionMethodCall.stree.txt index a720123ae4..0fa62fac08 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInImplicitExpressionMethodCall.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInImplicitExpressionMethodCall.stree.txt @@ -1,23 +1,23 @@ Markup block - Gen - 13 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 13 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo(LF] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:3 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.NewLine;[LF]; Comment block - Gen - 4 - (7:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (7:1,0) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (8:1,1) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (9:1,2) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (9:1,2) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (10:1,3) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Code span - Gen - [LF] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (11:1,4) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInMarkup.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInMarkup.stree.txt index d220dd0bc1..9c04d664e6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInMarkup.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInMarkup.stree.txt @@ -1,27 +1,27 @@ Markup block - Gen - 15 - (0:0,0) Tag block - Gen - 3 - (0:0,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (3:0,3) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Comment block - Gen - 4 - (5:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (5:1,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (6:1,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (7:1,2) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (7:1,2) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (8:1,3) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (9:1,4) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Tag block - Gen - 4 - (11:2,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (11:2,0) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInOpeningTagBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInOpeningTagBlock.stree.txt index 2b80249ac8..21593eddb8 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInOpeningTagBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInOpeningTagBlock.stree.txt @@ -1,25 +1,25 @@ Markup block - Gen - 33 - (0:0,0) Tag block - Gen - 26 - (0:0,0) Markup span - Gen - [ - 19 - (6:0,6) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (6:0,6) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (7:0,7) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ razor comment ] - SpanEditHandler;Accepts:Any - (8:0,8) - Tokens:1 - HtmlTokenType.RazorComment;[ razor comment ]; + SyntaxKind.RazorComment;[ razor comment ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (23:0,23) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (24:0,24) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [>] - SpanEditHandler;Accepts:Any - (25:0,25) - Tokens:1 - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.CloseAngle;[>]; Tag block - Gen - 7 - (26:0,26) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (26:0,26) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[text]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[text]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInVerbatimBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInVerbatimBlock.stree.txt index c83ed3402f..96f45bcfe1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInVerbatimBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInVerbatimBlock.stree.txt @@ -1,35 +1,35 @@ Markup block - Gen - 26 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Statement block - Gen - 26 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [LF ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[}];AtEOL - (2:0,2) - Tokens:2 - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Markup block - Gen - 18 - (8:1,4) Tag block - Gen - 5 - (8:1,4) Transition span - Gen - [ - [LF] - SpanEditHandler;Accepts:None - (13:1,9) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (15:2,0) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 4 - (19:2,4) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (19:2,4) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (20:2,5) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (21:2,6) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (21:2,6) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (22:2,7) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (23:2,8) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [}] - SpanEditHandler;Accepts:Any - (25:3,0) - Tokens:1 - HtmlTokenType.Text;[}]; + SyntaxKind.HtmlTextLiteral;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentWithExtraNewLineInMarkup.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentWithExtraNewLineInMarkup.stree.txt index 45a7650f51..ec7b5e245e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentWithExtraNewLineInMarkup.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentWithExtraNewLineInMarkup.stree.txt @@ -1,43 +1,43 @@ Markup block - Gen - 45 - (0:0,0) Tag block - Gen - 3 - (0:0,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LFLF] - SpanEditHandler;Accepts:Any - (3:0,3) - Tokens:2 - HtmlTokenType.NewLine;[LF]; - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Comment block - Gen - 13 - (7:2,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (7:2,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (8:2,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ content ] - SpanEditHandler;Accepts:Any - (9:2,2) - Tokens:1 - HtmlTokenType.RazorComment;[ content ]; + SyntaxKind.RazorComment;[ content ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (18:2,11) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (19:2,12) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (20:2,13) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Comment block - Gen - 15 - (22:3,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (22:3,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (23:3,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [LFcontentLF] - SpanEditHandler;Accepts:Any - (24:3,2) - Tokens:1 - HtmlTokenType.RazorComment;[LFcontentLF]; + SyntaxKind.RazorComment;[LFcontentLF]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (35:5,0) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (36:5,1) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (37:5,2) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; SyntaxKind.HtmlText - [LF] - [39..41) - FullWidth: 2 - Slots: 1 SyntaxKind.NewLine;[LF]; Tag block - Gen - 4 - (41:7,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (41:7,0) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentsSurroundingMarkup.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentsSurroundingMarkup.stree.txt index c9889ac49d..ac2c6e2c12 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentsSurroundingMarkup.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentsSurroundingMarkup.stree.txt @@ -1,42 +1,42 @@ Markup block - Gen - 42 - (0:0,0) Tag block - Gen - 3 - (0:0,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (3:0,3) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Comment block - Gen - 11 - (5:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (5:1,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (6:1,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ hello ] - SpanEditHandler;Accepts:Any - (7:1,2) - Tokens:1 - HtmlTokenType.RazorComment;[ hello ]; + SyntaxKind.RazorComment;[ hello ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (14:1,9) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (15:1,10) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; Markup span - Gen - [ content ] - SpanEditHandler;Accepts:Any - (16:1,11) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[content]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[content]; + SyntaxKind.Whitespace;[ ]; Comment block - Gen - 11 - (25:1,20) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (25:1,20) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (26:1,21) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [ world ] - SpanEditHandler;Accepts:Any - (27:1,22) - Tokens:1 - HtmlTokenType.RazorComment;[ world ]; + SyntaxKind.RazorComment;[ world ]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (34:1,29) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (35:1,30) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; SyntaxKind.HtmlText - [LF] - [36..38) - FullWidth: 2 - Slots: 1 SyntaxKind.NewLine;[LF]; Tag block - Gen - 4 - (38:2,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (38:2,0) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorComment.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorComment.stree.txt index a42813eed7..e205d34acc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorComment.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorComment.stree.txt @@ -1,10 +1,10 @@ Markup block - Gen - 2 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Comment block - Gen - 2 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - HtmlTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - HtmlTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (2:0,2) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInImplicitExpressionMethodCall.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInImplicitExpressionMethodCall.stree.txt index 9e50cab6a4..edad214460 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInImplicitExpressionMethodCall.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInImplicitExpressionMethodCall.stree.txt @@ -1,16 +1,16 @@ Markup block - Gen - 7 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 7 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foo(] - ImplicitExpressionEditHandler;Accepts:Any;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:2 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; Comment block - Gen - 2 - (5:0,5) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (5:0,5) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (6:0,6) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (7:0,7) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInVerbatimBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInVerbatimBlock.stree.txt index cd383fd925..943ac7f11a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInVerbatimBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInVerbatimBlock.stree.txt @@ -1,17 +1,17 @@ Markup block - Gen - 4 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Statement block - Gen - 4 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[}];AtEOL - (2:0,2) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Comment block - Gen - 2 - (2:0,2) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (2:0,2) - Tokens:1 - CSharpTokenType.RazorCommentTransition;[@]; + SyntaxKind.RazorCommentTransition;[@]; MetaCode span - Gen - [*] - SpanEditHandler;Accepts:None - (3:0,3) - Tokens:1 - CSharpTokenType.RazorCommentStar;[*]; + SyntaxKind.RazorCommentStar;[*]; Comment span - Gen - [] - SpanEditHandler;Accepts:Any - (4:0,4) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpReservedWordsTest/ReservedWord.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpReservedWordsTest/ReservedWord.stree.txt index 65ed4440a2..33f4203300 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpReservedWordsTest/ReservedWord.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpReservedWordsTest/ReservedWord.stree.txt @@ -1,3 +1,3 @@ Directive block - Gen - 9 - (0:0,0) MetaCode span - Gen - [namespace] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Keyword;[namespace]; + SyntaxKind.Keyword;[namespace]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpReservedWordsTest/ReservedWordIsCaseSensitive.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpReservedWordsTest/ReservedWordIsCaseSensitive.stree.txt index 3c97840031..f66318d5de 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpReservedWordsTest/ReservedWordIsCaseSensitive.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpReservedWordsTest/ReservedWordIsCaseSensitive.stree.txt @@ -1,3 +1,3 @@ Expression block - Gen - 9 - (0:0,0) Code span - Gen - [NameSpace] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (0:0,0) - Tokens:1 - CSharpTokenType.Identifier;[NameSpace]; + SyntaxKind.Identifier;[NameSpace]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/AcceptsOpenBraceMultipleLinesBelowSectionName.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/AcceptsOpenBraceMultipleLinesBelowSectionName.stree.txt index fbbb614257..97a70123ac 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/AcceptsOpenBraceMultipleLinesBelowSectionName.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/AcceptsOpenBraceMultipleLinesBelowSectionName.stree.txt @@ -1,44 +1,44 @@ Markup block - Gen - 46 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 46 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ LFLFLFLFLFLF] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:7 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (30:6,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 14 - (31:6,1) Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (31:6,1) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Tag block - Gen - 3 - (33:7,0) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (33:7,0) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [Foo] - [36..39) - FullWidth: 3 - Slots: 1 - SyntaxKind.HtmlTextLiteralToken;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (39:7,6) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (39:7,6) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (43:7,10) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (45:8,0) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (46:8,1) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/AllowsBracesInCSharpExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/AllowsBracesInCSharpExpression.stree.txt index f0c43e199a..c9635e460b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/AllowsBracesInCSharpExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/AllowsBracesInCSharpExpression.stree.txt @@ -1,58 +1,58 @@ Markup block - Gen - 76 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 76 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 61 - (14:0,14) Markup span - Gen - [ I really want to render a close brace, so here I go: ] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:25 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[I]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[really]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[want]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[to]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[render]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[a]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[close]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[brace,]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[so]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[here]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[I]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[go:]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[I]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[really]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[want]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[to]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[render]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[a]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[close]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[brace,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[so]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[here]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[I]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[go:]; + SyntaxKind.Whitespace;[ ]; Expression block - Gen - 6 - (68:0,68) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (68:0,68) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (69:0,69) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - ["}"] - SpanEditHandler;Accepts:Any - (70:0,70) - Tokens:1 - CSharpTokenType.StringLiteral;["}"]; + SyntaxKind.StringLiteral;["}"]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (73:0,73) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (74:0,74) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (75:0,75) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (76:0,76) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/BalancesBraces.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/BalancesBraces.stree.txt index 60d6671298..a7f5e46da6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/BalancesBraces.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/BalancesBraces.stree.txt @@ -1,48 +1,48 @@ Markup block - Gen - 67 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 67 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 52 - (14:0,14) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 8 - (15:0,15) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (56:0,56) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[script]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[script]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (65:0,65) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (66:0,66) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (67:0,67) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesNewlineImmediatelyFollowing.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesNewlineImmediatelyFollowing.stree.txt index 689b12e4aa..773bd27d47 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesNewlineImmediatelyFollowing.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesNewlineImmediatelyFollowing.stree.txt @@ -1,12 +1,12 @@ Markup block - Gen - 10 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (8:0,8) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingName.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingName.stree.txt index 0fde9614d9..0e1ed2ea4a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingName.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingName.stree.txt @@ -1,15 +1,15 @@ Markup block - Gen - 23 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (17:0,17) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Markup span - Gen - [LF ] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:2 - HtmlTokenType.NewLine;[LF]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace.stree.txt index 3a2c1106da..e871be5838 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace.stree.txt @@ -1,18 +1,18 @@ Markup block - Gen - 27 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 27 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[Foo]; + SyntaxKind.Identifier;[Foo]; Markup span - Gen - [ LF ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:3 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (27:1,4) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CommentRecoversFromUnclosedTag.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CommentRecoversFromUnclosedTag.stree.txt index e764c527f3..d25db521ac 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CommentRecoversFromUnclosedTag.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CommentRecoversFromUnclosedTag.stree.txt @@ -1,45 +1,45 @@ Markup block - Gen - 33 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 33 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [s] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[s]; + SyntaxKind.Identifier;[s]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (11:0,11) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 20 - (12:0,12) Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (12:0,12) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Tag block - Gen - 4 - (14:1,0) Markup span - Gen - [ - 14 - (18:2,0) Markup span - Gen - [] - SpanEditHandler;Accepts:None - (29:2,11) - Tokens:2 - HtmlTokenType.DoubleHyphen;[--]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.DoubleHyphen;[--]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (32:2,14) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (32:2,14) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (33:2,15) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CorrectlyTerminatesWhenCloseBraceImmediatelyFollowsMarkup.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CorrectlyTerminatesWhenCloseBraceImmediatelyFollowsMarkup.stree.txt index 6bc6ea89b2..d8a9fdf84e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CorrectlyTerminatesWhenCloseBraceImmediatelyFollowsMarkup.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/CorrectlyTerminatesWhenCloseBraceImmediatelyFollowsMarkup.stree.txt @@ -1,23 +1,23 @@ Markup block - Gen - 24 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 24 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 9 - (14:0,14) Markup span - Gen - [something] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.Text;[something]; + SyntaxKind.HtmlTextLiteral;[something]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (23:0,23) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (24:0,24) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/DoesNotRequireSpaceBetweenSectionNameAndOpenBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/DoesNotRequireSpaceBetweenSectionNameAndOpenBrace.stree.txt index 9935f5f1ed..9d69e9b31d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/DoesNotRequireSpaceBetweenSectionNameAndOpenBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/DoesNotRequireSpaceBetweenSectionNameAndOpenBrace.stree.txt @@ -1,36 +1,36 @@ Markup block - Gen - 26 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 26 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (12:0,12) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (13:0,13) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (13:0,13) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (14:0,14) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [Foo] - [17..20) - FullWidth: 3 - Slots: 1 - SyntaxKind.HtmlTextLiteralToken;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (20:0,20) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (20:0,20) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (24:0,24) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (25:0,25) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (26:0,26) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenBrace.stree.txt index 19018c5dbe..a3c1d179c7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenBrace.stree.txt @@ -1,19 +1,19 @@ Markup block - Gen - 14 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 14 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 0 - (14:0,14) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent1.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent1.stree.txt index 134177d6a6..2024350f59 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent1.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent1.stree.txt @@ -1,19 +1,19 @@ Markup block - Gen - 15 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 15 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 1 - (14:0,14) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent2.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent2.stree.txt index 0a934073ea..3a36530dcd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent2.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent2.stree.txt @@ -1,19 +1,19 @@ Markup block - Gen - 16 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 16 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 2 - (14:0,14) Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent3.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent3.stree.txt index d828a581f0..13889d0ff4 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent3.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent3.stree.txt @@ -1,19 +1,19 @@ Markup block - Gen - 17 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 17 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 3 - (14:0,14) Markup span - Gen - [abc] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.Text;[abc]; + SyntaxKind.HtmlTextLiteral;[abc]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent4.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent4.stree.txt index dfd8d9e423..e24347ad5e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent4.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent4.stree.txt @@ -1,21 +1,21 @@ Markup block - Gen - 20 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 20 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 6 - (14:0,14) Markup span - Gen - [LF abc] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:3 - HtmlTokenType.NewLine;[LF]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[abc]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[abc]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSection.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSection.stree.txt index 98086ac2d7..57e3288513 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSection.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSection.stree.txt @@ -1,35 +1,35 @@ Markup block - Gen - 27 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 27 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 13 - (14:0,14) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (15:0,15) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (15:0,15) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [Foo{}] - [18..23) - FullWidth: 5 - Slots: 1 SyntaxKind.List - [Foo{}] - [18..23) - FullWidth: 5 - Slots: 3 - SyntaxKind.HtmlTextLiteralToken;[Foo]; - SyntaxKind.HtmlTextLiteralToken;[{]; - SyntaxKind.HtmlTextLiteralToken;[}]; + SyntaxKind.HtmlTextLiteral;[Foo]; + SyntaxKind.HtmlTextLiteral;[{]; + SyntaxKind.HtmlTextLiteral;[}]; Tag block - Gen - 4 - (23:0,23) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (23:0,23) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSectionWithNestedIf.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSectionWithNestedIf.stree.txt index 4090ca154c..bd47c3b67f 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSectionWithNestedIf.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSectionWithNestedIf.stree.txt @@ -1,56 +1,56 @@ Markup block - Gen - 73 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 73 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Test] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[Test]; + SyntaxKind.Identifier;[Test]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:AllWhiteSpace - (13:0,13) - Tokens:1 - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[}];AtEnd - (15:1,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 57 - (16:1,1) Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (16:1,1) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Statement block - Gen - 55 - (18:2,0) Code span - Gen - [ ] - SpanEditHandler;Accepts:Any - (18:2,0) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (22:2,4) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if(true)LF {LF] - SpanEditHandler;Accepts:Any - (23:2,5) - Tokens:8 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; Markup block - Gen - 28 - (40:4,0) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (40:4,0) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (48:4,8) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (48:4,8) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [Hello World] - SpanEditHandler;Accepts:Any - (51:4,11) - Tokens:3 - HtmlTokenType.Text;[Hello]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[World]; + SyntaxKind.HtmlTextLiteral;[Hello]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[World]; Tag block - Gen - 4 - (62:4,22) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (62:4,22) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:None - (66:4,26) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Code span - Gen - [ }] - SpanEditHandler;Accepts:Any - (68:5,0) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/IgnoresSectionUnlessAllLowerCase.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/IgnoresSectionUnlessAllLowerCase.stree.txt index 59d3f3e25a..bebf1f49a4 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/IgnoresSectionUnlessAllLowerCase.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/IgnoresSectionUnlessAllLowerCase.stree.txt @@ -1,11 +1,11 @@ Markup block - Gen - 12 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Expression block - Gen - 8 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [Section] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K15 - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[Section]; + SyntaxKind.Identifier;[Section]; Markup span - Gen - [ foo] - SpanEditHandler;Accepts:Any - (8:0,8) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnNestedSections.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnNestedSections.stree.txt index d7963d4182..d8b00a24ca 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnNestedSections.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnNestedSections.stree.txt @@ -1,58 +1,58 @@ Markup block - Gen - 44 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 44 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 29 - (14:0,14) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Directive block - Gen - 27 - (15:0,15) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (15:0,15) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (16:0,16) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (23:0,23) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [bar] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (24:0,24) - Tokens:1 - CSharpTokenType.Identifier;[bar]; + SyntaxKind.Identifier;[bar]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (27:0,27) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (28:0,28) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (29:0,29) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (29:0,29) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (30:0,30) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (30:0,30) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [Foo] - [33..36) - FullWidth: 3 - Slots: 1 - SyntaxKind.HtmlTextLiteralToken;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (36:0,36) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (36:0,36) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (40:0,40) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (41:0,41) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (42:0,42) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (43:0,43) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (44:0,44) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesComment.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesComment.stree.txt index 4bdbe3877f..1396ff051b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesComment.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesComment.stree.txt @@ -1,33 +1,33 @@ Markup block - Gen - 21 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [s] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[s]; + SyntaxKind.Identifier;[s]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (11:0,11) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 8 - (12:0,12) HtmlComment block - Gen - 8 - (12:0,12) Markup span - Gen - [] - SpanEditHandler;Accepts:None - (17:0,17) - Tokens:2 - HtmlTokenType.DoubleHyphen;[--]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.DoubleHyphen;[--]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (20:0,20) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (20:0,20) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (21:0,21) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesCommentWithDelimiters.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesCommentWithDelimiters.stree.txt index 86e6444d85..6098f81494 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesCommentWithDelimiters.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesCommentWithDelimiters.stree.txt @@ -1,38 +1,38 @@ Markup block - Gen - 26 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 26 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [s] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[s]; + SyntaxKind.Identifier;[s]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (11:0,11) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 13 - (12:0,12) HtmlComment block - Gen - 13 - (12:0,12) Markup span - Gen - [] - SpanEditHandler;Accepts:None - (22:0,22) - Tokens:2 - HtmlTokenType.DoubleHyphen;[--]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.DoubleHyphen;[--]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (25:0,25) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (25:0,25) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (26:0,26) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesNamedSectionCorrectly.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesNamedSectionCorrectly.stree.txt index 7832e92bdc..b9cbf826bb 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesNamedSectionCorrectly.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesNamedSectionCorrectly.stree.txt @@ -1,38 +1,38 @@ Markup block - Gen - 27 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 27 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 12 - (14:0,14) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (15:0,15) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (15:0,15) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [Foo] - [18..21) - FullWidth: 3 - Slots: 1 - SyntaxKind.HtmlTextLiteralToken;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (21:0,21) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (21:0,21) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (25:0,25) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (26:0,26) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (27:0,27) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesXmlProcessingInstruction.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesXmlProcessingInstruction.stree.txt index 92cd8e4296..9f190fe767 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesXmlProcessingInstruction.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ParsesXmlProcessingInstruction.stree.txt @@ -1,32 +1,32 @@ Markup block - Gen - 28 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 28 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [s] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[s]; + SyntaxKind.Identifier;[s]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (11:0,11) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 15 - (12:0,12) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (12:0,12) - Tokens:10 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.QuestionMark;[?]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[xml]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[bleh]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.QuestionMark;[?]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[xml]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[bleh]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.QuestionMark;[?]; + SyntaxKind.CloseAngle;[>]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (27:0,27) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (28:0,28) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace.stree.txt index f0c5008e10..17a9d246ef 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace.stree.txt @@ -1,17 +1,17 @@ Markup block - Gen - 20 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 20 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [ LF] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:2 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.NewLine;[LF]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (20:1,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar.stree.txt index 67fadc74d1..44d97d6953 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar.stree.txt @@ -1,31 +1,31 @@ Markup block - Gen - 25 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 9 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Markup span - Gen - [9 { ] - SpanEditHandler;Accepts:Any - (9:0,9) - Tokens:4 - HtmlTokenType.Text;[9]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[{]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.HtmlTextLiteral;[9]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[{]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (13:0,13) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (13:0,13) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [Foo] - [16..19) - FullWidth: 3 - Slots: 1 - SyntaxKind.HtmlTextLiteralToken;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (19:0,19) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (19:0,19) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ }] - SpanEditHandler;Accepts:Any - (23:0,23) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace.stree.txt index ba78c51800..30f5958806 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace.stree.txt @@ -1,33 +1,33 @@ Markup block - Gen - 31 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 12 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[foo]; + SyntaxKind.Identifier;[foo]; Markup span - Gen - [-bar { ] - SpanEditHandler;Accepts:Any - (12:0,12) - Tokens:4 - HtmlTokenType.Text;[-bar]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[{]; - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.HtmlTextLiteral;[-bar]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[{]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (19:0,19) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (19:0,19) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; SyntaxKind.HtmlText - [Foo] - [22..25) - FullWidth: 3 - Slots: 1 - SyntaxKind.HtmlTextLiteralToken;[Foo]; + SyntaxKind.HtmlTextLiteral;[Foo]; Tag block - Gen - 4 - (25:0,25) Markup span - Gen - [

] - SpanEditHandler;Accepts:Any - (25:0,25) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [ }] - SpanEditHandler;Accepts:Any - (29:0,29) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/SectionCorrectlyTerminatedWhenCloseBraceFollowsCodeBlockNoWhitespace.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/SectionCorrectlyTerminatedWhenCloseBraceFollowsCodeBlockNoWhitespace.stree.txt index 1712aafc46..5bb963ab5b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/SectionCorrectlyTerminatedWhenCloseBraceFollowsCodeBlockNoWhitespace.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/SectionCorrectlyTerminatedWhenCloseBraceFollowsCodeBlockNoWhitespace.stree.txt @@ -1,35 +1,35 @@ Markup block - Gen - 31 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 31 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[Foo]; + SyntaxKind.Identifier;[Foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 16 - (14:0,14) Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Statement block - Gen - 14 - (16:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (16:1,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if(true) {LF}] - SpanEditHandler;Accepts:Any - (17:1,1) - Tokens:8 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (30:2,1) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (31:2,2) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/SectionIsCorrectlyTerminatedWhenCloseBraceImmediatelyFollowsCodeBlock.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/SectionIsCorrectlyTerminatedWhenCloseBraceImmediatelyFollowsCodeBlock.stree.txt index 5b549fd8de..4aca5715f8 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/SectionIsCorrectlyTerminatedWhenCloseBraceImmediatelyFollowsCodeBlock.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/SectionIsCorrectlyTerminatedWhenCloseBraceImmediatelyFollowsCodeBlock.stree.txt @@ -1,36 +1,36 @@ Markup block - Gen - 33 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 33 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [Foo] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[Foo]; + SyntaxKind.Identifier;[Foo]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (12:0,12) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (13:0,13) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 18 - (14:0,14) Markup span - Gen - [LF] - SpanEditHandler;Accepts:Any - (14:0,14) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Statement block - Gen - 16 - (16:1,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (16:1,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if(true) {LF}LF] - SpanEditHandler;Accepts:Any - (17:1,1) - Tokens:9 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (32:3,0) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (33:3,1) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/_WithDoubleTransition1.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/_WithDoubleTransition1.stree.txt index 5be347d4cf..adc2ab82e9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/_WithDoubleTransition1.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/_WithDoubleTransition1.stree.txt @@ -1,42 +1,42 @@ Markup block - Gen - 30 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 30 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [s] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[s]; + SyntaxKind.Identifier;[s]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (11:0,11) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 17 - (12:0,12) Tag block - Gen - 17 - (12:0,12) Markup span - Gen - [ - 9 - (17:0,17) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 2 - (23:0,23) Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (23:0,23) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (24:0,24) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (25:0,25) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:Any - (26:0,26) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (29:0,29) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (30:0,30) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/_WithDoubleTransition2.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/_WithDoubleTransition2.stree.txt index 062a860adb..dc4dc041bb 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/_WithDoubleTransition2.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSectionTest/_WithDoubleTransition2.stree.txt @@ -1,51 +1,51 @@ Markup block - Gen - 44 - (0:0,0) Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; Directive block - Gen - 44 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [section] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.Identifier;[section]; + SyntaxKind.Identifier;[section]; Code span - Gen - [ ] - SpanEditHandler;Accepts:WhiteSpace - (8:0,8) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Code span - Gen - [s] - DirectiveTokenEditHandler;Accepts:NonWhiteSpace - (9:0,9) - Tokens:1 - CSharpTokenType.Identifier;[s]; + SyntaxKind.Identifier;[s]; Markup span - Gen - [ ] - SpanEditHandler;Accepts:AllWhiteSpace - (10:0,10) - Tokens:1 - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [{] - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd - (11:0,11) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Markup block - Gen - 31 - (12:0,12) Tag block - Gen - 31 - (12:0,12) Markup span - Gen - [ - 23 - (17:0,17) Markup span - Gen - [ foo='] - SpanEditHandler;Accepts:Any - (17:0,17) - Tokens:4 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[foo]; - HtmlTokenType.Equals;[=]; - HtmlTokenType.SingleQuote;[']; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[foo]; + SyntaxKind.Equals;[=]; + SyntaxKind.SingleQuote;[']; Markup block - Gen - 13 - (23:0,23) Expression block - Gen - 13 - (23:0,23) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (23:0,23) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [DateTime.Now] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K15 - (24:0,24) - Tokens:3 - CSharpTokenType.Identifier;[DateTime]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Now]; + SyntaxKind.Identifier;[DateTime]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Now]; Markup block - Gen - 3 - (36:0,36) Markup span - Gen - [ @] - SpanEditHandler;Accepts:None - (36:0,36) - Tokens:2 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Transition;[@]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Transition;[@]; Markup span - Gen - [@] - SpanEditHandler;Accepts:None - (38:0,38) - Tokens:1 - HtmlTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Markup span - Gen - ['] - SpanEditHandler;Accepts:Any - (39:0,39) - Tokens:1 - HtmlTokenType.SingleQuote;[']; + SyntaxKind.SingleQuote;[']; Markup span - Gen - [ />] - SpanEditHandler;Accepts:Any - (40:0,40) - Tokens:3 - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.CloseAngle;[>]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (43:0,43) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; Markup span - Gen - [] - SpanEditHandler;Accepts:Any - (44:0,44) - Tokens:1 - HtmlTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/BalancesBracesOutsideStringsIfFirstCharIsBraceAndReturnsSpanOfTypeCode.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/BalancesBracesOutsideStringsIfFirstCharIsBraceAndReturnsSpanOfTypeCode.stree.txt index 19a360fd8b..ec75baf7a5 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/BalancesBracesOutsideStringsIfFirstCharIsBraceAndReturnsSpanOfTypeCode.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/BalancesBracesOutsideStringsIfFirstCharIsBraceAndReturnsSpanOfTypeCode.stree.txt @@ -1,26 +1,26 @@ Statement block - Gen - 52 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [foo"b}ar" if(condition) { string.Format("{0}"); } ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:20 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.StringLiteral;["b}ar"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[condition]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Format]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;["{0}"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.StringLiteral;["b}ar"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[condition]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Format]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;["{0}"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (51:0,51) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/BalancesParensOutsideStringsIfFirstCharIsParenAndReturnsSpanOfTypeExpr.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/BalancesParensOutsideStringsIfFirstCharIsParenAndReturnsSpanOfTypeExpr.stree.txt index 757004c73b..91c655daaa 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/BalancesParensOutsideStringsIfFirstCharIsParenAndReturnsSpanOfTypeExpr.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/BalancesParensOutsideStringsIfFirstCharIsParenAndReturnsSpanOfTypeExpr.stree.txt @@ -1,26 +1,26 @@ Expression block - Gen - 52 - (0:0,0) MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [foo"b)ar" if(condition) { string.Format("{0}"); } ] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:20 - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.StringLiteral;["b)ar"]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[condition]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Format]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.StringLiteral;["{0}"]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.StringLiteral;["b)ar"]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[condition]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Format]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.StringLiteral;["{0}"]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [)] - SpanEditHandler;Accepts:None - (51:0,51) - Tokens:1 - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/NamespaceImportInsideCodeBlockCausesError.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/NamespaceImportInsideCodeBlockCausesError.stree.txt index 41fd907da2..7c4b8764f2 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/NamespaceImportInsideCodeBlockCausesError.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/NamespaceImportInsideCodeBlockCausesError.stree.txt @@ -1,25 +1,25 @@ Statement block - Gen - 37 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ using Foo.Bar.Baz; var foo = bar; ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:19 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (36:0,36) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/NonKeywordStatementInCodeBlockIsHandledCorrectly.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/NonKeywordStatementInCodeBlockIsHandledCorrectly.stree.txt index 25dbecb0d5..d11ffc889a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/NonKeywordStatementInCodeBlockIsHandledCorrectly.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/NonKeywordStatementInCodeBlockIsHandledCorrectly.stree.txt @@ -1,26 +1,26 @@ Statement block - Gen - 56 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [LF List photos = gallery.Photo.ToList();LF] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:20 - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[List]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Identifier;[dynamic]; - CSharpTokenType.GreaterThan;[>]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[photos]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[gallery]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Photo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ToList]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[List]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Identifier;[dynamic]; + SyntaxKind.GreaterThan;[>]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[photos]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[gallery]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Photo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ToList]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (55:2,0) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/ParseBlockIgnoresSingleSlashAtStart.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/ParseBlockIgnoresSingleSlashAtStart.stree.txt index 8f8de632d0..7eb747e6cd 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/ParseBlockIgnoresSingleSlashAtStart.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/ParseBlockIgnoresSingleSlashAtStart.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 1 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Unknown;[]; + SyntaxKind.Unknown;[]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/ParseBlockTerminatesSingleLineCommentAtEndOfLine.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/ParseBlockTerminatesSingleLineCommentAtEndOfLine.stree.txt index 60b8f07d27..239f899366 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/ParseBlockTerminatesSingleLineCommentAtEndOfLine.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/ParseBlockTerminatesSingleLineCommentAtEndOfLine.stree.txt @@ -1,38 +1,38 @@ Statement block - Gen - 48 - (0:0,0) Code span - Gen - [if(!false) {LF // FooLF] - SpanEditHandler;Accepts:Any - (0:0,0) - Tokens:11 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Not;[!]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Comment;[// Foo]; - CSharpTokenType.NewLine;[LF]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Not;[!]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.CSharpComment;[// Foo]; + SyntaxKind.NewLine;[LF]; Markup block - Gen - 21 - (26:2,0) Markup span - Gen - [ ] - SpanEditHandler;Accepts:Any - (26:2,0) - Tokens:1 - HtmlTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; Tag block - Gen - 3 - (27:2,1) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (27:2,1) - Tokens:3 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [A real tag!] - SpanEditHandler;Accepts:Any - (30:2,4) - Tokens:6 - HtmlTokenType.Text;[A]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[real]; - HtmlTokenType.WhiteSpace;[ ]; - HtmlTokenType.Text;[tag]; - HtmlTokenType.Bang;[!]; + SyntaxKind.HtmlTextLiteral;[A]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[real]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.HtmlTextLiteral;[tag]; + SyntaxKind.Bang;[!]; Tag block - Gen - 4 - (41:2,15) Markup span - Gen - [

] - SpanEditHandler;Accepts:None - (41:2,15) - Tokens:4 - HtmlTokenType.OpenAngle;[<]; - HtmlTokenType.ForwardSlash;[/]; - HtmlTokenType.Text;[p]; - HtmlTokenType.CloseAngle;[>]; + SyntaxKind.OpenAngle;[<]; + SyntaxKind.ForwardSlash;[/]; + SyntaxKind.HtmlTextLiteral;[p]; + SyntaxKind.CloseAngle;[>]; Markup span - Gen - [LF] - SpanEditHandler;Accepts:None - (45:2,19) - Tokens:1 - HtmlTokenType.NewLine;[LF]; + SyntaxKind.NewLine;[LF]; Code span - Gen - [}] - SpanEditHandler;Accepts:Any - (47:3,0) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/TypeAliasInsideCodeBlockIsNotHandledSpecially.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/TypeAliasInsideCodeBlockIsNotHandledSpecially.stree.txt index 5576cf671f..566c40d08d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/TypeAliasInsideCodeBlockIsNotHandledSpecially.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpSpecialBlockTest/TypeAliasInsideCodeBlockIsNotHandledSpecially.stree.txt @@ -1,27 +1,27 @@ Statement block - Gen - 39 - (0:0,0) MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [ using Foo = Bar.Baz; var foo = bar; ] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (1:0,1) - Tokens:21 - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Baz]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Baz]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (38:0,38) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/CatchClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/CatchClause.stree.txt index 979f01d5ec..bd9e33585e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/CatchClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/CatchClause.stree.txt @@ -1,46 +1,46 @@ Statement block - Gen - 94 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { foo(); } catch(IOException ioex) { handleIO(); } catch(Exception ex) { handleOther(); }] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:42 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[IOException]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[ioex]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[handleIO]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[ex]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[handleOther]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[IOException]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[ioex]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[handleIO]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[ex]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[handleOther]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/DoStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/DoStatement.stree.txt index 3d7b1a88af..864f9a5c11 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/DoStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/DoStatement.stree.txt @@ -1,20 +1,20 @@ Statement block - Gen - 27 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [do { foo(); } while(true);] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:16 - CSharpTokenType.Keyword;[do]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; + SyntaxKind.Keyword;[do]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ElseClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ElseClause.stree.txt index 6952c9d39e..9e2f4273e0 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ElseClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ElseClause.stree.txt @@ -1,28 +1,28 @@ Statement block - Gen - 36 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if(true) { foo(); } else { foo(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:24 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ElseIfClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ElseIfClause.stree.txt index 3ac82af49f..736d35fc5d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ElseIfClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ElseIfClause.stree.txt @@ -1,50 +1,50 @@ Statement block - Gen - 73 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if(true) { foo(); } else if(false) { foo(); } else if(!false) { foo(); }] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:46 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[else]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Not;[!]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[else]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Not;[!]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilterError_TryCatchWhen_InCompleteBody.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilterError_TryCatchWhen_InCompleteBody.stree.txt index a65e11f6c9..09016c9a8e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilterError_TryCatchWhen_InCompleteBody.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilterError_TryCatchWhen_InCompleteBody.stree.txt @@ -1,27 +1,27 @@ Statement block - Gen - 53 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { someMethod(); } catch(Exception) when (true) {] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:23 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[someMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[someMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilterError_TryCatchWhen_InCompleteCondition.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilterError_TryCatchWhen_InCompleteCondition.stree.txt index ea80c49749..25415c2f95 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilterError_TryCatchWhen_InCompleteCondition.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilterError_TryCatchWhen_InCompleteCondition.stree.txt @@ -1,23 +1,23 @@ Statement block - Gen - 46 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { someMethod(); } catch(Exception) when (] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:19 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[someMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[someMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchNoBodyWhen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchNoBodyWhen.stree.txt index b974facb6a..2b4fbb308a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchNoBodyWhen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchNoBodyWhen.stree.txt @@ -1,30 +1,30 @@ Statement block - Gen - 65 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { someMethod(); } catch(Exception) when { anotherMethod(); }] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:26 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[someMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[anotherMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[someMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[anotherMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchWhen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchWhen.stree.txt index 7672a029cd..4bcac7751c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchWhen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchWhen.stree.txt @@ -1,21 +1,21 @@ Statement block - Gen - 44 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { someMethod(); } catch(Exception) when] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:17 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[someMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[someMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchWhenNoBodies.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchWhenNoBodies.stree.txt index 1d47290523..807d4bf6b6 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchWhenNoBodies.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryCatchWhenNoBodies.stree.txt @@ -1,25 +1,25 @@ Statement block - Gen - 51 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { someMethod(); } catch(Exception) when (true)] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:21 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[someMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[someMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryWhen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryWhen.stree.txt index 1d2521b0e0..de0038c43e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryWhen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_IncompleteTryWhen.stree.txt @@ -1,14 +1,14 @@ Statement block - Gen - 22 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { someMethod(); }] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:10 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[someMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[someMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_MultiLine.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_MultiLine.stree.txt index f814178b03..89b302ea0e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_MultiLine.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_MultiLine.stree.txt @@ -1,54 +1,54 @@ Statement block - Gen - 103 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [tryLF{LFA();LF}LFcatch(Exception) when (true)LF{LFB();LF}LFcatch(IOException) when (false)LF{LFC();LF}] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:50 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[A]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[B]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[IOException]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.Identifier;[C]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.NewLine;[LF]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[A]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[B]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[IOException]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.Identifier;[C]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.NewLine;[LF]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_NestedTryCatchWhen.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_NestedTryCatchWhen.stree.txt index c7aebf715c..f6d20f2485 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_NestedTryCatchWhen.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_NestedTryCatchWhen.stree.txt @@ -1,38 +1,38 @@ Statement block - Gen - 69 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; MetaCode span - Gen - [{] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:1 - CSharpTokenType.LeftBrace;[{]; + SyntaxKind.LeftBrace;[{]; Code span - Gen - [try { someMethod(); } catch(Exception) when (true) { handleIO(); }] - AutoCompleteEditHandler;Accepts:Any,AutoComplete:[];AtEOL - (2:0,2) - Tokens:30 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[someMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[handleIO]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[someMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[handleIO]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; MetaCode span - Gen - [}] - SpanEditHandler;Accepts:None - (68:0,68) - Tokens:1 - CSharpTokenType.RightBrace;[}]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenCatchWhenComplete_SingleLine.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenCatchWhenComplete_SingleLine.stree.txt index 9b61a41852..5f93680e4d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenCatchWhenComplete_SingleLine.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenCatchWhenComplete_SingleLine.stree.txt @@ -1,54 +1,54 @@ Statement block - Gen - 92 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { A(); } catch(Exception) when (true) { B(); } catch(IOException) when (false) { C(); }] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:50 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[A]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[B]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[IOException]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[false]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[C]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[A]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[B]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[IOException]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[false]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[C]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenComplete_SingleLine.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenComplete_SingleLine.stree.txt index d4abea3d20..c071433877 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenComplete_SingleLine.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenComplete_SingleLine.stree.txt @@ -1,34 +1,34 @@ Statement block - Gen - 67 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { someMethod(); } catch(Exception) when (true) { handleIO(); }] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:30 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[someMethod]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[handleIO]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[someMethod]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[handleIO]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenFinallyComplete_SingleLine.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenFinallyComplete_SingleLine.stree.txt index d2eb922ac6..0e28068099 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenFinallyComplete_SingleLine.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ExceptionFilter_TryCatchWhenFinallyComplete_SingleLine.stree.txt @@ -1,45 +1,45 @@ Statement block - Gen - 68 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { A(); } catch(Exception) when (true) { B(); } finally { C(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:41 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[A]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[catch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[Exception]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[when]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[B]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[C]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[A]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[catch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[Exception]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[when]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[B]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[C]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/FinallyClause.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/FinallyClause.stree.txt index 0810f3848a..82427e5566 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/FinallyClause.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/FinallyClause.stree.txt @@ -1,25 +1,25 @@ Statement block - Gen - 38 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { foo(); } finally { Dispose(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:21 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[finally]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Dispose]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[finally]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Dispose]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ForEachStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ForEachStatement.stree.txt index 7d4a7b839e..df4a2559f1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ForEachStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ForEachStatement.stree.txt @@ -1,23 +1,23 @@ Statement block - Gen - 35 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [foreach(var foo in bar) { foo(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:19 - CSharpTokenType.Keyword;[foreach]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[in]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[bar]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[foreach]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[in]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[bar]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ForStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ForStatement.stree.txt index 073af76a08..7453adeb1c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ForStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/ForStatement.stree.txt @@ -1,34 +1,34 @@ Statement block - Gen - 43 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [for(int i = 0; i++; i < length) { foo(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:30 - CSharpTokenType.Keyword;[for]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[int]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.IntegerLiteral;[0]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.Increment;[++]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[i]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[length]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[for]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[int]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.IntegerLiteral;[0]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Increment;[++]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[i]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[length]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/IfStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/IfStatement.stree.txt index d01613f66d..6d99745895 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/IfStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/IfStatement.stree.txt @@ -1,17 +1,17 @@ Statement block - Gen - 20 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [if(true) { foo(); }] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:13 - CSharpTokenType.Keyword;[if]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[if]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/LockStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/LockStatement.stree.txt index 7a8dcd7965..eddbbb0fc7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/LockStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/LockStatement.stree.txt @@ -1,17 +1,17 @@ Statement block - Gen - 21 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [lock(baz) { foo(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:13 - CSharpTokenType.Keyword;[lock]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[baz]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[lock]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[baz]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/NonBlockKeywordTreatedAsImplicitExpression.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/NonBlockKeywordTreatedAsImplicitExpression.stree.txt index 7b1d379e7d..d1b98e7428 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/NonBlockKeywordTreatedAsImplicitExpression.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/NonBlockKeywordTreatedAsImplicitExpression.stree.txt @@ -1,5 +1,5 @@ Expression block - Gen - 3 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [is] - ImplicitExpressionEditHandler;Accepts:NonWhiteSpace;ImplicitExpression[RTD];K14 - (1:0,1) - Tokens:1 - CSharpTokenType.Keyword;[is]; + SyntaxKind.Keyword;[is]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_Complete_Spaced.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_Complete_Spaced.stree.txt index 6e6611d1d6..659aa732fa 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_Complete_Spaced.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_Complete_Spaced.stree.txt @@ -1,13 +1,13 @@ Directive block - Gen - 40 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [using static global::System.Console] - SpanEditHandler;Accepts:AnyExceptNewline - (1:0,1) - Tokens:9 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[static]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[global]; - CSharpTokenType.DoubleColon;[::]; - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Console]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[static]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[global]; + SyntaxKind.DoubleColon;[::]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Console]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_GlobalPrefix.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_GlobalPrefix.stree.txt index 7211d38d71..ca4687394a 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_GlobalPrefix.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_GlobalPrefix.stree.txt @@ -1,13 +1,13 @@ Directive block - Gen - 36 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [using static global::System.Console] - SpanEditHandler;Accepts:AnyExceptNewline - (1:0,1) - Tokens:9 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[static]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[global]; - CSharpTokenType.DoubleColon;[::]; - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Console]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[static]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[global]; + SyntaxKind.DoubleColon;[::]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Console]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_MultipleIdentifiers.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_MultipleIdentifiers.stree.txt index 54278101f9..fb3e4bc329 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_MultipleIdentifiers.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_MultipleIdentifiers.stree.txt @@ -1,11 +1,11 @@ Directive block - Gen - 28 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [using static System.Console] - SpanEditHandler;Accepts:AnyExceptNewline - (1:0,1) - Tokens:7 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[static]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Console]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[static]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Console]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_NoUsing.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_NoUsing.stree.txt index 7d6aaac205..8c7fe292aa 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_NoUsing.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_NoUsing.stree.txt @@ -1,7 +1,7 @@ Directive block - Gen - 13 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [using static] - SpanEditHandler;Accepts:AnyExceptNewline - (1:0,1) - Tokens:3 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[static]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[static]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_SingleIdentifier.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_SingleIdentifier.stree.txt index 226b90f7bd..d618dfba5d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_SingleIdentifier.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_SingleIdentifier.stree.txt @@ -1,9 +1,9 @@ Directive block - Gen - 20 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [using static System] - SpanEditHandler;Accepts:AnyExceptNewline - (1:0,1) - Tokens:5 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[static]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[System]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[static]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[System]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement.stree.txt index dd5b38a925..74740937b0 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement.stree.txt @@ -1,17 +1,17 @@ Statement block - Gen - 23 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [switch(foo) { foo(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:13 - CSharpTokenType.Keyword;[switch]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[switch]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/TryStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/TryStatement.stree.txt index bd13bb3059..96b61f4e11 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/TryStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/TryStatement.stree.txt @@ -1,14 +1,14 @@ Statement block - Gen - 15 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [try { foo(); }] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:10 - CSharpTokenType.Keyword;[try]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[try]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingNamespaceImport.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingNamespaceImport.stree.txt index 4a9d2be68d..a99f6b2bc4 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingNamespaceImport.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingNamespaceImport.stree.txt @@ -1,13 +1,13 @@ Directive block - Gen - 41 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [using System.Text.Encoding.ASCIIEncoding] - SpanEditHandler;Accepts:AnyExceptNewline - (1:0,1) - Tokens:9 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Text]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Encoding]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[ASCIIEncoding]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Text]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Encoding]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[ASCIIEncoding]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingStatement.stree.txt index b8a04ea3e1..652d8c2a38 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingStatement.stree.txt @@ -1,29 +1,29 @@ Statement block - Gen - 42 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [using(var foo = new Foo()) { foo.Bar(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:25 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Identifier;[var]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[new]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[Foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Bar]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[using]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Identifier;[var]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[new]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[Foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Bar]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingTypeAlias.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingTypeAlias.stree.txt index df25b12077..3940d00b6e 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingTypeAlias.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/UsingTypeAlias.stree.txt @@ -1,23 +1,23 @@ Directive block - Gen - 79 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen;> - [using StringDictionary = System.Collections.Generic.Dictionary] - SpanEditHandler;Accepts:AnyExceptNewline - (1:0,1) - Tokens:19 - CSharpTokenType.Keyword;[using]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[StringDictionary]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Assign;[=]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[System]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Collections]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Generic]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Dictionary]; - CSharpTokenType.LessThan;[<]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Keyword;[string]; - CSharpTokenType.GreaterThan;[>]; + SyntaxKind.Keyword;[using]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[StringDictionary]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Assign;[=]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[System]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Collections]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Generic]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Dictionary]; + SyntaxKind.LessThan;[<]; + SyntaxKind.Keyword;[string]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Keyword;[string]; + SyntaxKind.GreaterThan;[>]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/WhileStatement.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/WhileStatement.stree.txt index 5a2eb3d2e3..9c3cab8153 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/WhileStatement.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpStatementTest/WhileStatement.stree.txt @@ -1,17 +1,17 @@ Statement block - Gen - 23 - (0:0,0) Transition span - Gen - [@] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.Transition;[@]; + SyntaxKind.Transition;[@]; Code span - Gen - [while(true) { foo(); }] - SpanEditHandler;Accepts:None - (1:0,1) - Tokens:13 - CSharpTokenType.Keyword;[while]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.Keyword;[true]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.LeftBrace;[{]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.Identifier;[foo]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.RightParenthesis;[)]; - CSharpTokenType.Semicolon;[;]; - CSharpTokenType.WhiteSpace;[ ]; - CSharpTokenType.RightBrace;[}]; + SyntaxKind.Keyword;[while]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.Keyword;[true]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.LeftBrace;[{]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.Identifier;[foo]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.RightParenthesis;[)]; + SyntaxKind.Semicolon;[;]; + SyntaxKind.Whitespace;[ ]; + SyntaxKind.RightBrace;[}]; diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInExplicitExpressionParens.stree.txt b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInExplicitExpressionParens.stree.txt index bdcccbd8c2..ab9d143f35 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInExplicitExpressionParens.stree.txt +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInExplicitExpressionParens.stree.txt @@ -1,39 +1,39 @@ Expression block - Gen - 37 - (0:0,0) MetaCode span - Gen - [(] - SpanEditHandler;Accepts:None - (0:0,0) - Tokens:1 - CSharpTokenType.LeftParenthesis;[(]; + SyntaxKind.LeftParenthesis;[(]; Code span - Gen - [Html.Repeat(10, ] - SpanEditHandler;Accepts:Any - (1:0,1) - Tokens:7 - CSharpTokenType.Identifier;[Html]; - CSharpTokenType.Dot;[.]; - CSharpTokenType.Identifier;[Repeat]; - CSharpTokenType.LeftParenthesis;[(]; - CSharpTokenType.IntegerLiteral;[10]; - CSharpTokenType.Comma;[,]; - CSharpTokenType.WhiteSpace;[ ]; + SyntaxKind.Identifier;[Html]; + SyntaxKind.Dot;[.]; + SyntaxKind.Identifier;[Repeat]; + SyntaxKind.LeftParenthesis;[(]; + SyntaxKind.IntegerLiteral;[10]; + SyntaxKind.Comma;[,]; + SyntaxKind.Whitespace;[ ]; Template block - Gen