diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs index 727db76246..72f63b1127 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs @@ -507,13 +507,7 @@ namespace Microsoft.AspNet.Razor.Parser else { // Throw errors as necessary, but continue parsing - if (At(CSharpSymbolType.Keyword)) - { - Context.OnError(CurrentLocation, - RazorResources.FormatParseError_Unexpected_Keyword_After_At( - CSharpLanguageCharacteristics.GetKeyword(CurrentSymbol.Keyword.Value))); - } - else if (At(CSharpSymbolType.LeftBrace)) + if (At(CSharpSymbolType.LeftBrace)) { Context.OnError(CurrentLocation, RazorResources.ParseError_Unexpected_Nested_CodeBlock); } diff --git a/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs b/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs index 262c5924cf..b95d8d986b 100644 --- a/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs +++ b/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs @@ -694,22 +694,6 @@ namespace Microsoft.AspNet.Razor return GetString("Parser_Context_Not_Set"); } - /// - /// Unexpected "{0}" keyword after "@" character. Once inside code, you do not need to prefix constructs like "{0}" with "@". - /// - internal static string ParseError_Unexpected_Keyword_After_At - { - get { return GetString("ParseError_Unexpected_Keyword_After_At"); } - } - - /// - /// Unexpected "{0}" keyword after "@" character. Once inside code, you do not need to prefix constructs like "{0}" with "@". - /// - internal static string FormatParseError_Unexpected_Keyword_After_At(object p0) - { - return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected_Keyword_After_At"), p0); - } - /// /// "{0}" is a reserved word and cannot be used in implicit expressions. An explicit expression ("@()") must be used. /// diff --git a/src/Microsoft.AspNet.Razor/RazorResources.resx b/src/Microsoft.AspNet.Razor/RazorResources.resx index 9e3fe702f6..8a717cea4f 100644 --- a/src/Microsoft.AspNet.Razor/RazorResources.resx +++ b/src/Microsoft.AspNet.Razor/RazorResources.resx @@ -264,9 +264,6 @@ Instead, wrap the contents of the block in "{{}}": Parser was started with a null Context property. The Context property must be set BEFORE calling any methods on the parser. - - Unexpected "{0}" keyword after "@" character. Once inside code, you do not need to prefix constructs like "{0}" with "@". - "{0}" is a reserved word and cannot be used in implicit expressions. An explicit expression ("@()") must be used. diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs index 5b6a758520..9113235717 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs @@ -35,7 +35,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp } [Fact] - public void NestedCodeBlockWithAtCausesError() + public void NestedCodeBlockWithAtDoesntCauseError() { ParseBlockTest("if (true) { @if(false) { } }", new StatementBlock( @@ -44,10 +44,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.CodeTransition(), Factory.Code("if(false) { }").AsStatement() ), - Factory.Code(" }").AsStatement()), - new RazorError( - RazorResources.FormatParseError_Unexpected_Keyword_After_At("if"), - new SourceLocation(13, 0, 13))); + Factory.Code(" }").AsStatement())); } [Fact]