diff --git a/src/Microsoft.AspNetCore.Razor/Parser/CSharpCodeParser.cs b/src/Microsoft.AspNetCore.Razor/Parser/CSharpCodeParser.cs index 50a9a49141..5069e3d712 100644 --- a/src/Microsoft.AspNetCore.Razor/Parser/CSharpCodeParser.cs +++ b/src/Microsoft.AspNetCore.Razor/Parser/CSharpCodeParser.cs @@ -18,23 +18,23 @@ namespace Microsoft.AspNetCore.Razor.Parser internal static ISet DefaultKeywords = new HashSet() { - SyntaxConstants.CSharp.TagHelperPrefixKeyword, SyntaxConstants.CSharp.AddTagHelperKeyword, SyntaxConstants.CSharp.RemoveTagHelperKeyword, - "if", + SyntaxConstants.CSharp.TagHelperPrefixKeyword, + "class", "do", - "try", "for", "foreach", - "while", - "switch", - "lock", - "using", - "section", - "inherits", "functions", + "if", + "inherits", + "lock", "namespace", - "class", + "section", + "switch", + "try", + "using", + "while", }; private Dictionary _directiveParsers = new Dictionary(); @@ -476,7 +476,7 @@ namespace Microsoft.AspNetCore.Razor.Parser Accept(dot); } } - else if (!At(CSharpSymbolType.WhiteSpace) && !At(CSharpSymbolType.NewLine)) + else if (!(At(CSharpSymbolType.WhiteSpace) || At(CSharpSymbolType.NewLine))) { PutCurrentBack(); }