diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs
index 15f3542a7ee..88f537b936e 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs
@@ -525,6 +525,7 @@ public DesignTimeOptionsFeature(bool designTime)
public void Configure(RazorParserOptionsBuilder options)
{
options.SetDesignTime(_designTime);
+ options.UseRoslynTokenizer = true;
}
public void Configure(RazorCodeGenerationOptionsBuilder options)
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseTest.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseTest.cs
index 9c0fbaf4c94..2f85e6f2401 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseTest.cs
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseTest.cs
@@ -30,7 +30,11 @@ public void Execute_AutomaticallyImportsSingleLineSinglyOccurringDirective()
b.Features.Add(new DefaultRazorCodeGenerationOptionsFeature(designTime: false));
b.AddDirective(directive);
});
- var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
+ var options = RazorParserOptions.Create(builder =>
+ {
+ builder.Directives.Add(directive);
+ builder.UseRoslynTokenizer = true;
+ });
var importSource = TestRazorSourceDocument.Create("@custom \"hello\"", filePath: "import.cshtml");
var codeDocument = TestRazorCodeDocument.Create("
NonDirective
");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
@@ -65,7 +69,11 @@ public void Execute_AutomaticallyOverridesImportedSingleLineSinglyOccurringDirec
b.Features.Add(new DefaultRazorCodeGenerationOptionsFeature(designTime: false));
b.AddDirective(directive);
});
- var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
+ var options = RazorParserOptions.Create(builder =>
+ {
+ builder.Directives.Add(directive);
+ builder.UseRoslynTokenizer = true;
+ });
var importSource = TestRazorSourceDocument.Create("@custom \"hello\"", filePath: "import.cshtml");
var codeDocument = TestRazorCodeDocument.Create("@custom \"world\"");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
@@ -100,7 +108,11 @@ public void Execute_AutomaticallyOverridesImportedSingleLineSinglyOccurringDirec
b.Features.Add(new DefaultRazorCodeGenerationOptionsFeature(designTime: false));
b.AddDirective(directive);
});
- var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
+ var options = RazorParserOptions.Create(builder =>
+ {
+ builder.Directives.Add(directive);
+ builder.UseRoslynTokenizer = true;
+ });
var importSource1 = TestRazorSourceDocument.Create("@custom \"hello\"", filePath: "import1.cshtml");
var importSource2 = TestRazorSourceDocument.Create("@custom \"world\"", filePath: "import2.cshtml");
var codeDocument = TestRazorCodeDocument.Create("NonDirective
");
@@ -136,6 +148,7 @@ public void Execute_DoesNotImportNonFileScopedSinglyOccurringDirectives_Block()
{
builder.Directives.Add(codeBlockDirective);
builder.Directives.Add(razorBlockDirective);
+ builder.UseRoslynTokenizer = true;
});
var importSource = TestRazorSourceDocument.Create(
@"@code ""code block"" { }
@@ -166,7 +179,11 @@ public void Execute_ErrorsForCodeBlockFileScopedSinglyOccurringDirectives()
b.Features.Add(new DefaultRazorCodeGenerationOptionsFeature(designTime: false));
b.AddDirective(directive);
});
- var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
+ var options = RazorParserOptions.Create(builder =>
+ {
+ builder.Directives.Add(directive);
+ builder.UseRoslynTokenizer = true;
+ });
var importSource = TestRazorSourceDocument.Create("@custom { }", filePath: "import.cshtml");
var codeDocument = TestRazorCodeDocument.Create("NonDirective
");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
@@ -196,7 +213,11 @@ public void Execute_ErrorsForRazorBlockFileScopedSinglyOccurringDirectives()
b.Features.Add(new DefaultRazorCodeGenerationOptionsFeature(designTime: false));
b.AddDirective(directive);
});
- var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
+ var options = RazorParserOptions.Create(builder =>
+ {
+ builder.Directives.Add(directive);
+ builder.UseRoslynTokenizer = true;
+ });
var importSource = TestRazorSourceDocument.Create("@custom { }", filePath: "import.cshtml");
var codeDocument = TestRazorCodeDocument.Create("NonDirective
");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
@@ -247,8 +268,13 @@ public void Execute_CollatesSyntaxDiagnosticsFromSourceDocument()
b.Phases.Add(phase);
b.Features.Add(new DefaultRazorCodeGenerationOptionsFeature(designTime: false));
});
+
+ var options = RazorParserOptions.Create(builder =>
+ {
+ builder.UseRoslynTokenizer = true;
+ });
var codeDocument = TestRazorCodeDocument.Create("
+ {
+ builder.UseRoslynTokenizer = true;
+ });
var codeDocument = TestRazorCodeDocument.CreateEmpty();
- codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source));
+ codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, parseOptions));
codeDocument.SetImportSyntaxTrees(new[]
{
- RazorSyntaxTree.Parse(TestRazorSourceDocument.Create("@ ")),
- RazorSyntaxTree.Parse(TestRazorSourceDocument.Create("
", SyntaxKind.Arrow);
+ TestSingleToken("->", SyntaxKind.CSharpOperator);
}
[Fact]
public void AndAssign_Is_Recognized()
{
- TestSingleToken("&=", SyntaxKind.AndAssign);
+ TestSingleToken("&=", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -49,7 +49,7 @@ public void RightBrace_Is_Recognized()
[Fact]
public void Minus_Is_Recognized()
{
- TestSingleToken("-", SyntaxKind.Minus);
+ TestSingleToken("-", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -61,13 +61,13 @@ public void LessThan_Is_Recognized()
[Fact]
public void Equals_Is_Recognized()
{
- TestSingleToken("==", SyntaxKind.Equals);
+ TestSingleToken("==", SyntaxKind.CSharpOperator);
}
[Fact]
public void OrAssign_Is_Recognized()
{
- TestSingleToken("|=", SyntaxKind.OrAssign);
+ TestSingleToken("|=", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -79,7 +79,7 @@ public void LeftBracket_Is_Recognized()
[Fact]
public void Star_Is_Recognized()
{
- TestSingleToken("*", SyntaxKind.Star);
+ TestSingleToken("*", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -91,13 +91,13 @@ public void GreaterThan_Is_Recognized()
[Fact]
public void NotEqual_Is_Recognized()
{
- TestSingleToken("!=", SyntaxKind.NotEqual);
+ TestSingleToken("!=", SyntaxKind.CSharpOperator);
}
[Fact]
public void XorAssign_Is_Recognized()
{
- TestSingleToken("^=", SyntaxKind.XorAssign);
+ TestSingleToken("^=", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -109,7 +109,7 @@ public void RightBracket_Is_Recognized()
[Fact]
public void Slash_Is_Recognized()
{
- TestSingleToken("/", SyntaxKind.Slash);
+ TestSingleToken("/", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -121,15 +121,13 @@ public void QuestionMark_Is_Recognized()
[Fact]
public void LessThanEqual_Is_Recognized()
{
- TestSingleToken("<=", SyntaxKind.LessThanEqual);
+ TestSingleToken("<=", SyntaxKind.CSharpOperator);
}
[Fact]
- public void LeftShift_Is_Not_Specially_Recognized()
+ public void LeftShift_Is_Recognized()
{
- TestTokenizer("<<",
- SyntaxFactory.Token(SyntaxKind.LessThan, "<"),
- SyntaxFactory.Token(SyntaxKind.LessThan, "<"));
+ TestSingleToken("<<", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -141,25 +139,25 @@ public void LeftParen_Is_Recognized()
[Fact]
public void Modulo_Is_Recognized()
{
- TestSingleToken("%", SyntaxKind.Modulo);
+ TestSingleToken("%", SyntaxKind.CSharpOperator);
}
[Fact]
public void NullCoalesce_Is_Recognized()
{
- TestSingleToken("??", SyntaxKind.NullCoalesce);
+ TestSingleToken("??", SyntaxKind.CSharpOperator);
}
[Fact]
public void GreaterThanEqual_Is_Recognized()
{
- TestSingleToken(">=", SyntaxKind.GreaterThanEqual);
+ TestSingleToken(">=", SyntaxKind.CSharpOperator);
}
[Fact]
public void EqualGreaterThan_Is_Recognized()
{
- TestSingleToken("=>", SyntaxKind.GreaterThanEqual);
+ TestSingleToken("=>", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -171,7 +169,7 @@ public void RightParen_Is_Recognized()
[Fact]
public void And_Is_Recognized()
{
- TestSingleToken("&", SyntaxKind.And);
+ TestSingleToken("&", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -183,7 +181,7 @@ public void DoubleColon_Is_Recognized()
[Fact]
public void PlusAssign_Is_Recognized()
{
- TestSingleToken("+=", SyntaxKind.PlusAssign);
+ TestSingleToken("+=", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -195,19 +193,19 @@ public void Semicolon_Is_Recognized()
[Fact]
public void Tilde_Is_Recognized()
{
- TestSingleToken("~", SyntaxKind.Tilde);
+ TestSingleToken("~", SyntaxKind.CSharpOperator);
}
[Fact]
public void DoubleOr_Is_Recognized()
{
- TestSingleToken("||", SyntaxKind.DoubleOr);
+ TestSingleToken("||", SyntaxKind.CSharpOperator);
}
[Fact]
public void ModuloAssign_Is_Recognized()
{
- TestSingleToken("%=", SyntaxKind.ModuloAssign);
+ TestSingleToken("%=", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -225,13 +223,13 @@ public void Not_Is_Recognized()
[Fact]
public void DoubleAnd_Is_Recognized()
{
- TestSingleToken("&&", SyntaxKind.DoubleAnd);
+ TestSingleToken("&&", SyntaxKind.CSharpOperator);
}
[Fact]
public void DivideAssign_Is_Recognized()
{
- TestSingleToken("/=", SyntaxKind.DivideAssign);
+ TestSingleToken("/=", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -243,19 +241,19 @@ public void Comma_Is_Recognized()
[Fact]
public void Xor_Is_Recognized()
{
- TestSingleToken("^", SyntaxKind.Xor);
+ TestSingleToken("^", SyntaxKind.CSharpOperator);
}
[Fact]
public void Decrement_Is_Recognized()
{
- TestSingleToken("--", SyntaxKind.Decrement);
+ TestSingleToken("--", SyntaxKind.CSharpOperator);
}
[Fact]
public void MultiplyAssign_Is_Recognized()
{
- TestSingleToken("*=", SyntaxKind.MultiplyAssign);
+ TestSingleToken("*=", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -267,19 +265,19 @@ public void Dot_Is_Recognized()
[Fact]
public void Or_Is_Recognized()
{
- TestSingleToken("|", SyntaxKind.Or);
+ TestSingleToken("|", SyntaxKind.CSharpOperator);
}
[Fact]
public void Increment_Is_Recognized()
{
- TestSingleToken("++", SyntaxKind.Increment);
+ TestSingleToken("++", SyntaxKind.CSharpOperator);
}
[Fact]
public void MinusAssign_Is_Recognized()
{
- TestSingleToken("-=", SyntaxKind.MinusAssign);
+ TestSingleToken("-=", SyntaxKind.CSharpOperator);
}
[Fact]
@@ -290,9 +288,10 @@ public void RightShift_Is_Not_Specially_Recognized()
SyntaxFactory.Token(SyntaxKind.GreaterThan, ">"));
}
- [Fact]
- public void Hash_Is_Recognized()
- {
- TestSingleToken("#", SyntaxKind.Hash);
- }
+ // PROTOTYPE: Re-enable
+ // [Fact]
+ // public void Hash_Is_Recognized()
+ // {
+ // TestSingleToken("#", SyntaxKind.Hash);
+ // }
}
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/AcceptsElseIfWithNoCondition.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/AcceptsElseIfWithNoCondition.stree.txt
index 201b925b11f..7b5850874f8 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/AcceptsElseIfWithNoCondition.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/AcceptsElseIfWithNoCondition.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CSharpBlock_SingleLineControlFlowStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CSharpBlock_SingleLineControlFlowStatement.stree.txt
index dacdf781461..c74b6969844 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CSharpBlock_SingleLineControlFlowStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CSharpBlock_SingleLineControlFlowStatement.stree.txt
@@ -13,7 +13,7 @@
CSharpStatementLiteral - [2..68)::66 - [LF var time = DateTime.Now;LF if (time.ToBinary() % 2 == 0) ] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[time];
Whitespace;[ ];
@@ -34,13 +34,13 @@
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
- Modulo;[%];
+ CSharpOperator;[%];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
Whitespace;[ ];
- Equals;[==];
+ CSharpOperator;[==];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
Whitespace;[ ];
CSharpCodeBlock - [68..73)::5
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CSharpBlock_SingleLineControlFlowStatement_Error.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CSharpBlock_SingleLineControlFlowStatement_Error.stree.txt
index df72feb3bcb..f36284fd2e8 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CSharpBlock_SingleLineControlFlowStatement_Error.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CSharpBlock_SingleLineControlFlowStatement_Error.stree.txt
@@ -13,7 +13,7 @@
CSharpStatementLiteral - [2..68)::66 - [LF var time = DateTime.Now;LF if (time.ToBinary() % 2 == 0) ] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[time];
Whitespace;[ ];
@@ -34,13 +34,13 @@
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
- Modulo;[%];
+ CSharpOperator;[%];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
Whitespace;[ ];
- Equals;[==];
+ CSharpOperator;[==];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
Whitespace;[ ];
MarkupBlock - [68..92)::24
@@ -81,12 +81,12 @@
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
- Modulo;[%];
- IntegerLiteral;[3];
+ CSharpOperator;[%];
+ NumericLiteral;[3];
Whitespace;[ ];
- Equals;[==];
+ CSharpOperator;[==];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
NewLine;[LF];
Whitespace;[ ];
@@ -133,13 +133,13 @@
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
- Modulo;[%];
+ CSharpOperator;[%];
Whitespace;[ ];
- IntegerLiteral;[4];
+ NumericLiteral;[4];
Whitespace;[ ];
- Equals;[==];
+ CSharpOperator;[==];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
NewLine;[LF];
Whitespace;[ ];
@@ -183,13 +183,13 @@
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
- Modulo;[%];
+ CSharpOperator;[%];
Whitespace;[ ];
- IntegerLiteral;[5];
+ NumericLiteral;[5];
Whitespace;[ ];
- Equals;[==];
+ CSharpOperator;[==];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
Whitespace;[ ];
CSharpEphemeralTextLiteral - [338..339)::1 - [@] - Gen
@@ -204,7 +204,7 @@
Identifier;[Hi];
Not;[!];
LessThan;[<];
- Slash;[/];
+ CSharpOperator;[/];
Identifier;[strong];
GreaterThan;[>];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlock.stree.txt
index 76249040139..700a231f05f 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlock.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -25,7 +25,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Identifier;[bar];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingSemicolon.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingSemicolon.stree.txt
index 1fc127579d3..9736f06bfe8 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingSemicolon.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingSemicolon.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -25,7 +25,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Identifier;[bar];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely.stree.txt
index 846aea06335..29c275c085f 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileCondition.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileCondition.stree.txt
index 91ca1631f75..59e7ae9129d 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileCondition.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileCondition.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon.stree.txt
index 042c6f9ab45..a85ee5ce30e 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesMarkupInDoWhileBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesMarkupInDoWhileBlock.stree.txt
index 47448176aa4..95ed0d880b0 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesMarkupInDoWhileBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CorrectlyParsesMarkupInDoWhileBlock.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -37,7 +37,7 @@
Whitespace;[ ];
CSharpStatementLiteral - [32..58)::26 - [foo++; } while (foo);] - Gen
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/DoesNotAllowMultipleFinallyBlocks.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/DoesNotAllowMultipleFinallyBlocks.stree.txt
index 81e120e89ba..4ceb7e6dbac 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/DoesNotAllowMultipleFinallyBlocks.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/DoesNotAllowMultipleFinallyBlocks.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -28,7 +28,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_01.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_01.stree.txt
index f00da6ee152..aaf4463dbcb 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_01.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_01.stree.txt
@@ -13,7 +13,7 @@
CSharpStatementLiteral - [2..31)::29 - [LF var @string = "blah";LF] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[@string];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_02.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_02.stree.txt
index 19416f54002..90660c80bce 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_02.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_02.stree.txt
@@ -34,17 +34,17 @@
CSharpStatementLiteral - [44..83)::39 - [LF var x = 1;LF var y = @x;LF ] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Semicolon;[;];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[y];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_03.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_03.stree.txt
index 121bf6fed21..bb5b800ffe3 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_03.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_03.stree.txt
@@ -13,18 +13,18 @@
CSharpStatementLiteral - [2..48)::46 - [LF var @@class = 1;LF var y = @@class;LF] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[@];
Identifier;[@class];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Semicolon;[;];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[y];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_04.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_04.stree.txt
index 264730983f5..6ef394b646b 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_04.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_04.stree.txt
@@ -13,7 +13,7 @@
CSharpStatementLiteral - [2..42)::40 - [LF var @string = "string test";LF ] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[@string];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_05.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_05.stree.txt
index 084ec8ffed9..1087ec697c4 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_05.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_05.stree.txt
@@ -13,7 +13,7 @@
CSharpStatementLiteral - [2..42)::40 - [LF var @string = "string test";LF ] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[@string];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_06.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_06.stree.txt
index df0971af655..f406002c44d 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_06.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_06.stree.txt
@@ -13,7 +13,7 @@
CSharpStatementLiteral - [2..53)::51 - [LF var @string = "string test";LF {LF ] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[@string];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_07.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_07.stree.txt
index 11a0d918c07..d76131a9a4b 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_07.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_07.stree.txt
@@ -13,7 +13,7 @@
CSharpStatementLiteral - [2..53)::51 - [LF var @string = "string test";LF {LF ] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[@string];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_09.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_09.stree.txt
index b2b0b03ba01..5fbb0951636 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_09.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/EscapedIdentifiers_09.stree.txt
@@ -13,7 +13,7 @@
CSharpStatementLiteral - [2..30)::28 - [LF var x = "hello";LF ] - Gen
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/LocalFunctionsWithRazor.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/LocalFunctionsWithRazor.stree.txt
index 6d746979a20..30f440a8c49 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/LocalFunctionsWithRazor.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/LocalFunctionsWithRazor.stree.txt
@@ -23,7 +23,7 @@
LeftBrace;[{];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[time];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/LocalFunctionsWithRazor_MissingSemicolon.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/LocalFunctionsWithRazor_MissingSemicolon.stree.txt
index 00df4dcfa6e..4e3e97c53fa 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/LocalFunctionsWithRazor_MissingSemicolon.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/LocalFunctionsWithRazor_MissingSemicolon.stree.txt
@@ -23,7 +23,7 @@
LeftBrace;[{];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[time];
Whitespace;[ ];
@@ -47,7 +47,7 @@
Whitespace;[ ];
Identifier;[@time];
LessThan;[<];
- Slash;[/];
+ CSharpOperator;[/];
Identifier;[strong];
GreaterThan;[>];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithCSharpAt.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithCSharpAt.stree.txt
index 95e82f42a85..f40c4a16a93 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithCSharpAt.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/NestedCodeBlockWithCSharpAt.stree.txt
@@ -20,7 +20,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[val];
Whitespace;[ ];
@@ -34,9 +34,9 @@
LeftParenthesis;[(];
Identifier;[val];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
- IntegerLiteral;[3];
+ NumericLiteral;[3];
RightParenthesis;[)];
Whitespace;[ ];
LeftBrace;[{];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsersCanNestRecursively.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsersCanNestRecursively.stree.txt
index 86e1e3c28fd..f220d62327e 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsersCanNestRecursively.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsersCanNestRecursively.stree.txt
@@ -8,7 +8,7 @@
CSharpStatementLiteral - [1..36)::35 - [foreach(var c in db.Categories) {LF] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[c];
Whitespace;[ ];
@@ -72,7 +72,7 @@
CSharpStatementLiteral - [132..164)::32 - [foreach(var p in c.Products) {LF] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[p];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesElseIfBranchesOfIfStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesElseIfBranchesOfIfStatement.stree.txt
index 83b087bc591..2b0c1773fdc 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesElseIfBranchesOfIfStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesElseIfBranchesOfIfStatement.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
@@ -62,14 +62,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart.stree.txt
index 134cbebe9b2..5ce0b347a9d 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart.stree.txt
@@ -22,7 +22,7 @@
CSharpExpressionLiteral - [12..24)::12 - [foo[4].bar()] - Gen
Identifier;[foo];
LeftBracket;[[];
- IntegerLiteral;[4];
+ NumericLiteral;[4];
RightBracket;[]];
Dot;[.];
Identifier;[bar];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByOpenParen.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByOpenParen.stree.txt
index 02bd2f31d7b..bc7cf12218a 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByOpenParen.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesExpressionOnSwitchCharacterFollowedByOpenParen.stree.txt
@@ -24,7 +24,7 @@
CSharpExpressionLiteral - [13..22)::9 - [foo + bar] - Gen
Identifier;[foo];
Whitespace;[ ];
- Plus;[+];
+ CSharpOperator;[+];
Whitespace;[ ];
Identifier;[bar];
RazorMetaCode - [22..23)::1 - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatement.stree.txt
index 799b034f33b..1ebb423bed7 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatement.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
@@ -62,14 +62,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
@@ -110,14 +110,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
@@ -158,14 +158,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
@@ -206,14 +206,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch.stree.txt
index 46c86ad335e..1461d56c074 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
@@ -62,14 +62,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
@@ -110,14 +110,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword.stree.txt
index 84362847d7e..11078088872 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword.stree.txt
index 1f6c998be75..44c84489dc8 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches.stree.txt
index d20ef2cb297..0256b3ac3fd 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword.stree.txt
index 444fe370140..92f8ea4c956 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword.stree.txt
@@ -16,7 +16,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Colon;[:];
NewLine;[LF];
Whitespace;[ ];
@@ -26,7 +26,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Colon;[:];
NewLine;[LF];
Whitespace;[ ];
@@ -42,7 +42,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
Colon;[:];
NewLine;[LF];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword.stree.txt
index 0d3cbc9fe61..df4a3d09b73 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen.stree.txt
index 78ee00f5d9f..6c8d2951f48 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCatchClausesAfterFinallyBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCatchClausesAfterFinallyBlock.stree.txt
index 38f0ea2a304..a3e40748442 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCatchClausesAfterFinallyBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCatchClausesAfterFinallyBlock.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -28,7 +28,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCodeAfterElseBranch.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCodeAfterElseBranch.stree.txt
index 90ce638d15e..3e3361152e0 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCodeAfterElseBranch.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingCodeAfterElseBranch.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
@@ -62,14 +62,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingIfIfStatementNotFollowedByElse.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingIfIfStatementNotFollowedByElse.stree.txt
index f49c6130127..32ee00580c6 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingIfIfStatementNotFollowedByElse.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/StopsParsingIfIfStatementNotFollowedByElse.stree.txt
@@ -14,14 +14,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenDoAndWhileClause.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenDoAndWhileClause.stree.txt
index 9f08b229528..585af3191e2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenDoAndWhileClause.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsBlockCommentBetweenDoAndWhileClause.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsExceptionLessCatchClauses.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsExceptionLessCatchClauses.stree.txt
index f34fdbf100a..21e55ab3dc3 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsExceptionLessCatchClauses.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsExceptionLessCatchClauses.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -28,7 +28,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenDoAndWhileClause.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenDoAndWhileClause.stree.txt
index d03be38cbc9..bc12b838f52 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenDoAndWhileClause.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsLineCommentBetweenDoAndWhileClause.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinAdditionalCatchClauses.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinAdditionalCatchClauses.stree.txt
index 4e5fc5c5c8d..5778af91a01 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinAdditionalCatchClauses.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinAdditionalCatchClauses.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -35,7 +35,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -60,7 +60,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinCatchClause.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinCatchClause.stree.txt
index 2bc989daba8..56e7dde85b4 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinCatchClause.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinCatchClause.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinFinallyClause.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinFinallyClause.stree.txt
index 7e7f5ec0e4e..9a7ed4204e7 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinFinallyClause.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsMarkupWithinFinallyClause.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenDoAndWhileClause.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenDoAndWhileClause.stree.txt
index 22d3fbc7e66..30d15869f94 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenDoAndWhileClause.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsRazorCommentBetweenDoAndWhileClause.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithFinallyClause.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithFinallyClause.stree.txt
index 589d7ab9632..b67174aee1e 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithFinallyClause.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithFinallyClause.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -28,7 +28,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithMultipleCatchClause.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithMultipleCatchClause.stree.txt
index 729ee78d0e8..267a4b745f2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithMultipleCatchClause.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithMultipleCatchClause.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -35,7 +35,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -60,7 +60,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -85,7 +85,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithNoAdditionalClauses.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithNoAdditionalClauses.stree.txt
index 0cf3aaf11ee..cedc36aa37e 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithNoAdditionalClauses.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithNoAdditionalClauses.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithOneCatchClause.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithOneCatchClause.stree.txt
index 1715878e9b6..1ec4e239e8b 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithOneCatchClause.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsTryStatementWithOneCatchClause.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -35,7 +35,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsUsingsNestedWithinOtherBlocks.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsUsingsNestedWithinOtherBlocks.stree.txt
index ccbebc58ab4..320d7b507b2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsUsingsNestedWithinOtherBlocks.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/SupportsUsingsNestedWithinOtherBlocks.stree.txt
@@ -21,14 +21,14 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Keyword;[new];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.stree.txt
index 3e9c40f3e64..60aa706f2d7 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.stree.txt
@@ -8,7 +8,7 @@
CSharpStatementLiteral - [1..39)::38 - [foreach(var f in Foo) { /* foo bar baz] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[f];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleLineCommentAtEndOfFile.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleLineCommentAtEndOfFile.stree.txt
index 531fd43fe49..8104ce01807 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleLineCommentAtEndOfFile.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleLineCommentAtEndOfFile.stree.txt
@@ -8,7 +8,7 @@
CSharpStatementLiteral - [1..39)::38 - [foreach(var f in Foo) { // foo bar baz] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[f];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleSlashAtEndOfFile.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleSlashAtEndOfFile.stree.txt
index 25726ed3d81..631d2f164f7 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleSlashAtEndOfFile.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesSingleSlashAtEndOfFile.stree.txt
@@ -8,7 +8,7 @@
CSharpStatementLiteral - [1..38)::37 - [foreach(var f in Foo) { / foo bar baz] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[f];
Whitespace;[ ];
@@ -19,7 +19,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Slash;[/];
+ CSharpOperator;[/];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt
index 95b2acaba0c..3cf7a2d2c00 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt
@@ -42,9 +42,9 @@
LeftParenthesis;[(];
CSharpCodeBlock - [17..20)::3
CSharpExpressionLiteral - [17..20)::3 - [2+3] - Gen
- IntegerLiteral;[2];
- Plus;[+];
- IntegerLiteral;[3];
+ NumericLiteral;[2];
+ CSharpOperator;[+];
+ NumericLiteral;[3];
RazorMetaCode - [20..21)::1 - Gen
RightParenthesis;[)];
MarkupTextLiteral - [21..22)::1 - ['] - Gen
@@ -69,9 +69,9 @@
LeftParenthesis;[(];
CSharpCodeBlock - [30..33)::3
CSharpExpressionLiteral - [30..33)::3 - [2+3] - Gen
- IntegerLiteral;[2];
- Plus;[+];
- IntegerLiteral;[3];
+ NumericLiteral;[2];
+ CSharpOperator;[+];
+ NumericLiteral;[3];
RazorMetaCode - [33..34)::1 - Gen
RightParenthesis;[)];
MarkupBlock - [34..36)::2
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesAtSignInDelimitedBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesAtSignInDelimitedBlock.stree.txt
index 7b35848f649..178f83898c4 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesAtSignInDelimitedBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesAtSignInDelimitedBlock.stree.txt
@@ -16,7 +16,7 @@
StringLiteral;["description"];
RightBracket;[]];
Whitespace;[ ];
- NullCoalesce;[??];
+ CSharpOperator;[??];
Whitespace;[ ];
Transition;[@];
Identifier;[photo];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement.stree.txt
index 4678ab8cb7e..04b4e09f7bc 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement.stree.txt
@@ -14,7 +14,7 @@
LeftBrace;[{];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -32,7 +32,7 @@
Whitespace;[ ];
Identifier;[@foo];
LessThan;[<];
- Slash;[/];
+ CSharpOperator;[/];
Identifier;[p];
GreaterThan;[>];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfCatchBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfCatchBlockUnterminatedAtEOF.stree.txt
index 14757443220..da38a01e241 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfCatchBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfCatchBlockUnterminatedAtEOF.stree.txt
@@ -24,7 +24,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -37,7 +37,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.stree.txt
index 57bb6524b49..3640458e405 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.stree.txt
@@ -17,7 +17,7 @@
CSharpCodeBlock - [12..55)::43
CSharpStatementLiteral - [12..55)::43 - [ var foo = bar; if(foo != null) { bar(); } ] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -30,7 +30,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfDoBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfDoBlockUnterminatedAtEOF.stree.txt
index 8a0bf84cf89..0cdb79c79ce 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfDoBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfDoBlockUnterminatedAtEOF.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -23,7 +23,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseBlockUnterminatedAtEOF.stree.txt
index 2b689aada0a..f1684bc0762 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseBlockUnterminatedAtEOF.stree.txt
@@ -24,7 +24,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -37,7 +37,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseIfBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseIfBlockUnterminatedAtEOF.stree.txt
index 80796896513..45c3f0ad43d 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseIfBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfElseIfBlockUnterminatedAtEOF.stree.txt
@@ -26,7 +26,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -39,7 +39,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF.stree.txt
index 406d88d3b04..56965096005 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF.stree.txt
@@ -12,7 +12,7 @@
CSharpCodeBlock - [2..45)::43
CSharpStatementLiteral - [2..45)::43 - [ var foo = bar; if(foo != null) { bar(); } ] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -25,7 +25,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfFinallyBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfFinallyBlockUnterminatedAtEOF.stree.txt
index 0fba38ff1d5..49121347c69 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfFinallyBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfFinallyBlockUnterminatedAtEOF.stree.txt
@@ -21,7 +21,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -34,7 +34,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForBlockUnterminatedAtEOF.stree.txt
index 682f9fa4880..f54c9e6dd25 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForBlockUnterminatedAtEOF.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -27,7 +27,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForeachBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForeachBlockUnterminatedAtEOF.stree.txt
index 9955e737e5d..4d0d7b45de4 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForeachBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfForeachBlockUnterminatedAtEOF.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -27,7 +27,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfIfBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfIfBlockUnterminatedAtEOF.stree.txt
index 8a8cb5c97bc..8a02501e9e4 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfIfBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfIfBlockUnterminatedAtEOF.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -27,7 +27,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfLockBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfLockBlockUnterminatedAtEOF.stree.txt
index 205d965012c..eebd2ad6139 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfLockBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfLockBlockUnterminatedAtEOF.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -27,7 +27,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfSwitchBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfSwitchBlockUnterminatedAtEOF.stree.txt
index 80d12b47b19..bc7445f76ba 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfSwitchBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfSwitchBlockUnterminatedAtEOF.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -27,7 +27,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfTryBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfTryBlockUnterminatedAtEOF.stree.txt
index af6b54c76ce..e4e9c0603aa 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfTryBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfTryBlockUnterminatedAtEOF.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -23,7 +23,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfUsingBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfUsingBlockUnterminatedAtEOF.stree.txt
index 7d36db38fc9..ea525d48af2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfUsingBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfUsingBlockUnterminatedAtEOF.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -27,7 +27,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfWhileBlockUnterminatedAtEOF.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfWhileBlockUnterminatedAtEOF.stree.txt
index 81aba995751..ecb4d57dcd6 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfWhileBlockUnterminatedAtEOF.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfWhileBlockUnterminatedAtEOF.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -27,7 +27,7 @@
LeftParenthesis;[(];
Identifier;[foo];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing.stree.txt
index bf4a6ec640c..85d24551fa1 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing.stree.txt
@@ -14,7 +14,7 @@
LeftBrace;[{];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[p];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.stree.txt
index 940abd79655..22f8a494cf4 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.stree.txt
@@ -13,7 +13,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.stree.txt
index 245599f8e0f..78a6bfddf5c 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.stree.txt
@@ -13,11 +13,11 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- StringLiteral;[@"blah LFblah; LFFoo
LFblah LFblah];RZ1000(21:0,21 [1] )
+ StringLiteral;[@"blah LFblah; LFFoo
LFblah LFblah];RZ1000(21:0,21 [2] )
EndOfFile;[];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt
index acdea26753c..db1060765bd 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt
@@ -40,14 +40,14 @@
Whitespace;[ ];
GreaterThan;[>];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
Whitespace;[ ];
Keyword;[return];
Whitespace;[ ];
StringLiteral;["Anouncement: "];
Whitespace;[ ];
- Plus;[+];
+ CSharpOperator;[+];
Whitespace;[ ];
Identifier;[message];
Semicolon;[;];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt
index 947d9524131..97e64ae3d4d 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt
@@ -40,7 +40,7 @@
Whitespace;[ ];
GreaterThan;[>];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
Whitespace;[ ];
MarkupBlock - [102..128)::26
@@ -75,7 +75,7 @@
LeftParenthesis;[(];
Identifier;[message];
Whitespace;[ ];
- Equals;[==];
+ CSharpOperator;[==];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
@@ -117,13 +117,13 @@
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
- Modulo;[%];
+ CSharpOperator;[%];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
Whitespace;[ ];
- Equals;[==];
+ CSharpOperator;[==];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
NewLine;[LF];
Whitespace;[ ];
@@ -163,7 +163,7 @@
LeftParenthesis;[(];
Identifier;[message];
Whitespace;[ ];
- NotEqual;[!=];
+ CSharpOperator;[!=];
Whitespace;[ ];
Keyword;[null];
RightParenthesis;[)];
@@ -179,7 +179,7 @@
GreaterThan;[>];
Identifier;[@message];
LessThan;[<];
- Slash;[/];
+ CSharpOperator;[/];
Identifier;[strong];
GreaterThan;[>];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt
index c046b0df4a5..25adc46e901 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt
@@ -55,7 +55,7 @@
Whitespace;[ ];
GreaterThan;[>];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
NewLine;[LF];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt
index 95bebc93319..c0c5f86781c 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt
@@ -27,7 +27,7 @@
Identifier;[message];
RightParenthesis;[)];
Whitespace;[ ];
- GreaterThanEqual;[=>];
+ CSharpOperator;[=>];
Whitespace;[ ];
StringLiteral;["@message
"];
Semicolon;[;];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt
index 23d71892765..6079e3b94f0 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt
@@ -27,7 +27,7 @@
Identifier;[message];
RightParenthesis;[)];
Whitespace;[ ];
- GreaterThanEqual;[=>];
+ CSharpOperator;[=>];
Whitespace;[ ];
StringLiteral;[@"@message
"];
Semicolon;[;];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt
index af91a84ac2f..8c4dd274a02 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt
@@ -37,7 +37,7 @@
Transition;[@];
Identifier;[message];
LessThan;[<];
- Slash;[/];
+ CSharpOperator;[/];
Identifier;[h3];
GreaterThan;[>];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt
index 60a54424d28..8535f37d42a 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt
@@ -55,7 +55,7 @@
Whitespace;[ ];
GreaterThan;[>];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
NewLine;[LF];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt
index faf72ba71fb..104cd791df2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt
@@ -27,14 +27,14 @@
Identifier;[message];
RightParenthesis;[)];
Whitespace;[ ];
- GreaterThanEqual;[=>];
+ CSharpOperator;[=>];
Whitespace;[ ];
LessThan;[<];
Identifier;[h3];
GreaterThan;[>];
Identifier;[@message];
LessThan;[<];
- Slash;[/];
+ CSharpOperator;[/];
Identifier;[h3];
GreaterThan;[>];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputExpressionIfModuleTokenNotFollowedByBrace.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputExpressionIfModuleTokenNotFollowedByBrace.stree.txt
index 1af77b59274..851e7a2b3bf 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputExpressionIfModuleTokenNotFollowedByBrace.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/OutputExpressionIfModuleTokenNotFollowedByBrace.stree.txt
@@ -9,7 +9,7 @@
CSharpImplicitExpressionBody - [1..13)::12
CSharpCodeBlock - [1..13)::12
CSharpExpressionLiteral - [1..13)::12 - [module.foo()] - Gen
- Identifier;[module];
+ Keyword;[module];
Dot;[.];
Identifier;[foo];
LeftParenthesis;[(];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket10.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket10.stree.txt
index a809f861ace..69f7e0a6fd3 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket10.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket10.stree.txt
@@ -12,8 +12,8 @@
Identifier;[val];
QuestionMark;[?];
LeftBracket;[[];
- Minus;[-];
- IntegerLiteral;[1];
+ CSharpOperator;[-];
+ NumericLiteral;[1];
RightBracket;[]];
MarkupTextLiteral - [9..10)::1 - [?] - Gen
QuestionMark;[?];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket12.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket12.stree.txt
index 47e8d075d30..51449f18243 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket12.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket12.stree.txt
@@ -16,7 +16,7 @@
RightBracket;[]];
QuestionMark;[?];
LeftBracket;[[];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
RightBracket;[]];
MarkupTextLiteral - [14..14)::0 - [] - Gen
Marker;[];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket15.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket15.stree.txt
index 43ca8cadc67..fd8fac4d5dd 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket15.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket15.stree.txt
@@ -14,7 +14,7 @@
LeftBracket;[[];
Keyword;[null];
Whitespace;[ ];
- NullCoalesce;[??];
+ CSharpOperator;[??];
Whitespace;[ ];
Keyword;[true];
RightBracket;[]];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket16.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket16.stree.txt
index 335983daedd..3d4e372a5a9 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket16.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket16.stree.txt
@@ -18,8 +18,8 @@
Identifier;[gef];
QuestionMark;[?];
LeftBracket;[[];
- Minus;[-];
- IntegerLiteral;[1];
+ CSharpOperator;[-];
+ NumericLiteral;[1];
RightBracket;[]];
RightBracket;[]];
MarkupTextLiteral - [20..20)::0 - [] - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket6.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket6.stree.txt
index 91ebb0de90c..6b1b811ddba 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket6.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Bracket6.stree.txt
@@ -12,7 +12,7 @@
Identifier;[val];
QuestionMark;[?];
LeftBracket;[[];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightBracket;[]];
MarkupTextLiteral - [8..8)::0 - [] - Gen
Marker;[];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot14.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot14.stree.txt
index 771968c9a95..141fcca5bf0 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot14.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullConditionalOperatorImplicitExpression_Dot14.stree.txt
@@ -16,7 +16,7 @@
LeftParenthesis;[(];
Keyword;[null];
Whitespace;[ ];
- NullCoalesce;[??];
+ CSharpOperator;[??];
Whitespace;[ ];
Keyword;[true];
RightParenthesis;[)];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Bracket15.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Bracket15.stree.txt
index 0fe1ee6920f..f038fdefc62 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Bracket15.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Bracket15.stree.txt
@@ -15,7 +15,7 @@
Keyword;[null];
Not;[!];
Whitespace;[ ];
- NullCoalesce;[??];
+ CSharpOperator;[??];
Whitespace;[ ];
Keyword;[true];
RightBracket;[]];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Brackets.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Brackets.stree.txt
index 2b25a3ec10d..4917d59a5ca 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Brackets.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Brackets.stree.txt
@@ -12,7 +12,7 @@
Identifier;[val];
Not;[!];
LeftBracket;[[];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightBracket;[]];
MarkupTextLiteral - [8..8)::0 - [] - Gen
Marker;[];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_DirectiveCodeBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_DirectiveCodeBlock.stree.txt
index 581f25f5310..a60750556ad 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_DirectiveCodeBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_DirectiveCodeBlock.stree.txt
@@ -40,7 +40,7 @@
Identifier;[Name];
Not;[!];
LeftBracket;[[];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightBracket;[]];
Not;[!];
QuestionMark;[?];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Multiple.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Multiple.stree.txt
index 5e8eaaadbc8..7cfb270b2f6 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Multiple.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Multiple.stree.txt
@@ -16,7 +16,7 @@
RightBracket;[]];
Not;[!];
LeftBracket;[[];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
RightBracket;[]];
MarkupTextLiteral - [14..14)::0 - [] - Gen
Marker;[];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Nested.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Nested.stree.txt
index 036b3405db8..db464997b77 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Nested.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_Nested.stree.txt
@@ -18,8 +18,8 @@
Identifier;[gef];
Not;[!];
LeftBracket;[[];
- Minus;[-];
- IntegerLiteral;[1];
+ CSharpOperator;[-];
+ NumericLiteral;[1];
RightBracket;[]];
RightBracket;[]];
MarkupTextLiteral - [20..20)::0 - [] - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_NestedCodeBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_NestedCodeBlock.stree.txt
index f7bd73e16c8..02e2a9ef9dd 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_NestedCodeBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_NestedCodeBlock.stree.txt
@@ -25,7 +25,7 @@
Identifier;[Name];
Not;[!];
LeftBracket;[[];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightBracket;[]];
Not;[!];
QuestionMark;[?];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_SingleOperator.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_SingleOperator.stree.txt
index f56f47be6be..f7257d2e4f5 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_SingleOperator.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ParsesNullForgivenessOperatorImplicitExpression_SingleOperator.stree.txt
@@ -12,8 +12,8 @@
Identifier;[val];
Not;[!];
LeftBracket;[[];
- Minus;[-];
- IntegerLiteral;[1];
+ CSharpOperator;[-];
+ NumericLiteral;[1];
RightBracket;[]];
MarkupTextLiteral - [9..10)::1 - [!] - Gen
Bang;[!];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesBracketsAndBalancesThemInImplicitExpression.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesBracketsAndBalancesThemInImplicitExpression.stree.txt
index 0e5936308ef..8c16ea58e72 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesBracketsAndBalancesThemInImplicitExpression.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesBracketsAndBalancesThemInImplicitExpression.stree.txt
@@ -13,16 +13,16 @@
Dot;[.];
Identifier;[bar];
LeftBracket;[[];
- IntegerLiteral;[4];
+ NumericLiteral;[4];
Whitespace;[ ];
- Star;[*];
+ CSharpOperator;[*];
Whitespace;[ ];
LeftParenthesis;[(];
- IntegerLiteral;[8];
+ NumericLiteral;[8];
Whitespace;[ ];
- Plus;[+];
+ CSharpOperator;[+];
Whitespace;[ ];
- IntegerLiteral;[7];
+ NumericLiteral;[7];
RightParenthesis;[)];
RightBracket;[]];
LeftBracket;[[];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesParenthesesAndBalancesThemInImplicitExpression.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesParenthesesAndBalancesThemInImplicitExpression.stree.txt
index dfc29f2b854..667e1fd50ed 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesParenthesesAndBalancesThemInImplicitExpression.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/ProperlyParsesParenthesesAndBalancesThemInImplicitExpression.stree.txt
@@ -18,7 +18,7 @@
StringLiteral;["bi\"z"];
Comma;[,];
Whitespace;[ ];
- IntegerLiteral;[4];
+ NumericLiteral;[4];
RightParenthesis;[)];
LeftParenthesis;[(];
StringLiteral;["chained method; call"];
@@ -35,23 +35,23 @@
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
- GreaterThanEqual;[=>];
+ CSharpOperator;[=>];
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
Keyword;[return];
Whitespace;[ ];
- IntegerLiteral;[4];
+ NumericLiteral;[4];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
Comma;[,];
Whitespace;[ ];
LeftParenthesis;[(];
- IntegerLiteral;[4];
- Plus;[+];
- IntegerLiteral;[5];
- Plus;[+];
+ NumericLiteral;[4];
+ CSharpOperator;[+];
+ NumericLiteral;[5];
+ CSharpOperator;[+];
Keyword;[new];
Whitespace;[ ];
LeftBrace;[{];
@@ -62,7 +62,7 @@
Whitespace;[ ];
Identifier;[bar];
LeftBracket;[[];
- IntegerLiteral;[4];
+ NumericLiteral;[4];
RightBracket;[]];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/SupportsSlashesWithinComplexImplicitExpressions.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/SupportsSlashesWithinComplexImplicitExpressions.stree.txt
index 4dcc43412f0..1028d027890 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/SupportsSlashesWithinComplexImplicitExpressions.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpImplicitExpressionTest/SupportsSlashesWithinComplexImplicitExpressions.stree.txt
@@ -18,7 +18,7 @@
Whitespace;[ ];
Identifier;[e];
Whitespace;[ ];
- GreaterThanEqual;[=>];
+ CSharpOperator;[=>];
Whitespace;[ ];
LeftParenthesis;[(];
Keyword;[int];
@@ -32,16 +32,16 @@
Dot;[.];
Identifier;[Now];
Whitespace;[ ];
- Minus;[-];
+ CSharpOperator;[-];
Whitespace;[ ];
Identifier;[dt];
RightParenthesis;[)];
Dot;[.];
Identifier;[TotalDays];
Whitespace;[ ];
- Slash;[/];
+ CSharpOperator;[/];
Whitespace;[ ];
- IntegerLiteral;[365];
+ NumericLiteral;[365];
RightParenthesis;[)];
RightParenthesis;[)];
MarkupTextLiteral - [103..103)::0 - [] - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedKeywordStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedKeywordStatement.stree.txt
index 0d0ef3eb32d..dbef30f0ac9 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedKeywordStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpNestedStatementsTest/NestedKeywordStatement.stree.txt
@@ -21,18 +21,18 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
- Increment;[++];
+ CSharpOperator;[++];
RightParenthesis;[)];
Whitespace;[ ];
LeftBrace;[{];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/AwaitForEachStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/AwaitForEachStatement.stree.txt
index 0cec32e13cf..7a7feae08d4 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/AwaitForEachStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/AwaitForEachStatement.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/ForEachStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/ForEachStatement.stree.txt
index 5b70a1d930d..0b7567746f7 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/ForEachStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/ForEachStatement.stree.txt
@@ -8,7 +8,7 @@
CSharpStatementLiteral - [1..35)::34 - [foreach(var foo in bar) { foo(); }] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/ForStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/ForStatement.stree.txt
index 1e98cea82da..0cbd787d351 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/ForStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/ForStatement.stree.txt
@@ -14,11 +14,11 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/MalformedAwaitForEachStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/MalformedAwaitForEachStatement.stree.txt
index 76ba687f35c..a76563c553a 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/MalformedAwaitForEachStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/MalformedAwaitForEachStatement.stree.txt
@@ -10,7 +10,7 @@
Whitespace;[ ];
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_Complete_Spaced.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_Complete_Spaced.stree.txt
index 6c67b13493c..5c8bd40f8b8 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_Complete_Spaced.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_Complete_Spaced.stree.txt
@@ -12,7 +12,7 @@
Whitespace;[ ];
Keyword;[static];
Whitespace;[ ];
- Identifier;[global];
+ Keyword;[global];
DoubleColon;[::];
Identifier;[System];
Dot;[.];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_GlobalPrefix.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_GlobalPrefix.stree.txt
index 51895aee509..079bc1691d6 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_GlobalPrefix.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/StaticUsing_GlobalPrefix.stree.txt
@@ -12,7 +12,7 @@
Whitespace;[ ];
Keyword;[static];
Whitespace;[ ];
- Identifier;[global];
+ Keyword;[global];
DoubleColon;[::];
Identifier;[System];
Dot;[.];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_DoubleColonQualifiedTypeName.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_DoubleColonQualifiedTypeName.stree.txt
index 7b014e00bdf..ff135249d29 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_DoubleColonQualifiedTypeName.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_DoubleColonQualifiedTypeName.stree.txt
@@ -13,7 +13,7 @@
Whitespace;[ ];
Keyword;[int];
LeftBracket;[[];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightBracket;[]];
RightParenthesis;[)];
NewLine;[LF];
@@ -22,7 +22,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- Identifier;[global];
+ Keyword;[global];
DoubleColon;[::];
Identifier;[Test];
Colon;[:];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_ListPattern.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_ListPattern.stree.txt
index 830c6663330..183e6b0044b 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_ListPattern.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_ListPattern.stree.txt
@@ -13,7 +13,7 @@
Whitespace;[ ];
Keyword;[int];
LeftBracket;[[];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightBracket;[]];
RightParenthesis;[)];
NewLine;[LF];
@@ -23,14 +23,13 @@
Keyword;[case];
Whitespace;[ ];
LeftBracket;[[];
- Dot;[.];
- Dot;[.];
+ CSharpOperator;[..];
Comma;[,];
Whitespace;[ ];
- IntegerLiteral;[3];
+ NumericLiteral;[3];
Comma;[,];
Whitespace;[ ];
- IntegerLiteral;[4];
+ NumericLiteral;[4];
RightBracket;[]];
Colon;[:];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_RecursivePattern.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_RecursivePattern.stree.txt
index a7fbd42e360..1167b825ee9 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_RecursivePattern.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_RecursivePattern.stree.txt
@@ -24,7 +24,7 @@
Identifier;[Year];
Colon;[:];
Whitespace;[ ];
- IntegerLiteral;[2022];
+ NumericLiteral;[2022];
Whitespace;[ ];
RightBrace;[}];
Colon;[:];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_TuplePattern.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_TuplePattern.stree.txt
index 7cce1f95a83..e42af75328a 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_TuplePattern.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/SwitchStatement_TuplePattern.stree.txt
@@ -10,10 +10,10 @@
Whitespace;[ ];
LeftParenthesis;[(];
LeftParenthesis;[(];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Comma;[,];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
RightParenthesis;[)];
RightParenthesis;[)];
NewLine;[LF];
@@ -25,10 +25,10 @@
Identifier;[ITuple];
Whitespace;[ ];
LeftParenthesis;[(];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Comma;[,];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
RightParenthesis;[)];
Colon;[:];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/UsingStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/UsingStatement.stree.txt
index d39fe6764f4..80c61132af2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/UsingStatement.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/UsingStatement.stree.txt
@@ -8,7 +8,7 @@
CSharpStatementLiteral - [1..42)::41 - [using(var foo = new Foo()) { foo.Bar(); }] - Gen
Keyword;[using];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/Using_VariableDeclaration_Complex.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/Using_VariableDeclaration_Complex.stree.txt
index 296bae75805..7bb2b5f7dff 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/Using_VariableDeclaration_Complex.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/Using_VariableDeclaration_Complex.stree.txt
@@ -36,13 +36,13 @@
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
- GreaterThanEqual;[=>];
+ CSharpOperator;[=>];
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
Keyword;[using];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[bar];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/Using_VariableDeclaration_Simple.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/Using_VariableDeclaration_Simple.stree.txt
index 6565edadcd4..25dc74b2812 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/Using_VariableDeclaration_Simple.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpStatementTest/Using_VariableDeclaration_Simple.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
Keyword;[using];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInExplicitExpressionParens.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInExplicitExpressionParens.stree.txt
index a699ab04694..4be3ce3793b 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInExplicitExpressionParens.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInExplicitExpressionParens.stree.txt
@@ -15,7 +15,7 @@
Dot;[.];
Identifier;[Repeat];
LeftParenthesis;[(];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Comma;[,];
Whitespace;[ ];
CSharpTemplateBlock - [18..36)::18
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInImplicitExpressionParens.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInImplicitExpressionParens.stree.txt
index 62b04f1036e..fa309d498e9 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInImplicitExpressionParens.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInImplicitExpressionParens.stree.txt
@@ -13,7 +13,7 @@
Dot;[.];
Identifier;[Repeat];
LeftParenthesis;[(];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Comma;[,];
Whitespace;[ ];
CSharpTemplateBlock - [17..35)::18
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInStatementWithinStatementBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInStatementWithinStatementBlock.stree.txt
index bd368322679..0cc24ce8e68 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInStatementWithinStatementBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSimpleTemplateInStatementWithinStatementBlock.stree.txt
@@ -12,7 +12,7 @@
CSharpCodeBlock - [2..65)::63
CSharpStatementLiteral - [2..44)::42 - [ var foo = bar; Html.ExecuteTemplate(foo, ] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSingleLineTemplate.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSingleLineTemplate.stree.txt
index 44dcdc2a168..613f3b53432 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSingleLineTemplate.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesSingleLineTemplate.stree.txt
@@ -12,7 +12,7 @@
CSharpCodeBlock - [2..23)::21
CSharpStatementLiteral - [2..13)::11 - [ var foo = ] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesTwoTemplatesInImplicitExpressionParens.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesTwoTemplatesInImplicitExpressionParens.stree.txt
index 621e2ee621f..9b7f6a77316 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesTwoTemplatesInImplicitExpressionParens.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlesTwoTemplatesInImplicitExpressionParens.stree.txt
@@ -13,7 +13,7 @@
Dot;[.];
Identifier;[Repeat];
LeftParenthesis;[(];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Comma;[,];
Whitespace;[ ];
CSharpTemplateBlock - [17..35)::18
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlessTwoTemplatesInStatementWithinStatementBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlessTwoTemplatesInStatementWithinStatementBlock.stree.txt
index 2a375d61e67..7362343039d 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlessTwoTemplatesInStatementWithinStatementBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/HandlessTwoTemplatesInStatementWithinStatementBlock.stree.txt
@@ -12,7 +12,7 @@
CSharpCodeBlock - [2..85)::83
CSharpStatementLiteral - [2..44)::42 - [ var foo = bar; Html.ExecuteTemplate(foo, ] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInImplicitExprParens.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInImplicitExprParens.stree.txt
index df75fe1e333..dec0c5def9b 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInImplicitExprParens.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInImplicitExprParens.stree.txt
@@ -13,7 +13,7 @@
Dot;[.];
Identifier;[Repeat];
LeftParenthesis;[(];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Comma;[,];
Whitespace;[ ];
CSharpTemplateBlock - [17..61)::44
@@ -40,7 +40,7 @@
Dot;[.];
Identifier;[Repeat];
LeftParenthesis;[(];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Comma;[,];
Whitespace;[ ];
CSharpTemplateBlock - [43..56)::13
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinCodeBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinCodeBlock.stree.txt
index 633ca12e8d2..8649b5ad05d 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinCodeBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinCodeBlock.stree.txt
@@ -48,7 +48,7 @@
Dot;[.];
Identifier;[Repeat];
LeftParenthesis;[(];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Comma;[,];
Whitespace;[ ];
CSharpTemplateBlock - [75..88)::13
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinStmtBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinStmtBlock.stree.txt
index 213630d0621..5159c9f4e2e 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinStmtBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinStmtBlock.stree.txt
@@ -12,7 +12,7 @@
CSharpCodeBlock - [2..91)::89
CSharpStatementLiteral - [2..44)::42 - [ var foo = bar; Html.ExecuteTemplate(foo, ] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -52,7 +52,7 @@
Dot;[.];
Identifier;[Repeat];
LeftParenthesis;[(];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Comma;[,];
Whitespace;[ ];
CSharpTemplateBlock - [70..83)::13
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/_WithDoubleTransition_DoesNotThrow.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/_WithDoubleTransition_DoesNotThrow.stree.txt
index 79ad8b9c4bf..3e08c5e52ab 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/_WithDoubleTransition_DoesNotThrow.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpTemplateTest/_WithDoubleTransition_DoesNotThrow.stree.txt
@@ -12,7 +12,7 @@
CSharpCodeBlock - [2..74)::72
CSharpStatementLiteral - [2..44)::42 - [ var foo = bar; Html.ExecuteTemplate(foo, ] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CorrectlyReturnsFromMarkupBlockWithPseudoTag.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CorrectlyReturnsFromMarkupBlockWithPseudoTag.stree.txt
index 44220a1492f..70f279e21de 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CorrectlyReturnsFromMarkupBlockWithPseudoTag.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CorrectlyReturnsFromMarkupBlockWithPseudoTag.stree.txt
@@ -13,7 +13,7 @@
Whitespace;[ ];
GreaterThan;[>];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
Whitespace;[ ];
LeftBrace;[{];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CorrectlyReturnsFromMarkupBlockWithPseudoTagInCodeBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CorrectlyReturnsFromMarkupBlockWithPseudoTagInCodeBlock.stree.txt
index 178a6cca5f1..3e3ae16ab60 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CorrectlyReturnsFromMarkupBlockWithPseudoTagInCodeBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CorrectlyReturnsFromMarkupBlockWithPseudoTagInCodeBlock.stree.txt
@@ -19,7 +19,7 @@
Whitespace;[ ];
GreaterThan;[>];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
RightParenthesis;[)];
Whitespace;[ ];
LeftBrace;[{];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/GivesAllWhitespaceOnSameLineWithTrailingNewLineToMarkupExclPreceedingNewline.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/GivesAllWhitespaceOnSameLineWithTrailingNewLineToMarkupExclPreceedingNewline.stree.txt
index eea8f60a4b4..32cb343cd04 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/GivesAllWhitespaceOnSameLineWithTrailingNewLineToMarkupExclPreceedingNewline.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/GivesAllWhitespaceOnSameLineWithTrailingNewLineToMarkupExclPreceedingNewline.stree.txt
@@ -14,7 +14,7 @@
LeftBrace;[{];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -70,7 +70,7 @@
NewLine;[LF];
CSharpStatementLiteral - [141..162)::21 - [ var biz = boz;LF}] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[biz];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ParsesMarkupStatementOnOpenAngleBracket.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ParsesMarkupStatementOnOpenAngleBracket.stree.txt
index 17efd3ef81f..a37d2adc6ca 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ParsesMarkupStatementOnOpenAngleBracket.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ParsesMarkupStatementOnOpenAngleBracket.stree.txt
@@ -14,18 +14,18 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
- Increment;[++];
+ CSharpOperator;[++];
RightParenthesis;[)];
Whitespace;[ ];
LeftBrace;[{];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ParsesMarkupStatementOnOpenAngleBracketInCodeBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ParsesMarkupStatementOnOpenAngleBracketInCodeBlock.stree.txt
index a0bce83b421..ca5d1ec74b9 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ParsesMarkupStatementOnOpenAngleBracketInCodeBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ParsesMarkupStatementOnOpenAngleBracketInCodeBlock.stree.txt
@@ -20,18 +20,18 @@
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
Whitespace;[ ];
LessThan;[<];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Semicolon;[;];
Whitespace;[ ];
Identifier;[i];
- Increment;[++];
+ CSharpOperator;[++];
RightParenthesis;[)];
Whitespace;[ ];
LeftBrace;[{];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ShouldSupportMarkupWithoutPreceedingWhitespace.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ShouldSupportMarkupWithoutPreceedingWhitespace.stree.txt
index 7c86ca9208c..23254e1bd9c 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ShouldSupportMarkupWithoutPreceedingWhitespace.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ShouldSupportMarkupWithoutPreceedingWhitespace.stree.txt
@@ -8,9 +8,9 @@
CSharpStatementLiteral - [1..34)::33 - [foreach(var file in files){LFLFLF] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
- Identifier;[file];
+ Keyword;[file];
Whitespace;[ ];
Keyword;[in];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ShouldSupportSingleLineMarkupContainingStatementBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ShouldSupportSingleLineMarkupContainingStatementBlock.stree.txt
index 7b58d9cc185..09d7cbbf2f2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ShouldSupportSingleLineMarkupContainingStatementBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/ShouldSupportSingleLineMarkupContainingStatementBlock.stree.txt
@@ -11,7 +11,7 @@
CSharpExpressionLiteral - [1..17)::16 - [Repeat(10,LF ] - Gen
Identifier;[Repeat];
LeftParenthesis;[(];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
Comma;[,];
NewLine;[LF];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsAllKindsOfImplicitMarkupInCodeBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsAllKindsOfImplicitMarkupInCodeBlock.stree.txt
index e2ed8e0f1e5..f4481ffa802 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsAllKindsOfImplicitMarkupInCodeBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsAllKindsOfImplicitMarkupInCodeBlock.stree.txt
@@ -42,7 +42,7 @@
Keyword;[foreach];
Whitespace;[ ];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[p];
Whitespace;[ ];
@@ -52,10 +52,10 @@
Dot;[.];
Identifier;[Range];
LeftParenthesis;[(];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Comma;[,];
Whitespace;[ ];
- IntegerLiteral;[10];
+ NumericLiteral;[10];
RightParenthesis;[)];
RightParenthesis;[)];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsMarkupInCaseAndDefaultBranchesOfSwitch.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsMarkupInCaseAndDefaultBranchesOfSwitch.stree.txt
index b09d212631d..c0d0e20e00e 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsMarkupInCaseAndDefaultBranchesOfSwitch.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsMarkupInCaseAndDefaultBranchesOfSwitch.stree.txt
@@ -16,7 +16,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Colon;[:];
NewLine;[LF];
MarkupBlock - [29..49)::20
@@ -44,7 +44,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Colon;[:];
NewLine;[LF];
MarkupBlock - [78..98)::20
@@ -72,7 +72,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
Colon;[:];
NewLine;[LF];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsMarkupInCaseAndDefaultBranchesOfSwitchInCodeBlock.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsMarkupInCaseAndDefaultBranchesOfSwitchInCodeBlock.stree.txt
index 5924b07a979..853c16d2c98 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsMarkupInCaseAndDefaultBranchesOfSwitchInCodeBlock.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpToMarkupSwitchTest/SupportsMarkupInCaseAndDefaultBranchesOfSwitchInCodeBlock.stree.txt
@@ -22,7 +22,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Colon;[:];
NewLine;[LF];
MarkupBlock - [31..51)::20
@@ -50,7 +50,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Colon;[:];
NewLine;[LF];
MarkupBlock - [80..100)::20
@@ -78,7 +78,7 @@
Whitespace;[ ];
Keyword;[case];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
Colon;[:];
NewLine;[LF];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlAttributeTest/ConditionalAttribute_DynamicContentBefore_02.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlAttributeTest/ConditionalAttribute_DynamicContentBefore_02.stree.txt
index 0bfb01eb951..d47040c9445 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlAttributeTest/ConditionalAttribute_DynamicContentBefore_02.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlAttributeTest/ConditionalAttribute_DynamicContentBefore_02.stree.txt
@@ -18,7 +18,7 @@
CSharpExpressionLiteral - [5..10)::5 - [x + y] - Gen
Identifier;[x];
Whitespace;[ ];
- Plus;[+];
+ CSharpOperator;[+];
Whitespace;[ ];
Identifier;[y];
RazorMetaCode - [10..11)::1 - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlDocumentTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlDocumentTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt
index b10324cbe42..36cad9ef4db 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlDocumentTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlDocumentTest/WithDoubleTransitionWithExpressionBlock_DoesNotThrow.stree.txt
@@ -33,9 +33,9 @@
LeftParenthesis;[(];
CSharpCodeBlock - [16..19)::3
CSharpExpressionLiteral - [16..19)::3 - [2+3] - Gen
- IntegerLiteral;[2];
- Plus;[+];
- IntegerLiteral;[3];
+ NumericLiteral;[2];
+ CSharpOperator;[+];
+ NumericLiteral;[3];
RazorMetaCode - [19..20)::1 - Gen
RightParenthesis;[)];
MarkupTextLiteral - [20..21)::1 - ['] - Gen
@@ -60,9 +60,9 @@
LeftParenthesis;[(];
CSharpCodeBlock - [29..32)::3
CSharpExpressionLiteral - [29..32)::3 - [2+3] - Gen
- IntegerLiteral;[2];
- Plus;[+];
- IntegerLiteral;[3];
+ NumericLiteral;[2];
+ CSharpOperator;[+];
+ NumericLiteral;[3];
RazorMetaCode - [32..33)::1 - Gen
RightParenthesis;[)];
MarkupBlock - [33..35)::2
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlTagsTest/VoidElementFollowedByCloseTag.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlTagsTest/VoidElementFollowedByCloseTag.stree.txt
index b01f162e396..5a3787b897b 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlTagsTest/VoidElementFollowedByCloseTag.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlTagsTest/VoidElementFollowedByCloseTag.stree.txt
@@ -26,7 +26,7 @@
Text;[area];
CloseAngle;[>];
CSharpStatementLiteral - [18..33)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -63,7 +63,7 @@
Text;[base];
CloseAngle;[>];
CSharpStatementLiteral - [54..69)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -100,7 +100,7 @@
Text;[br];
CloseAngle;[>];
CSharpStatementLiteral - [86..101)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -137,7 +137,7 @@
Text;[col];
CloseAngle;[>];
CSharpStatementLiteral - [120..135)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -174,7 +174,7 @@
Text;[command];
CloseAngle;[>];
CSharpStatementLiteral - [162..177)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -211,7 +211,7 @@
Text;[embed];
CloseAngle;[>];
CSharpStatementLiteral - [200..215)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -248,7 +248,7 @@
Text;[hr];
CloseAngle;[>];
CSharpStatementLiteral - [232..247)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -285,7 +285,7 @@
Text;[img];
CloseAngle;[>];
CSharpStatementLiteral - [266..281)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -322,7 +322,7 @@
Text;[input];
CloseAngle;[>];
CSharpStatementLiteral - [304..319)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -359,7 +359,7 @@
Text;[keygen];
CloseAngle;[>];
CSharpStatementLiteral - [344..359)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -396,7 +396,7 @@
Text;[link];
CloseAngle;[>];
CSharpStatementLiteral - [380..395)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -433,7 +433,7 @@
Text;[meta];
CloseAngle;[>];
CSharpStatementLiteral - [416..431)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -470,7 +470,7 @@
Text;[param];
CloseAngle;[>];
CSharpStatementLiteral - [454..469)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -507,7 +507,7 @@
Text;[source];
CloseAngle;[>];
CSharpStatementLiteral - [494..509)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -544,7 +544,7 @@
Text;[track];
CloseAngle;[>];
CSharpStatementLiteral - [532..547)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -581,7 +581,7 @@
Text;[wbr];
CloseAngle;[>];
CSharpStatementLiteral - [566..581)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlTagsTest/VoidElementFollowedByContent.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlTagsTest/VoidElementFollowedByContent.stree.txt
index bc58f93e088..6c51fb5c27d 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlTagsTest/VoidElementFollowedByContent.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlTagsTest/VoidElementFollowedByContent.stree.txt
@@ -19,7 +19,7 @@
Text;[area];
CloseAngle;[>];
CSharpStatementLiteral - [10..25)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -49,7 +49,7 @@
Text;[base];
CloseAngle;[>];
CSharpStatementLiteral - [38..53)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -79,7 +79,7 @@
Text;[br];
CloseAngle;[>];
CSharpStatementLiteral - [64..79)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -109,7 +109,7 @@
Text;[col];
CloseAngle;[>];
CSharpStatementLiteral - [91..106)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -139,7 +139,7 @@
Text;[command];
CloseAngle;[>];
CSharpStatementLiteral - [122..137)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -169,7 +169,7 @@
Text;[embed];
CloseAngle;[>];
CSharpStatementLiteral - [151..166)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -199,7 +199,7 @@
Text;[hr];
CloseAngle;[>];
CSharpStatementLiteral - [177..192)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -229,7 +229,7 @@
Text;[img];
CloseAngle;[>];
CSharpStatementLiteral - [204..219)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -259,7 +259,7 @@
Text;[input];
CloseAngle;[>];
CSharpStatementLiteral - [233..248)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -289,7 +289,7 @@
Text;[keygen];
CloseAngle;[>];
CSharpStatementLiteral - [263..278)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -319,7 +319,7 @@
Text;[link];
CloseAngle;[>];
CSharpStatementLiteral - [291..306)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -349,7 +349,7 @@
Text;[meta];
CloseAngle;[>];
CSharpStatementLiteral - [319..334)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -379,7 +379,7 @@
Text;[param];
CloseAngle;[>];
CSharpStatementLiteral - [348..363)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -409,7 +409,7 @@
Text;[source];
CloseAngle;[>];
CSharpStatementLiteral - [378..393)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -439,7 +439,7 @@
Text;[track];
CloseAngle;[>];
CSharpStatementLiteral - [407..422)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
@@ -469,7 +469,7 @@
Text;[wbr];
CloseAngle;[>];
CSharpStatementLiteral - [434..449)::15 - [var x = true;LF] - Gen
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/CSharpCodeParserDoesNotAcceptLeadingOrTrailingWhitespaceInDesignMode.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/CSharpCodeParserDoesNotAcceptLeadingOrTrailingWhitespaceInDesignMode.stree.txt
index c08f92d087b..1a7cf7204e2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/CSharpCodeParserDoesNotAcceptLeadingOrTrailingWhitespaceInDesignMode.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/CSharpCodeParserDoesNotAcceptLeadingOrTrailingWhitespaceInDesignMode.stree.txt
@@ -27,7 +27,7 @@
CSharpStatementLiteral - [16..54)::38 - [foreach(var p in Products) {LF ] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[p];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/GivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/GivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
index 5f05b0e51e8..149588d6901 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/GivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/GivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
@@ -28,7 +28,7 @@
CSharpStatementLiteral - [16..46)::30 - [foreach(var p in Products) {LF] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[p];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/ParseDocumentGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/ParseDocumentGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
index 01360e28875..f653ed53a68 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/ParseDocumentGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/ParseDocumentGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
@@ -17,7 +17,7 @@
CSharpStatementLiteral - [14..44)::30 - [foreach(var p in Products) {LF] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[p];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/SectionContextGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/SectionContextGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
index 950383f409b..60848984167 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/SectionContextGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/SectionContextGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.stree.txt
@@ -47,7 +47,7 @@
CSharpStatementLiteral - [37..67)::30 - [foreach(var p in Products) {LF] - Gen
Keyword;[foreach];
LeftParenthesis;[(];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[p];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/MarkupElementGroupingTest/Handles_ValidNestedTagsMixedWithCode.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/MarkupElementGroupingTest/Handles_ValidNestedTagsMixedWithCode.stree.txt
index 378e3e158a9..531f9262473 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/MarkupElementGroupingTest/Handles_ValidNestedTagsMixedWithCode.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/MarkupElementGroupingTest/Handles_ValidNestedTagsMixedWithCode.stree.txt
@@ -45,7 +45,7 @@
CSharpCodeBlock - [41..55)::14
CSharpStatementLiteral - [41..55)::14 - [ var x = Bar; ] - Gen
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[x];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AllowsNullableTypes.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AllowsNullableTypes.stree.txt
index 33a176c7a8e..ed630f0f980 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AllowsNullableTypes.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AllowsNullableTypes.stree.txt
@@ -25,7 +25,7 @@
CSharpStatementLiteral - [25..26)::1 - [ ] - Gen
Whitespace;[ ];
CSharpStatementLiteral - [26..47)::21 - [global::System.Int32?] - Gen
- Identifier;[global];
+ Keyword;[global];
DoubleColon;[::];
Identifier;[System];
Dot;[.];
@@ -58,7 +58,7 @@
CSharpStatementLiteral - [109..110)::1 - [ ] - Gen
Whitespace;[ ];
CSharpStatementLiteral - [110..176)::66 - [global::System.Collections.Generic.KeyValuePair?[]] - Gen
- Identifier;[global];
+ Keyword;[global];
DoubleColon;[::];
Identifier;[System];
Dot;[.];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AllowsTupleTypes.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AllowsTupleTypes.stree.txt
index 1d3d01fa694..eed8474c484 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AllowsTupleTypes.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AllowsTupleTypes.stree.txt
@@ -150,7 +150,7 @@
RightParenthesis;[)];
Comma;[,];
Whitespace;[ ];
- Identifier;[global];
+ Keyword;[global];
DoubleColon;[::];
Identifier;[System];
Dot;[.];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AttributeToken_BalancesBrackets.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AttributeToken_BalancesBrackets.stree.txt
index b4117926a8d..53e84c83cc9 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AttributeToken_BalancesBrackets.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_AttributeToken_BalancesBrackets.stree.txt
@@ -24,13 +24,13 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Comma;[,];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
Comma;[,];
Whitespace;[ ];
- IntegerLiteral;[3];
+ NumericLiteral;[3];
Whitespace;[ ];
RightBrace;[}];
NewLine;[LF];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_MultilineAttributeToken_BalancesBrackets.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_MultilineAttributeToken_BalancesBrackets.stree.txt
index 27fda034ab6..5110a63382a 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_MultilineAttributeToken_BalancesBrackets.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_MultilineAttributeToken_BalancesBrackets.stree.txt
@@ -26,15 +26,15 @@
LeftBrace;[{];
NewLine;[LF];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Comma;[,];
NewLine;[LF];
Whitespace;[ ];
- IntegerLiteral;[2];
+ NumericLiteral;[2];
Comma;[,];
NewLine;[LF];
Whitespace;[ ];
- IntegerLiteral;[3];
+ NumericLiteral;[3];
NewLine;[LF];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes11.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes11.stree.txt
index 88a61d4ce97..0e97cc6a0ab 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes11.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes11.stree.txt
@@ -32,9 +32,9 @@
CSharpExpressionLiteral - [16..17)::1 - [(] - Gen
LeftParenthesis;[(];
CSharpExpressionLiteral - [17..21)::4 - [11+1] - Gen
- IntegerLiteral;[11];
- Plus;[+];
- IntegerLiteral;[1];
+ NumericLiteral;[11];
+ CSharpOperator;[+];
+ NumericLiteral;[1];
CSharpExpressionLiteral - [21..22)::1 - [)] - Gen
RightParenthesis;[)];
MarkupTextLiteral - [22..23)::1 - ["] - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes12.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes12.stree.txt
index 7f7774b3e25..224e715648c 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes12.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes12.stree.txt
@@ -25,17 +25,17 @@
CSharpStatementLiteral - [15..34)::19 - [flag == 0 ? 11 : 12] - Gen
Identifier;[flag];
Whitespace;[ ];
- Equals;[==];
+ CSharpOperator;[==];
Whitespace;[ ];
- IntegerLiteral;[0];
+ NumericLiteral;[0];
Whitespace;[ ];
QuestionMark;[?];
Whitespace;[ ];
- IntegerLiteral;[11];
+ NumericLiteral;[11];
Whitespace;[ ];
Colon;[:];
Whitespace;[ ];
- IntegerLiteral;[12];
+ NumericLiteral;[12];
RazorMetaCode - [34..35)::1 - Gen
RightBrace;[}];
MarkupTextLiteral - [35..36)::1 - ["] - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes13.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes13.stree.txt
index b695cccf558..5fb63e3f639 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes13.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes13.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[count];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes14.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes14.stree.txt
index ee07092ee46..2f4ff98b028 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes14.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes14.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[@string];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes15.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes15.stree.txt
index 49afc933f8b..3b392b4d445 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes15.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes15.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[count];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes16.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes16.stree.txt
index f96a8dc8472..97c8d687a18 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes16.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes16.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[count];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes17.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes17.stree.txt
index d448015f5ff..8f0e07a4e96 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes17.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes17.stree.txt
@@ -14,13 +14,13 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[count];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Semicolon;[;];
NewLine;[LF];
RazorMetaCode - [25..26)::1 - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes18.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes18.stree.txt
index 6e2629e042e..0c4d9a5b590 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes18.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes18.stree.txt
@@ -14,13 +14,13 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[count];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Semicolon;[;];
NewLine;[LF];
RazorMetaCode - [25..26)::1 - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes19.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes19.stree.txt
index 8222a2cd8b5..ab3d37af725 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes19.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes19.stree.txt
@@ -14,13 +14,13 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[count];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Semicolon;[;];
NewLine;[LF];
RazorMetaCode - [25..26)::1 - Gen
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes20.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes20.stree.txt
index 15d339e24e7..b0d7ffdaef2 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes20.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes20.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[isAlive];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes21.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes21.stree.txt
index 674af32b2f4..ee9354f449c 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes21.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes21.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[obj];
Whitespace;[ ];
@@ -31,7 +31,7 @@
LeftParenthesis;[(];
Keyword;[object];
RightParenthesis;[)];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Whitespace;[ ];
RightBrace;[}];
Semicolon;[;];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes22.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes22.stree.txt
index 3c570fc4e5c..11454de087b 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes22.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes22.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[obj];
Whitespace;[ ];
@@ -31,7 +31,7 @@
LeftParenthesis;[(];
Keyword;[object];
RightParenthesis;[)];
- IntegerLiteral;[1];
+ NumericLiteral;[1];
Whitespace;[ ];
RightBrace;[}];
Semicolon;[;];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes23.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes23.stree.txt
index 1c3dd2921e0..6e45fda099e 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes23.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/CreatesMarkupCodeSpansForNonStringTagHelperAttributes23.stree.txt
@@ -14,7 +14,7 @@
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[item];
Whitespace;[ ];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks2.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks2.stree.txt
index 854d50bd8a6..bbb6678ee94 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks2.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks2.stree.txt
@@ -23,7 +23,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -48,7 +48,7 @@
CSharpStatementLiteral - [47..74)::27 - [ foo++; } while (foo);] - Gen
Whitespace;[ ];
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
@@ -83,7 +83,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -108,7 +108,7 @@
CSharpStatementLiteral - [120..147)::27 - [ foo++; } while (foo);] - Gen
Whitespace;[ ];
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks4.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks4.stree.txt
index e31dab2c681..569ef101be1 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks4.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks4.stree.txt
@@ -23,7 +23,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -48,7 +48,7 @@
CSharpStatementLiteral - [47..74)::27 - [ foo++; } while (foo);] - Gen
Whitespace;[ ];
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
@@ -83,7 +83,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -108,7 +108,7 @@
CSharpStatementLiteral - [120..147)::27 - [ foo++; } while (foo);] - Gen
Whitespace;[ ];
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks6.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks6.stree.txt
index aa1615a7730..f76aef65610 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks6.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexAttributeTagHelperTagBlocks6.stree.txt
@@ -23,7 +23,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -48,7 +48,7 @@
CSharpStatementLiteral - [47..74)::27 - [ foo++; } while (foo);] - Gen
Whitespace;[ ];
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
@@ -97,7 +97,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -122,7 +122,7 @@
CSharpStatementLiteral - [133..160)::27 - [ foo++; } while (foo);] - Gen
Whitespace;[ ];
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks2.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks2.stree.txt
index 63624768130..c1917a30c81 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks2.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks2.stree.txt
@@ -13,7 +13,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -40,7 +40,7 @@
Whitespace;[ ];
CSharpStatementLiteral - [35..61)::26 - [foo++; } while (foo);] - Gen
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks4.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks4.stree.txt
index c1da16a5a6d..2f7344dfa15 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks4.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks4.stree.txt
@@ -18,7 +18,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -45,7 +45,7 @@
Whitespace;[ ];
CSharpStatementLiteral - [47..73)::26 - [foo++; } while (foo);] - Gen
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks6.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks6.stree.txt
index b06a0a3c645..93ebe6e87ac 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks6.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks6.stree.txt
@@ -13,7 +13,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -40,7 +40,7 @@
Whitespace;[ ];
CSharpStatementLiteral - [35..61)::26 - [foo++; } while (foo);] - Gen
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
@@ -74,7 +74,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -101,7 +101,7 @@
Whitespace;[ ];
CSharpStatementLiteral - [101..127)::26 - [foo++; } while (foo);] - Gen
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks8.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks8.stree.txt
index 436f2f57010..feaac82c175 100644
--- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks8.stree.txt
+++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/TagHelperBlockRewriterTest/TagHelperParseTreeRewriter_RewritesComplexTagHelperTagBlocks8.stree.txt
@@ -16,7 +16,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -43,7 +43,7 @@
Whitespace;[ ];
CSharpStatementLiteral - [41..67)::26 - [foo++; } while (foo);] - Gen
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
@@ -75,7 +75,7 @@
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
- Identifier;[var];
+ Keyword;[var];
Whitespace;[ ];
Identifier;[foo];
Whitespace;[ ];
@@ -102,7 +102,7 @@
Whitespace;[ ];
CSharpStatementLiteral - [117..143)::26 - [foo++; } while (foo);] - Gen
Identifier;[foo];
- Increment;[++];
+ CSharpOperator;[++];
Semicolon;[;];
Whitespace;[ ];
RightBrace;[}];
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs
index a37a09e6c21..92252cf313c 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs
@@ -228,6 +228,8 @@ public HtmlMarkupParser HtmlParser
return null;
}
+ StartingBlock();
+
using (var pooledResult = Pool.Allocate())
using (PushSpanContextConfig(DefaultSpanContextConfig))
{
@@ -246,10 +248,10 @@ public HtmlMarkupParser HtmlParser
CurrentToken.Content[0] == SyntaxConstants.TransitionCharacter)
{
var split = Language.SplitToken(CurrentToken, 1, SyntaxKind.Transition);
- transitionToken = split.Item1;
+ transitionToken = split.left;
// Back up to the end of the transition
- Context.Source.Position -= split.Item2.Content.Length;
+ _tokenizer.Reset(Context.Source.Position - split.right.Content.Length);
NextToken();
}
else if (At(SyntaxKind.Transition))
@@ -1035,7 +1037,7 @@ not SyntaxKind.LeftBracket and
}
else
{
- Context.Source.Position = bookmark;
+ _tokenizer.Reset(bookmark);
NextToken();
AcceptUntil(SyntaxKind.LessThan, SyntaxKind.LeftBrace, SyntaxKind.RightBrace);
return;
@@ -1764,8 +1766,10 @@ private void ParseExtensibleDirective(in SyntaxListBuilder buil
using (PushSpanContextConfig())
{
+ EndingBlock();
var razorBlock = HtmlParser.ParseRazorBlock(Tuple.Create("{", "}"), caseSensitive: true);
directiveBuilder.Add(razorBlock);
+ StartingBlock();
}
InitializeContext();
@@ -2377,7 +2381,7 @@ private void ParseUsingKeyword(SyntaxListBuilder builder, CShar
ReadWhile(IsSpacingTokenIncludingComments, ref whitespaceOrComments.AsRef());
var atLeftParen = At(SyntaxKind.LeftParenthesis);
var atIdentifier = At(SyntaxKind.Identifier);
- var atStatic = At(CSharpSyntaxKind.StaticKeyword);
+ var atStaticOrGlobal = At(CSharpSyntaxKind.StaticKeyword, CSharpSyntaxKind.GlobalKeyword);
// Put the read tokens back and let them be handled later.
PutCurrentBack();
@@ -2390,7 +2394,7 @@ private void ParseUsingKeyword(SyntaxListBuilder builder, CShar
// using ( ==> Using Statement
ParseUsingStatement(builder, transition, block);
}
- else if (atIdentifier || atStatic)
+ else if (atIdentifier || atStaticOrGlobal)
{
// using Identifier ==> Using Declaration
if (!topLevel)
@@ -2472,7 +2476,7 @@ private void ParseUsingDeclaration(in SyntaxListBuilder builder
var nonNamespaceTokenCount = TokenBuilder.Count;
AcceptWhile(IsSpacingTokenIncludingComments);
var start = CurrentStart;
- if (At(SyntaxKind.Identifier))
+ if (At(SyntaxKind.Identifier) || At(CSharpSyntaxKind.GlobalKeyword))
{
// non-static using
nonNamespaceTokenCount = TokenBuilder.Count;
@@ -2783,6 +2787,8 @@ private void OtherParserBlock(in SyntaxListBuilder builder)
var wasNested = IsNested;
IsNested = false;
+ EndingBlock();
+
RazorSyntaxNode? htmlBlock = null;
using (PushSpanContextConfig())
{
@@ -2792,6 +2798,8 @@ private void OtherParserBlock(in SyntaxListBuilder builder)
builder.Add(htmlBlock);
InitializeContext();
+ StartingBlock();
+
IsNested = wasNested;
NextToken();
}
@@ -2863,7 +2871,7 @@ private bool Balance(SyntaxListBuilder builder, BalancingModes
}
if ((mode & BalancingModes.BacktrackOnFailure) == BalancingModes.BacktrackOnFailure)
{
- Context.Source.Position = startPosition;
+ _tokenizer.Reset(startPosition);
NextToken();
}
else
@@ -2923,12 +2931,23 @@ internal void Assert(CSharpSyntaxKind expectedKeyword)
result.Value == expectedKeyword);
}
- protected internal bool At(CSharpSyntaxKind keyword)
+ protected internal bool At(params ReadOnlySpan keywords)
{
var result = _tokenizer.Tokenizer.GetTokenKeyword(CurrentToken);
- return At(SyntaxKind.Keyword) &&
- result.HasValue &&
- result.Value == keyword;
+ if (!At(SyntaxKind.Keyword) || result is not { } keywordKind)
+ {
+ return false;
+ }
+
+ foreach (var search in keywords)
+ {
+ if (keywordKind == search)
+ {
+ return true;
+ }
+ }
+
+ return false;
}
private string GetBlockName(SyntaxToken token)
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/HtmlTokenizer.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/HtmlTokenizer.cs
index 71bab914fc6..30ec72384be 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/HtmlTokenizer.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/HtmlTokenizer.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#nullable disable
@@ -61,7 +61,7 @@ protected override StateResult Dispatch()
case HtmlTokenizerState.StarAfterRazorCommentBody:
return StarAfterRazorCommentBody();
case HtmlTokenizerState.AtTokenAfterRazorCommentBody:
- return AtTokenAfterRazorCommentBody();
+ return AtTokenAfterRazorCommentBody(nextState: StartState);
default:
Debug.Fail("Invalid TokenizerState");
return default(StateResult);
@@ -292,10 +292,10 @@ private enum HtmlTokenizerState
{
Data,
Text,
+ EscapedRazorCommentTransition,
// Razor Comments - need to be the same for HTML and CSharp
AfterRazorCommentTransition = RazorCommentTokenizerState.AfterRazorCommentTransition,
- EscapedRazorCommentTransition = RazorCommentTokenizerState.EscapedRazorCommentTransition,
RazorCommentBody = RazorCommentTokenizerState.RazorCommentBody,
StarAfterRazorCommentBody = RazorCommentTokenizerState.StarAfterRazorCommentBody,
AtTokenAfterRazorCommentBody = RazorCommentTokenizerState.AtTokenAfterRazorCommentBody,
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ITokenizer.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ITokenizer.cs
deleted file mode 100644
index 72e298db467..00000000000
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ITokenizer.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#nullable disable
-
-using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax;
-
-namespace Microsoft.AspNetCore.Razor.Language.Legacy;
-
-internal interface ITokenizer
-{
- SyntaxToken NextToken();
-}
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/NativeCSharpTokenizer.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/NativeCSharpTokenizer.cs
index 1b42a196411..d2cb10739ef 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/NativeCSharpTokenizer.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/NativeCSharpTokenizer.cs
@@ -171,7 +171,7 @@ protected override StateResult Dispatch()
case CSharpTokenizerState.StarAfterRazorCommentBody:
return StarAfterRazorCommentBody();
case CSharpTokenizerState.AtTokenAfterRazorCommentBody:
- return AtTokenAfterRazorCommentBody();
+ return AtTokenAfterRazorCommentBody(nextState: StartState);
default:
Debug.Fail("Invalid TokenizerState");
return default(StateResult);
@@ -782,10 +782,10 @@ private enum CSharpTokenizerState
QuotedCharacterLiteral,
QuotedStringLiteral,
VerbatimStringLiteral,
+ EscapedRazorCommentTransition,
// Razor Comments - need to be the same for HTML and CSharp
AfterRazorCommentTransition = RazorCommentTokenizerState.AfterRazorCommentTransition,
- EscapedRazorCommentTransition = RazorCommentTokenizerState.EscapedRazorCommentTransition,
RazorCommentBody = RazorCommentTokenizerState.RazorCommentBody,
StarAfterRazorCommentBody = RazorCommentTokenizerState.StarAfterRazorCommentBody,
AtTokenAfterRazorCommentBody = RazorCommentTokenizerState.AtTokenAfterRazorCommentBody,
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ParserContext.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ParserContext.cs
index 3cebbf42426..2f7e1453d13 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ParserContext.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ParserContext.cs
@@ -26,6 +26,7 @@ public ParserContext(RazorSourceDocument source, RazorParserOptions options)
ErrorSink = new ErrorSink();
SeenDirectives = new HashSet(StringComparer.Ordinal);
EnableSpanEditHandlers = options.EnableSpanEditHandlers;
+ UseRoslynTokenizer = options.UseRoslynTokenizer;
}
public ErrorSink ErrorSink { get; set; }
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/RazorParser.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/RazorParser.cs
index 5c762cf1c68..4895bab13fb 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/RazorParser.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/RazorParser.cs
@@ -34,8 +34,8 @@ public virtual RazorSyntaxTree Parse(RazorSourceDocument source)
}
var context = new ParserContext(source, Options);
- var codeParser = new CSharpCodeParser(Options.Directives, context);
- var markupParser = new HtmlMarkupParser(context);
+ using var codeParser = new CSharpCodeParser(Options.Directives, context);
+ using var markupParser = new HtmlMarkupParser(context);
codeParser.HtmlParser = markupParser;
markupParser.CodeParser = codeParser;
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/RoslynCSharpTokenizer.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/RoslynCSharpTokenizer.cs
index 8a1336a2183..2fffe074396 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/RoslynCSharpTokenizer.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/RoslynCSharpTokenizer.cs
@@ -1,142 +1,54 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-#nullable disable
-
using System;
using System.Collections.Generic;
-using System.Collections.Frozen;
using System.Diagnostics;
-using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax;
+using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Text;
+using SyntaxToken = Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax.SyntaxToken;
using SyntaxFactory = Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax.SyntaxFactory;
using CSharpSyntaxKind = Microsoft.CodeAnalysis.CSharp.SyntaxKind;
+using CSharpSyntaxToken = Microsoft.CodeAnalysis.SyntaxToken;
+using CSharpSyntaxTriviaList = Microsoft.CodeAnalysis.SyntaxTriviaList;
+using Microsoft.AspNetCore.Razor.PooledObjects;
namespace Microsoft.AspNetCore.Razor.Language.Legacy;
-internal class RoslynCSharpTokenizer : CSharpTokenizer
+#pragma warning disable RSEXPERIMENTAL003 // SyntaxTokenParser is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
+internal sealed class RoslynCSharpTokenizer : CSharpTokenizer
{
- private readonly Dictionary> _operatorHandlers;
-
- private static readonly FrozenDictionary _keywords = (new[] {
- CSharpSyntaxKind.AwaitKeyword,
- CSharpSyntaxKind.AbstractKeyword,
- CSharpSyntaxKind.ByteKeyword,
- CSharpSyntaxKind.ClassKeyword,
- CSharpSyntaxKind.DelegateKeyword,
- CSharpSyntaxKind.EventKeyword,
- CSharpSyntaxKind.FixedKeyword,
- CSharpSyntaxKind.IfKeyword,
- CSharpSyntaxKind.InternalKeyword,
- CSharpSyntaxKind.NewKeyword,
- CSharpSyntaxKind.OverrideKeyword,
- CSharpSyntaxKind.ReadOnlyKeyword,
- CSharpSyntaxKind.ShortKeyword,
- CSharpSyntaxKind.StructKeyword,
- CSharpSyntaxKind.TryKeyword,
- CSharpSyntaxKind.UnsafeKeyword,
- CSharpSyntaxKind.VolatileKeyword,
- CSharpSyntaxKind.AsKeyword,
- CSharpSyntaxKind.DoKeyword,
- CSharpSyntaxKind.IsKeyword,
- CSharpSyntaxKind.ParamsKeyword,
- CSharpSyntaxKind.RefKeyword,
- CSharpSyntaxKind.SwitchKeyword,
- CSharpSyntaxKind.UShortKeyword,
- CSharpSyntaxKind.WhileKeyword,
- CSharpSyntaxKind.CaseKeyword,
- CSharpSyntaxKind.ConstKeyword,
- CSharpSyntaxKind.ExplicitKeyword,
- CSharpSyntaxKind.FloatKeyword,
- CSharpSyntaxKind.NullKeyword,
- CSharpSyntaxKind.SizeOfKeyword,
- CSharpSyntaxKind.TypeOfKeyword,
- CSharpSyntaxKind.ImplicitKeyword,
- CSharpSyntaxKind.PrivateKeyword,
- CSharpSyntaxKind.ThisKeyword,
- CSharpSyntaxKind.UsingKeyword,
- CSharpSyntaxKind.ExternKeyword,
- CSharpSyntaxKind.ReturnKeyword,
- CSharpSyntaxKind.StackAllocKeyword,
- CSharpSyntaxKind.UIntKeyword,
- CSharpSyntaxKind.BaseKeyword,
- CSharpSyntaxKind.CatchKeyword,
- CSharpSyntaxKind.ContinueKeyword,
- CSharpSyntaxKind.DoubleKeyword,
- CSharpSyntaxKind.ForKeyword,
- CSharpSyntaxKind.InKeyword,
- CSharpSyntaxKind.LockKeyword,
- CSharpSyntaxKind.ObjectKeyword,
- CSharpSyntaxKind.ProtectedKeyword,
- CSharpSyntaxKind.StaticKeyword,
- CSharpSyntaxKind.FalseKeyword,
- CSharpSyntaxKind.PublicKeyword,
- CSharpSyntaxKind.SByteKeyword,
- CSharpSyntaxKind.ThrowKeyword,
- CSharpSyntaxKind.VirtualKeyword,
- CSharpSyntaxKind.DecimalKeyword,
- CSharpSyntaxKind.ElseKeyword,
- CSharpSyntaxKind.OperatorKeyword,
- CSharpSyntaxKind.StringKeyword,
- CSharpSyntaxKind.ULongKeyword,
- CSharpSyntaxKind.BoolKeyword,
- CSharpSyntaxKind.CharKeyword,
- CSharpSyntaxKind.DefaultKeyword,
- CSharpSyntaxKind.ForEachKeyword,
- CSharpSyntaxKind.LongKeyword,
- CSharpSyntaxKind.VoidKeyword,
- CSharpSyntaxKind.EnumKeyword,
- CSharpSyntaxKind.FinallyKeyword,
- CSharpSyntaxKind.IntKeyword,
- CSharpSyntaxKind.OutKeyword,
- CSharpSyntaxKind.SealedKeyword,
- CSharpSyntaxKind.TrueKeyword,
- CSharpSyntaxKind.GotoKeyword,
- CSharpSyntaxKind.UncheckedKeyword,
- CSharpSyntaxKind.InterfaceKeyword,
- CSharpSyntaxKind.BreakKeyword,
- CSharpSyntaxKind.CheckedKeyword,
- CSharpSyntaxKind.NamespaceKeyword,
- CSharpSyntaxKind.WhenKeyword,
- CSharpSyntaxKind.WhereKeyword }).ToFrozenDictionary(keySelector: k => SyntaxFacts.GetText(k));
+ private readonly SyntaxTokenParser _roslynTokenParser;
+ ///
+ /// The current trivia enumerator that we're parsing through. This is a tuple of the enumerator and whether it's leading trivia.
+ /// When this is non-null, we're in the state.
+ ///
+ private (CSharpSyntaxTriviaList.Enumerator enumerator, bool isLeading)? _currentCSharpTokenTriviaEnumerator;
+ ///
+ /// Previous result checkpoints that we can reset to. This must be an ordered list
+ /// by position, where the position is the start of the token that was parsed including leading trivia, so that searching
+ /// is correct when performing a reset.
+ ///
+ private readonly List<(int position, SyntaxTokenParser.Result result)> _resultCache = ListPool<(int, SyntaxTokenParser.Result)>.Default.Get();
public RoslynCSharpTokenizer(SeekableTextReader source)
: base(source)
{
base.CurrentState = StartState;
- _operatorHandlers = new Dictionary>()
- {
- { '-', MinusOperator },
- { '<', LessThanOperator },
- { '>', GreaterThanOperator },
- { '&', 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 }
- };
+ // PROTOTYPE
+ _roslynTokenParser = CodeAnalysis.CSharp.SyntaxFactory.CreateTokenParser(source.SourceText, null);
}
- protected override int StartState => (int)CSharpTokenizerState.Data;
+ protected override int StartState => (int)RoslynCSharpTokenizerState.Start;
- private new CSharpTokenizerState? CurrentState => (CSharpTokenizerState?)base.CurrentState;
+ private new RoslynCSharpTokenizerState? CurrentState
+ {
+ get => (RoslynCSharpTokenizerState?)base.CurrentState;
+ set => base.CurrentState = (int?)value;
+ }
public override SyntaxKind RazorCommentKind => SyntaxKind.RazorCommentLiteral;
@@ -144,30 +56,62 @@ public RoslynCSharpTokenizer(SeekableTextReader source)
public override SyntaxKind RazorCommentStarKind => SyntaxKind.RazorCommentStar;
+ internal override void StartingBlock()
+ {
+ _roslynTokenParser.SkipForwardTo(Source.Position);
+ }
+
+ internal override void EndingBlock()
+ {
+ // We should always be transitioning to the other parser in response to content. This either means that the CSharp parser put the token it saw back, meaning that we're
+ // in the Start state, or it means that we'll have parsed a token, and be in the TriviaForCSharpToken state. If we're in the Start state, there's nothing for us to do.
+ // In order to ensure that we properly handle the trailing trivia (because the other parser will handle the trailing trivia on the node we found, if any), we need to
+ // reset back before the start of that node, skip the content, and reset our state back to Start for when we're called back next.
+ if (CurrentState == RoslynCSharpTokenizerState.Start)
+ {
+ return;
+ }
+
+ Debug.Assert(CurrentState == RoslynCSharpTokenizerState.TriviaForCSharpToken, $"Unexpected state: {CurrentState}");
+ Debug.Assert(_currentCSharpTokenTriviaEnumerator is (_, isLeading: false));
+ Debug.Assert(_resultCache.Count > 0);
+
+ var (_, result) = _resultCache[^1];
+ _roslynTokenParser.ResetTo(result);
+ _resultCache.RemoveAt(_resultCache.Count - 1);
+ var lastToken = result.Token;
+ if (lastToken.HasLeadingTrivia)
+ {
+ // If the previous token did indeed have leading trivia, we need to make sure to take it into account so that any preprocessor directives are seen by the
+ // roslyn token parser
+ _ = GetNextResult(NextResultType.LeadingTrivia);
+ }
+
+ _roslynTokenParser.SkipForwardTo(lastToken.Span.End);
+ CurrentState = RoslynCSharpTokenizerState.Start;
+ }
+
protected override StateResult Dispatch()
{
switch (CurrentState)
{
- case CSharpTokenizerState.Data:
- return Data();
- case CSharpTokenizerState.BlockComment:
- return BlockComment();
- case CSharpTokenizerState.QuotedCharacterLiteral:
- return QuotedCharacterLiteral();
- case CSharpTokenizerState.QuotedStringLiteral:
- return QuotedStringLiteral();
- case CSharpTokenizerState.VerbatimStringLiteral:
- return VerbatimStringLiteral();
- case CSharpTokenizerState.AfterRazorCommentTransition:
+ case RoslynCSharpTokenizerState.Start:
+ return Start();
+ case RoslynCSharpTokenizerState.TriviaForCSharpToken:
+ return Trivia();
+ case RoslynCSharpTokenizerState.Token:
+ return Token();
+ case RoslynCSharpTokenizerState.OnRazorCommentStar:
+ return OnRazorCommentStar();
+ case RoslynCSharpTokenizerState.AfterRazorCommentTransition:
return AfterRazorCommentTransition();
- case CSharpTokenizerState.EscapedRazorCommentTransition:
- return EscapedRazorCommentTransition();
- case CSharpTokenizerState.RazorCommentBody:
+ case RoslynCSharpTokenizerState.RazorCommentBody:
return RazorCommentBody();
- case CSharpTokenizerState.StarAfterRazorCommentBody:
+ case RoslynCSharpTokenizerState.StarAfterRazorCommentBody:
return StarAfterRazorCommentBody();
- case CSharpTokenizerState.AtTokenAfterRazorCommentBody:
- return AtTokenAfterRazorCommentBody();
+ case RoslynCSharpTokenizerState.AtTokenAfterRazorCommentBody:
+ Debug.Assert(_currentCSharpTokenTriviaEnumerator is not null);
+ return AtTokenAfterRazorCommentBody(nextState: (int)RoslynCSharpTokenizerState.TriviaForCSharpToken);
default:
Debug.Fail("Invalid TokenizerState");
return default(StateResult);
@@ -177,37 +121,13 @@ protected override StateResult Dispatch()
// Optimize memory allocation by returning constants for the most frequent cases
protected override string GetTokenContent(SyntaxKind type)
{
+ Debug.Assert(type != SyntaxKind.CSharpOperator, "CSharpOperator should be handled by getting the interned text from C#");
var tokenLength = Buffer.Length;
if (tokenLength == 1)
{
switch (type)
{
- case SyntaxKind.IntegerLiteral:
- switch (Buffer[0])
- {
- case '0':
- return "0";
- case '1':
- return "1";
- case '2':
- return "2";
- case '3':
- return "3";
- case '4':
- return "4";
- case '5':
- return "5";
- case '6':
- return "6";
- case '7':
- return "7";
- case '8':
- return "8";
- case '9':
- return "9";
- }
- break;
case SyntaxKind.NewLine:
if (Buffer[0] == '\n')
{
@@ -224,56 +144,26 @@ protected override string GetTokenContent(SyntaxKind type)
return "\t";
}
break;
- case SyntaxKind.Minus:
- return "-";
+ case SyntaxKind.NumericLiteral:
+ Debug.Fail("This should be handled by using the C# lexer's interned string in NumericLiteral()");
+ return base.GetTokenContent(type);
case SyntaxKind.Not:
- return "!";
- case SyntaxKind.Modulo:
- return "%";
- case SyntaxKind.And:
- return "&";
case SyntaxKind.LeftParenthesis:
- return "(";
case SyntaxKind.RightParenthesis:
- return ")";
- case SyntaxKind.Star:
- return "*";
case SyntaxKind.Comma:
- return ",";
case SyntaxKind.Dot:
- return ".";
- case SyntaxKind.Slash:
- return "/";
case SyntaxKind.Colon:
- return ":";
case SyntaxKind.Semicolon:
- return ";";
case SyntaxKind.QuestionMark:
- return "?";
case SyntaxKind.RightBracket:
- return "]";
case SyntaxKind.LeftBracket:
- return "[";
- case SyntaxKind.Xor:
- return "^";
case SyntaxKind.LeftBrace:
- return "{";
- case SyntaxKind.Or:
- return "|";
case SyntaxKind.RightBrace:
- return "}";
- case SyntaxKind.Tilde:
- return "~";
- case SyntaxKind.Plus:
- return "+";
case SyntaxKind.LessThan:
- return "<";
case SyntaxKind.Assign:
- return "=";
case SyntaxKind.GreaterThan:
- return ">";
- case SyntaxKind.Hash:
- return "#";
+ Debug.Fail("This should be handled by using the C# lexer's interned string in Operator()");
+ return base.GetTokenContent(type);
case SyntaxKind.Transition:
return "@";
@@ -285,64 +175,10 @@ protected override string GetTokenContent(SyntaxKind type)
{
case SyntaxKind.NewLine:
return "\r\n";
- case SyntaxKind.Arrow:
- return "->";
- case SyntaxKind.Decrement:
- return "--";
- case SyntaxKind.MinusAssign:
- return "-=";
- case SyntaxKind.NotEqual:
- return "!=";
- case SyntaxKind.ModuloAssign:
- return "%=";
- case SyntaxKind.AndAssign:
- return "&=";
- case SyntaxKind.DoubleAnd:
- return "&&";
- case SyntaxKind.MultiplyAssign:
- return "*=";
- case SyntaxKind.DivideAssign:
- return "/=";
case SyntaxKind.DoubleColon:
- return "::";
- case SyntaxKind.NullCoalesce:
- return "??";
- case SyntaxKind.XorAssign:
- return "^=";
- case SyntaxKind.OrAssign:
- return "|=";
- case SyntaxKind.DoubleOr:
- return "||";
- case SyntaxKind.PlusAssign:
- return "+=";
- case SyntaxKind.Increment:
- return "++";
- case SyntaxKind.LessThanEqual:
- return "<=";
- case SyntaxKind.LeftShift:
- return "<<";
case SyntaxKind.Equals:
- return "==";
- case SyntaxKind.GreaterThanEqual:
- if (Buffer[0] == '=')
- {
- return "=>";
- }
- return ">=";
- case SyntaxKind.RightShift:
- return ">>";
-
-
- }
- }
- else if (tokenLength == 3)
- {
- switch (type)
- {
- case SyntaxKind.LeftShiftAssign:
- return "<<=";
- case SyntaxKind.RightShiftAssign:
- return ">>=";
+ Debug.Fail("This should be handled by using the C# lexer's interned string in Operator()");
+ return base.GetTokenContent(type);
}
}
@@ -354,24 +190,28 @@ protected override SyntaxToken CreateToken(string content, SyntaxKind kind, Razo
return SyntaxFactory.Token(kind, content, errors);
}
- private StateResult Data()
+ private StateResult Start()
{
- if (SyntaxFacts.IsNewLine(CurrentCharacter))
+ var leadingTriviaResult = GetNextResult(NextResultType.LeadingTrivia);
+ Debug.Assert(leadingTriviaResult.ContextualKind == CSharpSyntaxKind.None);
+ Debug.Assert(leadingTriviaResult.Token.IsKind(CSharpSyntaxKind.None));
+
+ if (leadingTriviaResult.Token.HasLeadingTrivia)
{
- // CSharp Spec §2.3.1
- var checkTwoCharNewline = CurrentCharacter == '\r';
- TakeCurrent();
- if (checkTwoCharNewline && CurrentCharacter == '\n')
- {
- TakeCurrent();
- }
- return Stay(EndToken(SyntaxKind.NewLine));
+ _currentCSharpTokenTriviaEnumerator = (leadingTriviaResult.Token.LeadingTrivia.GetEnumerator(), isLeading: true);
+ return Transition(RoslynCSharpTokenizerState.TriviaForCSharpToken, null);
+ }
+ else
+ {
+ return Transition(RoslynCSharpTokenizerState.Token, null);
}
- else if (SyntaxFacts.IsWhitespace(CurrentCharacter))
+ }
+
+ private StateResult Token()
+ {
+ if (SyntaxFacts.IsNewLine(CurrentCharacter) || SyntaxFacts.IsWhitespace(CurrentCharacter))
{
- // CSharp Spec §2.3.3
- TakeUntil(c => !SyntaxFacts.IsWhitespace(c));
- return Stay(EndToken(SyntaxKind.Whitespace));
+ Assumed.Unreachable();
}
else if (SyntaxFacts.IsIdentifierStartCharacter(CurrentCharacter))
{
@@ -386,402 +226,440 @@ private StateResult Data()
case '@':
return AtToken();
case '\'':
- TakeCurrent();
- return Transition(CSharpTokenizerState.QuotedCharacterLiteral);
+ return TokenizedExpectedStringOrCharacterLiteral(StringOrCharacterKind.Character);
case '"':
- TakeCurrent();
- return Transition(CSharpTokenizerState.QuotedStringLiteral);
- case '.':
- if (char.IsDigit(Peek()))
- {
- return RealLiteral();
- }
- return Stay(Single(SyntaxKind.Dot));
- case '/':
- TakeCurrent();
- if (CurrentCharacter == '/')
- {
- TakeCurrent();
- return SingleLineComment();
- }
- else if (CurrentCharacter == '*')
+ return TokenizedExpectedStringOrCharacterLiteral(StringOrCharacterKind.String_Or_Raw_String);
+ case '$':
+ switch (Peek())
{
- TakeCurrent();
- return Transition(CSharpTokenizerState.BlockComment);
+ case '"' or '$':
+ return TokenizedExpectedStringOrCharacterLiteral(StringOrCharacterKind.Interpolated_Or_Raw_Interpolated_String);
+ case '@' when Peek(2) == '"':
+ return TokenizedExpectedStringOrCharacterLiteral(StringOrCharacterKind.Verbatim_Interpolated_Dollar_First_String);
}
- else if (CurrentCharacter == '=')
- {
- TakeCurrent();
- return Stay(EndToken(SyntaxKind.DivideAssign));
- }
- else
+ goto default;
+ case '.':
+ if (char.IsDigit(Peek()))
{
- return Stay(EndToken(SyntaxKind.Slash));
+ return NumericLiteral();
}
+ return Operator();
+ case '/' when Peek() is '/' or '*':
+ return Assumed.Unreachable();
default:
- return Stay(EndToken(Operator()));
+ return Operator();
}
}
private StateResult AtToken()
{
- TakeCurrent();
- if (CurrentCharacter == '"')
- {
- TakeCurrent();
- return Transition(CSharpTokenizerState.VerbatimStringLiteral);
- }
- else if (CurrentCharacter == '*')
- {
- return Transition(
- CSharpTokenizerState.AfterRazorCommentTransition,
- EndToken(SyntaxKind.RazorCommentTransition));
- }
- else if (CurrentCharacter == '@')
- {
- // Could be escaped comment transition
- return Transition(
- CSharpTokenizerState.EscapedRazorCommentTransition,
- EndToken(SyntaxKind.Transition));
- }
-
- return Stay(EndToken(SyntaxKind.Transition));
- }
-
- private StateResult EscapedRazorCommentTransition()
- {
- TakeCurrent();
- return Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.Transition));
- }
-
- private SyntaxKind Operator()
- {
- var first = CurrentCharacter;
- TakeCurrent();
- Func handler;
- if (_operatorHandlers.TryGetValue(first, out handler))
+ AssertCurrent('@');
+ switch (Peek())
{
- return handler();
+ case '"':
+ return TokenizedExpectedStringOrCharacterLiteral(StringOrCharacterKind.Verbatim_String);
+ case '$' when Peek(2) is '"':
+ return TokenizedExpectedStringOrCharacterLiteral(StringOrCharacterKind.Verbatim_Interpolated_At_First_String);
+ case '*':
+ return Assumed.Unreachable();
+ case '@':
+ // Escaped razor transition. Likely will error in the parser.
+ AddResetPoint();
+ TakeCurrent();
+ _roslynTokenParser.SkipForwardTo(Source.Position);
+ AssertCurrent('@');
+ return Transition(RoslynCSharpTokenizerState.Token, EndToken(SyntaxKind.Transition));
+ default:
+ // Either a standard razor transition or a C# identifier. The parser will take care of stitching together the transition and the
+ // identifier if it's the latter case.
+ AddResetPoint();
+ TakeCurrent();
+ _roslynTokenParser.SkipForwardTo(Source.Position);
+ var trailingTrivia = GetNextResult(NextResultType.TrailingTrivia);
+ _currentCSharpTokenTriviaEnumerator = (trailingTrivia.Token.TrailingTrivia.GetEnumerator(), isLeading: false);
+ return Transition(RoslynCSharpTokenizerState.TriviaForCSharpToken, EndToken(SyntaxKind.Transition));
}
- return SyntaxKind.Marker;
}
- private SyntaxKind LessThanOperator()
+ private StateResult Operator()
{
- if (CurrentCharacter == '=')
- {
- TakeCurrent();
- return SyntaxKind.LessThanEqual;
- }
- return SyntaxKind.LessThan;
- }
+ var result = GetNextResult(NextResultType.Token);
+ var token = result.Token;
+
+ AdvancePastToken(token);
+ string content;
+ var kind = token.RawKind switch
+ {
+ (int)CSharpSyntaxKind.ExclamationToken => SyntaxKind.Not,
+ (int)CSharpSyntaxKind.OpenParenToken => SyntaxKind.LeftParenthesis,
+ (int)CSharpSyntaxKind.CloseParenToken => SyntaxKind.RightParenthesis,
+ (int)CSharpSyntaxKind.CommaToken => SyntaxKind.Comma,
+ (int)CSharpSyntaxKind.DotToken => SyntaxKind.Dot,
+ (int)CSharpSyntaxKind.ColonColonToken => SyntaxKind.DoubleColon,
+ (int)CSharpSyntaxKind.ColonToken => SyntaxKind.Colon,
+ (int)CSharpSyntaxKind.OpenBraceToken => SyntaxKind.LeftBrace,
+ (int)CSharpSyntaxKind.CloseBraceToken => SyntaxKind.RightBrace,
+ (int)CSharpSyntaxKind.LessThanToken => SyntaxKind.LessThan,
+ (int)CSharpSyntaxKind.GreaterThanToken => SyntaxKind.GreaterThan,
+ (int)CSharpSyntaxKind.EqualsToken => SyntaxKind.Assign,
+ (int)CSharpSyntaxKind.OpenBracketToken => SyntaxKind.LeftBracket,
+ (int)CSharpSyntaxKind.CloseBracketToken => SyntaxKind.RightBracket,
+ (int)CSharpSyntaxKind.QuestionToken => SyntaxKind.QuestionMark,
+ (int)CSharpSyntaxKind.SemicolonToken => SyntaxKind.Semicolon,
+ <= (int)CSharpSyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken and >= (int)CSharpSyntaxKind.TildeToken => SyntaxKind.CSharpOperator,
+ _ => SyntaxKind.Marker,
+ };
- private SyntaxKind GreaterThanOperator()
- {
- if (CurrentCharacter == '=')
- {
- TakeCurrent();
- return SyntaxKind.GreaterThanEqual;
- }
- return SyntaxKind.GreaterThan;
- }
+ // Use the already-interned string from the C# lexer, rather than realizing the buffer, to ensure that
+ // we don't allocate a new string for every operator token.
+ content = kind == SyntaxKind.Marker ? Buffer.ToString() : token.ValueText;
+ Debug.Assert(content == Buffer.ToString());
+ Buffer.Clear();
- private SyntaxKind MinusOperator()
- {
- if (CurrentCharacter == '>')
- {
- TakeCurrent();
- return SyntaxKind.Arrow;
- }
- else if (CurrentCharacter == '-')
- {
- TakeCurrent();
- return SyntaxKind.Decrement;
- }
- else if (CurrentCharacter == '=')
- {
- TakeCurrent();
- return SyntaxKind.MinusAssign;
- }
- return SyntaxKind.Minus;
+ _currentCSharpTokenTriviaEnumerator = (token.TrailingTrivia.GetEnumerator(), isLeading: false);
+ return Transition(RoslynCSharpTokenizerState.TriviaForCSharpToken, EndToken(content, kind));
}
- private Func CreateTwoCharOperatorHandler(SyntaxKind typeIfOnlyFirst, char second, SyntaxKind typeIfBoth)
+ private StateResult TokenizedExpectedStringOrCharacterLiteral(StringOrCharacterKind expectedStringKind)
{
- return () =>
- {
- if (CurrentCharacter == second)
- {
- TakeCurrent();
- return typeIfBoth;
- }
- return typeIfOnlyFirst;
+ var result = GetNextResult(NextResultType.Token);
+ var csharpToken = result.Token;
+ (string expectedPrefix, string expectedPostfix, bool lookForPrePostFix) = expectedStringKind switch
+ {
+ StringOrCharacterKind.Character => ("'", "'", false),
+ StringOrCharacterKind.Verbatim_String => ("@\"", "\"", false),
+ StringOrCharacterKind.Verbatim_Interpolated_At_First_String => ("@$\"", "\"", false),
+ StringOrCharacterKind.Verbatim_Interpolated_Dollar_First_String => ("$@\"", "\"", false),
+ StringOrCharacterKind.String_Or_Raw_String when csharpToken.Text is "\"\"" => ("\"", "\"", false),
+ StringOrCharacterKind.Interpolated_Or_Raw_Interpolated_String when csharpToken.Text is "$\"\"" => ("$\"", "\"", false),
+ StringOrCharacterKind.String_Or_Raw_String or StringOrCharacterKind.Interpolated_Or_Raw_Interpolated_String => ("", "", true),
+ _ => throw new InvalidOperationException($"Unexpected expectedStringKind: {expectedStringKind}."),
};
- }
- private Func CreateTwoCharOperatorHandler(SyntaxKind typeIfOnlyFirst, char option1, SyntaxKind typeIfOption1, char option2, SyntaxKind typeIfOption2)
- {
- return () =>
+ for (var finalPosition = Source.Position + csharpToken.Span.Length; Source.Position < finalPosition;)
{
- if (CurrentCharacter == option1)
- {
- TakeCurrent();
- return typeIfOption1;
- }
- else if (CurrentCharacter == option2)
+ if (lookForPrePostFix)
{
- TakeCurrent();
- return typeIfOption2;
+ lookForPrePostFix = handleCurrentCharacterPrefixPostfix();
}
- return typeIfOnlyFirst;
- };
- }
- private StateResult VerbatimStringLiteral()
- {
- TakeUntil(c => c == '"');
- if (CurrentCharacter == '"')
- {
TakeCurrent();
- if (CurrentCharacter == '"')
- {
- TakeCurrent();
- // Stay in the literal, this is an escaped "
- return Stay();
- }
}
- else if (EndOfFile)
+
+ // If the token is the expected kind and is only the expected prefix or doesn't have the expected postfix, then it's unterminated.
+ // This is a case like `"test` (which doesn't end in the expected postfix), or `"` (which ends in the expected postfix, but
+ // exactly matches the expected prefix).
+ if (lookForPrePostFix || csharpToken.Text == expectedPrefix || !csharpToken.Text.EndsWith(expectedPostfix!, StringComparison.Ordinal))
{
CurrentErrors.Add(
RazorDiagnosticFactory.CreateParsing_UnterminatedStringLiteral(
- new SourceSpan(CurrentStart, contentLength: 1 /* end of file */)));
+ new SourceSpan(CurrentStart, contentLength: expectedPrefix?.Length ?? 0 /* " */)));
}
- return Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.StringLiteral));
- }
- private StateResult QuotedCharacterLiteral() => QuotedLiteral('\'', IsEndQuotedCharacterLiteral, SyntaxKind.CharacterLiteral);
+ _currentCSharpTokenTriviaEnumerator = (csharpToken.TrailingTrivia.GetEnumerator(), isLeading: false);
+ var razorTokenKind = expectedStringKind == StringOrCharacterKind.Character ? SyntaxKind.CharacterLiteral : SyntaxKind.StringLiteral;
+ return Transition(RoslynCSharpTokenizerState.TriviaForCSharpToken, EndToken(razorTokenKind));
- private StateResult QuotedStringLiteral() => QuotedLiteral('\"', IsEndQuotedStringLiteral, SyntaxKind.StringLiteral);
+ bool handleCurrentCharacterPrefixPostfix()
+ {
+ switch (expectedStringKind)
+ {
+ case StringOrCharacterKind.String_Or_Raw_String:
+ // We can either have a normal string or a raw string. Add to the prefix/postfix until we find a non-" character
+ if (CurrentCharacter != '"')
+ {
+ Debug.Assert(expectedPrefix != null);
+ Debug.Assert(expectedPostfix != null);
+ Debug.Assert(expectedPrefix == expectedPostfix);
+ return false;
+ }
- private static readonly Func IsEndQuotedCharacterLiteral = static (c) => c == '\\' || c == '\'' || SyntaxFacts.IsNewLine(c);
- private static readonly Func IsEndQuotedStringLiteral = static (c) => c == '\\' || c == '\"' || SyntaxFacts.IsNewLine(c);
+ expectedPrefix += '"';
+ expectedPostfix += '"';
+ return true;
- private StateResult QuotedLiteral(char quote, Func isEndQuotedLiteral, SyntaxKind literalType)
- {
- TakeUntil(isEndQuotedLiteral);
- if (CurrentCharacter == '\\')
- {
- TakeCurrent(); // Take the '\'
+ case StringOrCharacterKind.Interpolated_Or_Raw_Interpolated_String:
+ // Start with the leading $'s
+ if (expectedPrefix is "" or [.., '$'])
+ {
+ if (CurrentCharacter == '$')
+ {
+ expectedPrefix += '$';
+ return true;
+ }
+ else if (CurrentCharacter == '"')
+ {
+ expectedPrefix += '"';
+ expectedPostfix += '"';
+ return true;
+ }
+ else
+ {
+ // We expect roslyn to have ended parsing, so we should never get here
+ return Assumed.Unreachable();
+ }
+ }
- // If the next char is the same quote that started this
- if (CurrentCharacter == quote || CurrentCharacter == '\\')
- {
- TakeCurrent(); // Take it so that we don't prematurely end the literal.
+ Debug.Assert(expectedPrefix[^1] == '"');
+ if (CurrentCharacter == '"')
+ {
+ expectedPrefix += '"';
+ expectedPostfix += '"';
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+
+ case StringOrCharacterKind.Character:
+ case StringOrCharacterKind.Verbatim_String:
+ case StringOrCharacterKind.Verbatim_Interpolated_At_First_String:
+ case StringOrCharacterKind.Verbatim_Interpolated_Dollar_First_String:
+ default:
+ return Assumed.Unreachable();
}
- return Stay();
}
- else if (EndOfFile || SyntaxFacts.IsNewLine(CurrentCharacter))
+ }
+
+
+ private StateResult Trivia()
+ {
+ Debug.Assert(_currentCSharpTokenTriviaEnumerator is not null);
+ var (triviaEnumerator, isLeading) = _currentCSharpTokenTriviaEnumerator.Value;
+
+ if (!triviaEnumerator.MoveNext())
{
- CurrentErrors.Add(
- RazorDiagnosticFactory.CreateParsing_UnterminatedStringLiteral(
- new SourceSpan(CurrentStart, contentLength: 1 /* " */)));
+ _currentCSharpTokenTriviaEnumerator = null;
+ return Transition(isLeading ? RoslynCSharpTokenizerState.Token : RoslynCSharpTokenizerState.Start, null);
}
- else
+
+ // Need to make sure the class state is correct, since structs are copied
+ _currentCSharpTokenTriviaEnumerator = (triviaEnumerator, isLeading);
+
+ var trivia = triviaEnumerator.Current;
+ var triviaString = trivia.ToFullString();
+
+ // We handle razor comments with dedicated nodes
+ if (trivia.IsKind(CSharpSyntaxKind.MultiLineCommentTrivia) && triviaString.StartsWith("@*", StringComparison.Ordinal))
{
- TakeCurrent(); // No-op if at EOF
+ Debug.Assert(CurrentCharacter == '@');
+ TakeCurrent();
+
+ return Transition(
+ RoslynCSharpTokenizerState.OnRazorCommentStar,
+ EndToken(SyntaxKind.RazorCommentTransition));
}
- return Transition(CSharpTokenizerState.Data, EndToken(literalType));
- }
- // CSharp Spec §2.3.2
- private StateResult BlockComment()
- {
- TakeUntil(c => c == '*');
- if (EndOfFile)
+ // Use FullSpan here because doc comment trivias exclude the leading `///` or `/**` and the trailing `*/`
+ AdvancePastSpan(trivia.FullSpan);
+
+ if (EndOfFile
+ && trivia.Kind() is CSharpSyntaxKind.MultiLineCommentTrivia or CSharpSyntaxKind.MultiLineDocumentationCommentTrivia
+ && !triviaString.EndsWith("*/", StringComparison.Ordinal))
{
CurrentErrors.Add(
RazorDiagnosticFactory.CreateParsing_BlockCommentNotTerminated(
new SourceSpan(CurrentStart, contentLength: 1 /* end of file */)));
-
- return Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.CSharpComment));
}
- if (CurrentCharacter == '*')
+
+ // PROTOTYPE: Handle preprocessor directives
+ var tokenType = trivia.Kind() switch
{
- TakeCurrent();
- if (CurrentCharacter == '/')
- {
- TakeCurrent();
- return Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.CSharpComment));
- }
- }
- return Stay();
+ CSharpSyntaxKind.WhitespaceTrivia => SyntaxKind.Whitespace,
+ CSharpSyntaxKind.EndOfLineTrivia => SyntaxKind.NewLine,
+ CSharpSyntaxKind.SingleLineCommentTrivia or CSharpSyntaxKind.MultiLineCommentTrivia or CSharpSyntaxKind.MultiLineDocumentationCommentTrivia or CSharpSyntaxKind.SingleLineDocumentationCommentTrivia => SyntaxKind.CSharpComment,
+ var kind => throw new InvalidOperationException($"Unexpected trivia kind: {kind}."),
+ };
+
+ return Stay(EndToken(tokenType));
}
- // CSharp Spec §2.3.2
- private StateResult SingleLineComment()
+ private StateResult OnRazorCommentStar()
{
- TakeUntil(c => SyntaxFacts.IsNewLine(c));
- return Stay(EndToken(SyntaxKind.CSharpComment));
+ AssertCurrent('*');
+ TakeCurrent();
+
+ return Transition(
+ RoslynCSharpTokenizerState.RazorCommentBody,
+ EndToken(SyntaxKind.RazorCommentStar));
}
// CSharp Spec §2.4.4
private StateResult NumericLiteral()
{
- if (TakeAll("0x", caseSensitive: true))
- {
- return HexLiteral();
- }
- else
- {
- return DecimalLiteral();
- }
- }
+ var result = GetNextResult(NextResultType.Token);
+ var csharpToken = result.Token;
+ AdvancePastToken(csharpToken);
- private StateResult HexLiteral()
- {
- TakeUntil(c => !IsHexDigit(c));
- TakeIntegerSuffix();
- return Stay(EndToken(SyntaxKind.IntegerLiteral));
+ Buffer.Clear();
+ _currentCSharpTokenTriviaEnumerator = (csharpToken.TrailingTrivia.GetEnumerator(), isLeading: false);
+ return Transition(RoslynCSharpTokenizerState.TriviaForCSharpToken, EndToken(csharpToken.Text, SyntaxKind.NumericLiteral));
}
- private StateResult DecimalLiteral()
+ private StateResult Identifier()
{
- TakeUntil(c => !Char.IsDigit(c));
- if (CurrentCharacter == '.' && Char.IsDigit(Peek()))
- {
- return RealLiteral();
- }
- else if (IsRealLiteralSuffix(CurrentCharacter) ||
- CurrentCharacter == 'E' || CurrentCharacter == 'e')
- {
- return RealLiteralExponentPart();
- }
- else
+ var result = GetNextResult(NextResultType.Token);
+ var csharpToken = result.Token;
+ AdvancePastToken(csharpToken);
+
+ var type = SyntaxKind.Identifier;
+ if (!csharpToken.IsKind(CSharpSyntaxKind.IdentifierToken) || result.ContextualKind is not (CSharpSyntaxKind.None or CSharpSyntaxKind.IdentifierToken))
{
- TakeIntegerSuffix();
- return Stay(EndToken(SyntaxKind.IntegerLiteral));
+ type = SyntaxKind.Keyword;
}
+
+ var token = EndToken(csharpToken.Text, type);
+
+ Buffer.Clear();
+ _currentCSharpTokenTriviaEnumerator = (csharpToken.TrailingTrivia.GetEnumerator(), isLeading: false);
+ return Transition(RoslynCSharpTokenizerState.TriviaForCSharpToken, token);
}
- private StateResult RealLiteralExponentPart()
+ private void AdvancePastToken(CSharpSyntaxToken csharpToken)
{
- if (CurrentCharacter == 'E' || CurrentCharacter == 'e')
- {
- TakeCurrent();
- if (CurrentCharacter == '+' || CurrentCharacter == '-')
- {
- TakeCurrent();
- }
- TakeUntil(c => !Char.IsDigit(c));
- }
- if (IsRealLiteralSuffix(CurrentCharacter))
+ // Don't include trailing trivia; we handle that differently than Roslyn
+ AdvancePastSpan(csharpToken.Span);
+ }
+
+ private void AdvancePastSpan(TextSpan span)
+ {
+ var finalPosition = Source.Position + span.Length;
+
+ for (; Source.Position < finalPosition;)
{
TakeCurrent();
}
- return Stay(EndToken(SyntaxKind.RealLiteral));
}
- // CSharp Spec §2.4.4.3
- private StateResult RealLiteral()
+ private StateResult Transition(RoslynCSharpTokenizerState state, SyntaxToken? result)
{
- AssertCurrent('.');
- TakeCurrent();
- Debug.Assert(Char.IsDigit(CurrentCharacter));
- TakeUntil(c => !Char.IsDigit(c));
- return RealLiteralExponentPart();
+ return Transition((int)state, result);
}
- private void TakeIntegerSuffix()
+ internal override CSharpSyntaxKind? GetTokenKeyword(SyntaxToken token)
{
- if (Char.ToLowerInvariant(CurrentCharacter) == 'u')
- {
- TakeCurrent();
- if (Char.ToLowerInvariant(CurrentCharacter) == 'l')
- {
- TakeCurrent();
- }
- }
- else if (Char.ToLowerInvariant(CurrentCharacter) == 'l')
+ if (token is null)
{
- TakeCurrent();
- if (Char.ToLowerInvariant(CurrentCharacter) == 'u')
- {
- TakeCurrent();
- }
+ return CSharpSyntaxKind.None;
}
+
+ var content = token.Content;
+ return SyntaxFacts.GetKeywordKind(content) is var kind and not CSharpSyntaxKind.None
+ ? kind
+ : SyntaxFacts.GetContextualKeywordKind(content);
}
- // CSharp Spec §2.4.2
- private StateResult Identifier()
+ private SyntaxTokenParser.Result GetNextResult(NextResultType expectedType)
{
- Debug.Assert(SyntaxFacts.IsIdentifierStartCharacter(CurrentCharacter));
- TakeCurrent();
- TakeUntil(c => !SyntaxFacts.IsIdentifierPartCharacter(c));
- SyntaxToken token = null;
- if (HaveContent)
+ var nextResult = expectedType switch
{
- var type = SyntaxKind.Identifier;
- var tokenContent = Buffer.ToString();
- if (_keywords.TryGetValue(tokenContent, value: out _))
- {
- type = SyntaxKind.Keyword;
- }
+ NextResultType.LeadingTrivia => _roslynTokenParser.ParseLeadingTrivia(),
+ NextResultType.Token => _roslynTokenParser.ParseNextToken(),
+ NextResultType.TrailingTrivia => _roslynTokenParser.ParseTrailingTrivia(),
+ _ => Assumed.Unreachable()
+ };
- token = SyntaxFactory.Token(type, tokenContent);
+ Debug.Assert(_resultCache.All(r => r.position <= nextResult.Token.FullSpan.Start));
- Buffer.Clear();
- CurrentErrors.Clear();
+ if (_resultCache.Count > 0 && _resultCache[^1].position == nextResult.Token.FullSpan.Start)
+ {
+ // This can happen when there was no leading or trailing trivia for this token. We don't need to maintain both the previous
+ // result and the current result, as the current result fully subsumes it.
+ Debug.Assert(_resultCache[^1].result is { Token.FullSpan.Length: 0 });
+ Debug.Assert(!nextResult.Token.HasLeadingTrivia);
+ _resultCache[^1] = (nextResult.Token.FullSpan.Start, nextResult);
+ }
+ else
+ {
+ _resultCache.Add((nextResult.Token.FullSpan.Start, nextResult));
}
- return Stay(token);
+ return nextResult;
}
- private StateResult Transition(CSharpTokenizerState state)
+ private void AddResetPoint()
{
- return Transition((int)state, result: null);
+ // We want to make it easy to reset the tokenizer back to just before this token; we can do that very simply by trying to parse
+ // leading trivia, which gives us a reset point. We know that we can't have any leading trivia, since we're on an `@` character.
+ var nextResult = GetNextResult(NextResultType.LeadingTrivia);
+ Debug.Assert(nextResult.Token.IsKind(CSharpSyntaxKind.None));
+ Debug.Assert(nextResult.Token.FullSpan.Length == 0);
}
- private StateResult Transition(CSharpTokenizerState state, SyntaxToken result)
+ public override void Reset(int position)
{
- return Transition((int)state, result);
+ // Most common reset point is the last parsed token, so just try that first.
+ Debug.Assert(_resultCache.Count > 0);
+
+ // We always walk backwards from the current position, rather than doing a binary search, because the common pattern in the parser is
+ // to put tokens back in the order they were returned. This means that the most common reset point is the last token that was parsed.
+ // If this ever changes, we can consider doing a binary search at that point.
+ for (var i = _resultCache.Count - 1; i >= 0; i--)
+ {
+ var (currentPosition, currentResult) = _resultCache[i];
+ if (currentPosition == position)
+ {
+ // We found an exact match, so we can reset to it directly.
+ _roslynTokenParser.ResetTo(currentResult);
+ _resultCache.RemoveAt(i);
+ base.CurrentState = (int)RoslynCSharpTokenizerState.Start;
+ return;
+ }
+ else if (currentPosition < position)
+ {
+ // Reset to the one before reset point, then skip forward
+ // We don't want to actually remove the result from the cache in this point: the parser could later ask to reset further back in this same result. This mostly happens for trivia, where the
+ // parser may ask to put multiple tokens back, each part of the same roslyn trivia piece. However, it is not _only_ for trivia, so we can't assert that. The parser may decide, for example,
+ // to split the @ from a token, reset the tokenizer after the @, and then keep going.
+ _roslynTokenParser.ResetTo(currentResult);
+ _roslynTokenParser.SkipForwardTo(position);
+ base.CurrentState = (int)RoslynCSharpTokenizerState.Start;
+ return;
+ }
+ else
+ {
+ // We know we're not going to be interested in this reset point anymore, so we can remove it.
+ Debug.Assert(currentPosition > position);
+ _resultCache.RemoveAt(i);
+ }
+ }
}
- private static bool IsRealLiteralSuffix(char character)
+ public override void Dispose()
{
- return character == 'F' ||
- character == 'f' ||
- character == 'D' ||
- character == 'd' ||
- character == 'M' ||
- character == 'm';
+ base.Dispose();
+ _roslynTokenParser.Dispose();
+ ListPool<(int, SyntaxTokenParser.Result)>.Default.Return(_resultCache);
}
- private static bool IsHexDigit(char value)
+ private enum NextResultType
{
- return (value >= '0' && value <= '9') || (value >= 'A' && value <= 'F') || (value >= 'a' && value <= 'f');
+ LeadingTrivia,
+ Token,
+ TrailingTrivia,
}
- internal override CSharpSyntaxKind? GetTokenKeyword(SyntaxToken token)
+ private enum StringOrCharacterKind
{
- if (token != null && _keywords.TryGetValue(token.Content, out var keyword))
- {
- return keyword;
- }
-
- return null;
+ Character,
+ String_Or_Raw_String,
+ Interpolated_Or_Raw_Interpolated_String,
+ Verbatim_String,
+ Verbatim_Interpolated_At_First_String,
+ Verbatim_Interpolated_Dollar_First_String,
+ Verbatim_Interpolated_String,
}
- private enum CSharpTokenizerState
+ private enum RoslynCSharpTokenizerState
{
- Data,
- BlockComment,
- QuotedCharacterLiteral,
- QuotedStringLiteral,
- VerbatimStringLiteral,
+ Start,
+ Token,
+ TriviaForCSharpToken,
// Razor Comments - need to be the same for HTML and CSharp
+ OnRazorCommentStar,
AfterRazorCommentTransition = RazorCommentTokenizerState.AfterRazorCommentTransition,
- EscapedRazorCommentTransition = RazorCommentTokenizerState.EscapedRazorCommentTransition,
RazorCommentBody = RazorCommentTokenizerState.RazorCommentBody,
StarAfterRazorCommentBody = RazorCommentTokenizerState.StarAfterRazorCommentBody,
AtTokenAfterRazorCommentBody = RazorCommentTokenizerState.AtTokenAfterRazorCommentBody,
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/Tokenizer.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/Tokenizer.cs
index 8bddac447d8..66188756534 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/Tokenizer.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/Tokenizer.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-#nullable disable
-
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -11,7 +9,7 @@
namespace Microsoft.AspNetCore.Razor.Language.Legacy;
-internal abstract class Tokenizer : ITokenizer
+internal abstract class Tokenizer : IDisposable
{
protected Tokenizer(SeekableTextReader source)
{
@@ -32,7 +30,7 @@ protected Tokenizer(SeekableTextReader source)
protected int? CurrentState { get; set; }
- protected SyntaxToken CurrentSyntaxToken { get; private set; }
+ protected SyntaxToken? CurrentSyntaxToken { get; private set; }
public SeekableTextReader Source { get; private set; }
@@ -69,12 +67,11 @@ protected char CurrentCharacter
protected abstract StateResult Dispatch();
- SyntaxToken ITokenizer.NextToken()
- {
- return NextToken();
- }
+ internal virtual void StartingBlock() { }
- public virtual SyntaxToken NextToken()
+ internal virtual void EndingBlock() { }
+
+ public virtual SyntaxToken? NextToken()
{
// Post-Condition: Buffer should be empty at the start of Next()
Debug.Assert(Buffer.Length == 0);
@@ -96,7 +93,7 @@ public virtual SyntaxToken NextToken()
return token;
}
- protected virtual SyntaxToken Turn()
+ protected virtual SyntaxToken? Turn()
{
if (CurrentState != null)
{
@@ -121,7 +118,7 @@ protected virtual SyntaxToken Turn()
return default(SyntaxToken);
}
- public void Reset()
+ public virtual void Reset(int position)
{
CurrentState = StartState;
}
@@ -150,7 +147,7 @@ protected StateResult Transition(int state)
/// Returns a result containing the specified output and indicating that the next call to
/// should invoke the provided state.
///
- protected StateResult Transition(int state, SyntaxToken result)
+ protected StateResult Transition(int state, SyntaxToken? result)
{
return new StateResult(state, result);
}
@@ -160,7 +157,7 @@ protected StateResult Transition(RazorCommentTokenizerState state)
return new StateResult((int)state, result: null);
}
- protected StateResult Transition(RazorCommentTokenizerState state, SyntaxToken result)
+ protected StateResult Transition(RazorCommentTokenizerState state, SyntaxToken? result)
{
return new StateResult((int)state, result);
}
@@ -181,12 +178,12 @@ protected StateResult Stay()
/// Returns a result containing the specified output and indicating that the next call to
/// should re-invoke the current state.
///
- protected StateResult Stay(SyntaxToken result)
+ protected StateResult Stay(SyntaxToken? result)
{
return new StateResult(CurrentState, result);
}
- protected SyntaxToken Single(SyntaxKind type)
+ protected SyntaxToken? Single(SyntaxKind type)
{
TakeCurrent();
return EndToken(type);
@@ -200,10 +197,24 @@ protected void StartToken()
CurrentStart = CurrentLocation;
}
- protected SyntaxToken EndToken(SyntaxKind type)
+ protected SyntaxToken? EndToken(SyntaxKind type)
{
- SyntaxToken token = null;
+ SyntaxToken? token = null;
if (HaveContent)
+ {
+ var tokenContent = GetTokenContent(type);
+ Debug.Assert(tokenContent == Buffer.ToString(), $"Token content mismatch: '{tokenContent}' != '{Buffer}'. Token Type: '{type}'.");
+ token = EndToken(tokenContent, type);
+ Buffer.Clear();
+ }
+
+ return token;
+ }
+
+ protected SyntaxToken? EndToken(string tokenContent, SyntaxKind type)
+ {
+ SyntaxToken? token = null;
+ if (tokenContent != null)
{
// Perf: Don't allocate a new errors array unless necessary.
var errors = CurrentErrors.Count == 0 ? Array.Empty() : new RazorDiagnostic[CurrentErrors.Count];
@@ -212,11 +223,8 @@ protected SyntaxToken EndToken(SyntaxKind type)
errors[i] = CurrentErrors[i];
}
- var tokenContent = GetTokenContent(type);
- Debug.Assert(string.Equals(tokenContent, Buffer.ToString(), StringComparison.Ordinal), $"Token content mismatch: '{tokenContent}' != '{Buffer}'. Token Type: '{type}'.");
token = CreateToken(tokenContent, type, errors);
- Buffer.Clear();
CurrentErrors.Clear();
}
@@ -260,13 +268,14 @@ protected bool TakeAll(string expected, bool caseSensitive)
return Lookahead(expected, takeIfMatch: true, caseSensitive: caseSensitive);
}
- protected char Peek()
+ protected char Peek(int charactersAhead = 1)
{
- using (var lookahead = BeginLookahead(Source))
+ using var lookahead = BeginLookahead(Source);
+ for (var i = 0; i < charactersAhead; i++)
{
MoveNext();
- return CurrentCharacter;
}
+ return CurrentCharacter;
}
protected StateResult AfterRazorCommentTransition()
@@ -279,7 +288,7 @@ protected StateResult AfterRazorCommentTransition()
AssertCurrent('*');
TakeCurrent();
- return Transition(1002, EndToken(RazorCommentStarKind));
+ return Transition(RazorCommentTokenizerState.RazorCommentBody, EndToken(RazorCommentStarKind));
}
protected StateResult RazorCommentBody()
@@ -319,11 +328,11 @@ protected StateResult StarAfterRazorCommentBody()
EndToken(RazorCommentStarKind));
}
- protected StateResult AtTokenAfterRazorCommentBody()
+ protected StateResult AtTokenAfterRazorCommentBody(int nextState)
{
AssertCurrent('@');
TakeCurrent();
- return Transition(StartState, EndToken(RazorCommentTransitionKind));
+ return Transition(nextState, EndToken(RazorCommentTransitionKind));
}
///
@@ -343,7 +352,7 @@ internal bool Lookahead(string expected, bool takeIfMatch, bool caseSensitive)
}
// Capture the current buffer content in case we have to backtrack
- string oldBuffer = null;
+ string? oldBuffer = null;
if (takeIfMatch)
{
oldBuffer = Buffer.ToString();
@@ -387,26 +396,21 @@ internal void AssertCurrent(char current)
Debug.Assert(CurrentCharacter == current, "CurrentCharacter Assumption violated", "Assumed that the current character would be {0}, but it is actually {1}", current, CurrentCharacter);
}
+ public virtual void Dispose() { }
+
protected enum RazorCommentTokenizerState
{
AfterRazorCommentTransition = 1000,
- EscapedRazorCommentTransition,
RazorCommentBody,
StarAfterRazorCommentBody,
AtTokenAfterRazorCommentBody,
}
- protected struct StateResult
+ protected readonly struct StateResult(int? state, SyntaxToken? result)
{
- public StateResult(int? state, SyntaxToken result)
- {
- State = state;
- Result = result;
- }
-
- public int? State { get; }
+ public int? State { get; } = state;
- public SyntaxToken Result { get; }
+ public SyntaxToken? Result { get; } = result;
}
private static LookaheadToken BeginLookahead(SeekableTextReader buffer)
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TokenizerBackedParser.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TokenizerBackedParser.cs
index 45e06cf5341..812fab220d4 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TokenizerBackedParser.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TokenizerBackedParser.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
@@ -10,7 +10,7 @@
namespace Microsoft.AspNetCore.Razor.Language.Legacy;
-internal abstract class TokenizerBackedParser : ParserBase
+internal abstract class TokenizerBackedParser : ParserBase, IDisposable
where TTokenizer : Tokenizer
{
protected delegate void SpanContextConfigAction(SpanEditHandlerBuilder? editHandlerBuilder, ref ISpanChunkGenerator? chunkGenerator);
@@ -720,4 +720,19 @@ protected void SetAcceptedCharacters(AcceptedCharactersInternal? acceptedCharact
{
Context.CurrentAcceptedCharacters = acceptedCharacters ?? AcceptedCharactersInternal.None;
}
+
+ internal void StartingBlock()
+ {
+ _tokenizer.Tokenizer.StartingBlock();
+ }
+
+ internal void EndingBlock()
+ {
+ _tokenizer.Tokenizer.EndingBlock();
+ }
+
+ public void Dispose()
+ {
+ _tokenizer.Dispose();
+ }
}
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TokenizerView.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TokenizerView.cs
index 4ef3147ef0a..daf33149dff 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TokenizerView.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TokenizerView.cs
@@ -1,13 +1,14 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#nullable disable
+using System;
using Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax;
namespace Microsoft.AspNetCore.Razor.Language.Legacy;
-internal class TokenizerView
+internal class TokenizerView : IDisposable
where TTokenizer : Tokenizer
{
public TokenizerView(TTokenizer tokenizer)
@@ -33,9 +34,19 @@ public bool Next()
public void PutBack(SyntaxToken token)
{
- Source.Position -= token.Content.Length;
+ Reset(Source.Position - token.Content.Length);
+ }
+
+ public void Reset(int position)
+ {
+ Source.Position = position;
Current = null;
EndOfFile = Source.Position >= Source.Length;
- Tokenizer.Reset();
+ Tokenizer.Reset(Source.Position);
+ }
+
+ public void Dispose()
+ {
+ Tokenizer.Dispose();
}
}
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/InternalSyntax/SyntaxTokenCache.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/InternalSyntax/SyntaxTokenCache.cs
index c6d1b1d5f83..2f5a3771f00 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/InternalSyntax/SyntaxTokenCache.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/InternalSyntax/SyntaxTokenCache.cs
@@ -38,6 +38,7 @@ public bool CanBeCached(SyntaxKind kind, params RazorDiagnostic[] diagnostics)
case SyntaxKind.Dot:
case SyntaxKind.Identifier:
case SyntaxKind.IntegerLiteral:
+ case SyntaxKind.NumericLiteral:
case SyntaxKind.Keyword:
case SyntaxKind.NewLine:
case SyntaxKind.RazorCommentStar:
diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/SyntaxKind.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/SyntaxKind.cs
index 37059d2d3da..f549b3f2f97 100644
--- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/SyntaxKind.cs
+++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/SyntaxKind.cs
@@ -84,12 +84,15 @@ internal enum SyntaxKind : byte
Identifier,
Keyword,
IntegerLiteral,
+ NumericLiteral,
CSharpComment,
RealLiteral,
CharacterLiteral,
StringLiteral,
// CSharp operators
+ CSharpOperator,
+
Arrow,
Minus,
Decrement,
diff --git a/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs b/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs
index 9d5de9e89e6..3ff04a92289 100644
--- a/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs
+++ b/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs
@@ -1405,7 +1405,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
Assert.Single(result.GeneratedSources);
}
- [Fact, WorkItem("https://github.com/dotnet/razor/issues/7049")]
+ [Fact(Skip = "PROTOTYPE"), WorkItem("https://github.com/dotnet/razor/issues/7049")]
public async Task SourceGenerator_CshtmlFiles_TagHelperInFunction_ManualSuppression()
{
// Arrange
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/Legacy/ToolingParserTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/Legacy/ToolingParserTestBase.cs
index 5cbba5150c3..f37ad8eebee 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/Legacy/ToolingParserTestBase.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/Legacy/ToolingParserTestBase.cs
@@ -187,8 +187,8 @@ internal virtual RazorSyntaxTree ParseDocument(RazorLanguageVersion version, str
var options = CreateParserOptions(version, directives, designTime, EnableSpanEditHandlers, featureFlags, fileKind);
var context = new ParserContext(source, options);
- var codeParser = new CSharpCodeParser(directives, context);
- var markupParser = new HtmlMarkupParser(context);
+ using var codeParser = new CSharpCodeParser(directives, context);
+ using var markupParser = new HtmlMarkupParser(context);
codeParser.HtmlParser = markupParser;
markupParser.CodeParser = codeParser;
diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs
index ae9ba577a3b..58e2b96c1ed 100644
--- a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs
+++ b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs
@@ -19,6 +19,7 @@
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.CodeAnalysis.Test.Utilities;
+using Microsoft.NET.Sdk.Razor.SourceGenerators;
using Roslyn.Test.Utilities;
using Xunit;
using Xunit.Sdk;
@@ -317,6 +318,7 @@ private RazorProjectEngine CreateProjectEngine(RazorConfiguration configuration,
b.Features.Add(new DefaultTypeNameFeature());
b.SetCSharpLanguageVersion(CSharpParseOptions.LanguageVersion);
+ b.Features.Add(new ConfigureRazorParserOptions(useRoslynTokenizer: true));
// Decorate each import feature so we can normalize line endings.
foreach (var feature in b.Features.OfType().ToArray())
diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/ParserTestBase.cs b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/ParserTestBase.cs
index f4982d0d51e..35d06a6921a 100644
--- a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/ParserTestBase.cs
+++ b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/ParserTestBase.cs
@@ -201,8 +201,8 @@ internal virtual RazorSyntaxTree ParseDocument(RazorLanguageVersion version, str
var options = CreateParserOptions(version, directives, designTime, _validateSpanEditHandlers, _useLegacyTokenizer, featureFlags, fileKind);
var context = new ParserContext(source, options);
- var codeParser = new CSharpCodeParser(directives, context);
- var markupParser = new HtmlMarkupParser(context);
+ using var codeParser = new CSharpCodeParser(directives, context);
+ using var markupParser = new HtmlMarkupParser(context);
codeParser.HtmlParser = markupParser;
markupParser.CodeParser = codeParser;
diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/SyntaxTreeVerifier.cs b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/SyntaxTreeVerifier.cs
index eec95f913d0..9018cbbf016 100644
--- a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/SyntaxTreeVerifier.cs
+++ b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/SyntaxTreeVerifier.cs
@@ -8,6 +8,7 @@
using Microsoft.AspNetCore.Razor.Language.Legacy;
using Microsoft.AspNetCore.Razor.Language.Syntax;
using Microsoft.AspNetCore.Razor.PooledObjects;
+using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Language;
@@ -32,7 +33,7 @@ public static void Verify(RazorSyntaxTree syntaxTree, bool ensureFullFidelity =
var sourceString = builder.ToString();
// Make sure the syntax tree contains all of the text in the document.
- Assert.Equal(sourceString, syntaxTreeString);
+ AssertEx.Equal(sourceString, syntaxTreeString);
}
// Verify that NextToken/PreviousToken/FirstToken/LastToken work correctly