Update CSharpCodeParser.cs (#860)

Cleanup CSharpCodeParser.cs code.
This commit is contained in:
Piotr 2016-11-07 23:34:10 +01:00 committed by N. Taylor Mullen
parent 77ed9f22fc
commit ff8b2260fb
1 changed files with 11 additions and 11 deletions

View File

@ -18,23 +18,23 @@ namespace Microsoft.AspNetCore.Razor.Parser
internal static ISet<string> DefaultKeywords = new HashSet<string>() internal static ISet<string> DefaultKeywords = new HashSet<string>()
{ {
SyntaxConstants.CSharp.TagHelperPrefixKeyword,
SyntaxConstants.CSharp.AddTagHelperKeyword, SyntaxConstants.CSharp.AddTagHelperKeyword,
SyntaxConstants.CSharp.RemoveTagHelperKeyword, SyntaxConstants.CSharp.RemoveTagHelperKeyword,
"if", SyntaxConstants.CSharp.TagHelperPrefixKeyword,
"class",
"do", "do",
"try",
"for", "for",
"foreach", "foreach",
"while",
"switch",
"lock",
"using",
"section",
"inherits",
"functions", "functions",
"if",
"inherits",
"lock",
"namespace", "namespace",
"class", "section",
"switch",
"try",
"using",
"while",
}; };
private Dictionary<string, Action> _directiveParsers = new Dictionary<string, Action>(); private Dictionary<string, Action> _directiveParsers = new Dictionary<string, Action>();
@ -476,7 +476,7 @@ namespace Microsoft.AspNetCore.Razor.Parser
Accept(dot); Accept(dot);
} }
} }
else if (!At(CSharpSymbolType.WhiteSpace) && !At(CSharpSymbolType.NewLine)) else if (!(At(CSharpSymbolType.WhiteSpace) || At(CSharpSymbolType.NewLine)))
{ {
PutCurrentBack(); PutCurrentBack();
} }