Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit d4bdfd9

Browse files
committed
Addressed code review comments
1 parent 9c6fee4 commit d4bdfd9

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ private void AfterTransition()
228228
{
229229
Context.OnError(
230230
CurrentLocation,
231-
RazorResources.ParseError_HelperDirectiveNotAvailable,
231+
RazorResources.FormatParseError_HelperDirectiveNotAvailable(SyntaxConstants.CSharp.HelperKeyword),
232232
CurrentSymbol.Content.Length);
233233
}
234234

src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public static class CSharp
2727
public static readonly string ElseIfKeyword = "else if";
2828
public static readonly string NamespaceKeyword = "namespace";
2929
public static readonly string ClassKeyword = "class";
30+
31+
// Not supported. Only used for error cases.
3032
public static readonly string HelperKeyword = "helper";
3133
}
3234
}

src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Microsoft.AspNet.Razor/RazorResources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,6 @@ Instead, wrap the contents of the block in "{{}}":
426426
<value>The &amp;lt;{0}&amp;gt; tag is not allowed by parent &amp;lt;{1}&amp;gt; tag helper. Only child tag helper(s) targeting tag name(s) '{2}' are allowed.</value>
427427
</data>
428428
<data name="ParseError_HelperDirectiveNotAvailable" xml:space="preserve">
429-
<value>The @helper directive is not available in Razor 4.</value>
429+
<value>The {0} directive is no longer supported.</value>
430430
</data>
431431
</root>

test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ public void ParseBlockHandlesQuotesAfterTransition()
3030
[Fact]
3131
public void ParseBlockWithHelperDirectiveProducesError()
3232
{
33-
ParseBlockTest("@helper { }",
34-
new ExpressionBlock(
35-
Factory.CodeTransition(),
36-
Factory.Code("helper")
37-
.AsImplicitExpression(KeywordSet)
38-
.Accepts(AcceptedCharacters.NonWhiteSpace)),
39-
new RazorError(
40-
RazorResources.ParseError_HelperDirectiveNotAvailable,
41-
new SourceLocation(1, 0, 1),
42-
length: 6));
33+
ParseBlockTest("@helper fooHelper { }",
34+
new ExpressionBlock(
35+
Factory.CodeTransition(),
36+
Factory.Code("helper")
37+
.AsImplicitExpression(KeywordSet)
38+
.Accepts(AcceptedCharacters.NonWhiteSpace)),
39+
new RazorError(
40+
RazorResources.FormatParseError_HelperDirectiveNotAvailable(SyntaxConstants.CSharp.HelperKeyword),
41+
new SourceLocation(1, 0, 1),
42+
length: 6));
4343
}
4444

4545
[Fact]

0 commit comments

Comments
 (0)