Moved HtmlMarkupParser out of LegacyRazorDiagnostic

This commit is contained in:
Ajay Bhargav Baaskaran 2017-12-19 16:09:43 -08:00
parent bace4a3818
commit 7d4fb5dcab
13 changed files with 197 additions and 231 deletions

View File

@ -310,9 +310,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
else
{
Context.ErrorSink.OnError(
CurrentStart,
LegacyResources.ParseError_MarkupBlock_Must_Start_With_Tag,
CurrentSymbol.Content.Length);
RazorDiagnosticFactory.CreateParsing_MarkupBlockMustStartWithTag(
new SourceSpan(CurrentStart, CurrentSymbol.Content.Length)));
}
Output(SpanKindInternal.Markup);
}
@ -472,9 +471,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
if (tags.Count == 0)
{
Context.ErrorSink.OnError(
CurrentStart,
LegacyResources.ParseError_OuterTagMissingName,
length: 1 /* end of file */);
RazorDiagnosticFactory.CreateParsing_OuterTagMissingName(
new SourceSpan(CurrentStart, contentLength: 1 /* end of file */)));
}
return false;
}
@ -634,9 +632,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
if (!seenCloseAngle)
{
Context.ErrorSink.OnError(
textLocation,
LegacyResources.ParseError_TextTagCannotContainAttributes,
length: 4 /* text */);
RazorDiagnosticFactory.CreateParsing_TextTagCannotContainAttributes(
new SourceSpan(textLocation, contentLength: 4 /* text */)));
Span.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.Any;
RecoverTextTag();
@ -1089,9 +1086,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
Context.Source.Position = bookmark;
NextToken();
Context.ErrorSink.OnError(
textLocation,
LegacyResources.ParseError_TextTagCannotContainAttributes,
length: 4 /* text */);
RazorDiagnosticFactory.CreateParsing_TextTagCannotContainAttributes(
new SourceSpan(textLocation, contentLength: 4 /* text */)));
RecoverTextTag();
}
@ -1142,9 +1138,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
if (!seenClose)
{
Context.ErrorSink.OnError(
SourceLocationTracker.Advance(tag.Item2, "<"),
LegacyResources.FormatParseError_UnfinishedTag(tag.Item1.Content),
Math.Max(tag.Item1.Content.Length, 1));
RazorDiagnosticFactory.CreateParsing_UnfinishedTag(
new SourceSpan(
SourceLocationTracker.Advance(tag.Item2, "<"),
Math.Max(tag.Item1.Content.Length, 1)),
tag.Item1.Content));
}
else
{
@ -1277,9 +1275,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
if (!Optional(HtmlSymbolType.CloseAngle))
{
Context.ErrorSink.OnError(
SourceLocationTracker.Advance(tagStart, "</"),
LegacyResources.FormatParseError_UnfinishedTag(ScriptTagName),
ScriptTagName.Length);
RazorDiagnosticFactory.CreateParsing_UnfinishedTag(
new SourceSpan(SourceLocationTracker.Advance(tagStart, "</"), ScriptTagName.Length),
ScriptTagName));
}
Output(SpanKindInternal.Markup);
}
@ -1335,16 +1333,17 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
if (currentTag != null)
{
Context.ErrorSink.OnError(
SourceLocationTracker.Advance(currentTag.Item2, "<"),
LegacyResources.FormatParseError_MissingEndTag(currentTag.Item1.Content),
currentTag.Item1.Content.Length);
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(
SourceLocationTracker.Advance(currentTag.Item2, "<"),
currentTag.Item1.Content.Length),
currentTag.Item1.Content));
}
else
{
Context.ErrorSink.OnError(
SourceLocationTracker.Advance(tagStart, "</"),
LegacyResources.FormatParseError_UnexpectedEndTag(tagName),
tagName.Length);
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(SourceLocationTracker.Advance(tagStart, "</"), tagName.Length), tagName));
}
return false;
}
@ -1360,9 +1359,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
}
var tag = tags.Pop();
Context.ErrorSink.OnError(
SourceLocationTracker.Advance(tag.Item2, "<"),
LegacyResources.FormatParseError_MissingEndTag(tag.Item1.Content),
tag.Item1.Content.Length);
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(
SourceLocationTracker.Advance(tag.Item2, "<"),
tag.Item1.Content.Length),
tag.Item1.Content));
}
else if (complete)
{

View File

@ -250,6 +250,66 @@ namespace Microsoft.AspNetCore.Razor.Language
return RazorDiagnostic.Create(Parsing_InvalidTagHelperLookupText, location, lookupText);
}
internal static readonly RazorDiagnosticDescriptor Parsing_MarkupBlockMustStartWithTag =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}1021",
() => LegacyResources.ParseError_MarkupBlock_Must_Start_With_Tag,
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic CreateParsing_MarkupBlockMustStartWithTag(SourceSpan location)
{
return RazorDiagnostic.Create(Parsing_MarkupBlockMustStartWithTag, location);
}
internal static readonly RazorDiagnosticDescriptor Parsing_OuterTagMissingName =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}1022",
() => LegacyResources.ParseError_OuterTagMissingName,
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic CreateParsing_OuterTagMissingName(SourceSpan location)
{
return RazorDiagnostic.Create(Parsing_OuterTagMissingName, location);
}
internal static readonly RazorDiagnosticDescriptor Parsing_TextTagCannotContainAttributes =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}1023",
() => LegacyResources.ParseError_TextTagCannotContainAttributes,
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic CreateParsing_TextTagCannotContainAttributes(SourceSpan location)
{
return RazorDiagnostic.Create(Parsing_TextTagCannotContainAttributes, location);
}
internal static readonly RazorDiagnosticDescriptor Parsing_UnfinishedTag =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}1024",
() => LegacyResources.ParseError_UnfinishedTag,
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic CreateParsing_UnfinishedTag(SourceSpan location, string tagName)
{
return RazorDiagnostic.Create(Parsing_UnfinishedTag, location, tagName);
}
internal static readonly RazorDiagnosticDescriptor Parsing_MissingEndTag =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}1025",
() => LegacyResources.ParseError_MissingEndTag,
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic CreateParsing_MissingEndTag(SourceSpan location, string tagName)
{
return RazorDiagnostic.Create(Parsing_MissingEndTag, location, tagName);
}
internal static readonly RazorDiagnosticDescriptor Parsing_UnexpectedEndTag =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}1026",
() => LegacyResources.ParseError_UnexpectedEndTag,
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic CreateParsing_UnexpectedEndTag(SourceSpan location, string tagName)
{
return RazorDiagnostic.Create(Parsing_UnexpectedEndTag, location, tagName);
}
#endregion
#region Semantic Errors

View File

@ -1145,10 +1145,8 @@ catch(bar) { baz(); }", BlockKindInternal.Statement, SpanKindInternal.Code);
Factory.EmptyHtml()));
var expectedErrors = new RazorDiagnostic[]
{
RazorDiagnostic.Create(new RazorError(
@"End of file or an unexpected character was reached before the ""span"" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing (""<br />"") or have matching end tags (""<p>Hello</p>""). If you intended to display a ""<"" character, use the ""&lt;"" HTML entity.",
new SourceLocation(2, 0, 2),
length: 4)),
RazorDiagnosticFactory.CreateParsing_UnfinishedTag(
new SourceSpan(new SourceLocation(2, 0, 2), contentLength: 4), "span"),
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(SourceLocation.Zero, contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
};

View File

@ -149,14 +149,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
.Accepts(AcceptedCharactersInternal.None)),
Factory.Markup(Environment.NewLine).With(SpanChunkGenerator.Null),
Factory.Markup("}")))),
RazorDiagnostic.Create(new RazorError(
LegacyResources.ParseError_TextTagCannotContainAttributes,
new SourceLocation(7 + Environment.NewLine.Length, 1, 5),
length: 4)),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_MissingEndTag("text"),
new SourceLocation(7 + Environment.NewLine.Length, 1, 5),
length: 4)),
RazorDiagnosticFactory.CreateParsing_TextTagCannotContainAttributes(
new SourceSpan(new SourceLocation(7 + Environment.NewLine.Length, 1, 5), contentLength: 4)),
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(new SourceLocation(7 + Environment.NewLine.Length, 1, 5), contentLength: 4), "text"),
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"));
}

View File

@ -79,10 +79,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
designTime: true,
expectedErrors: new[]
{
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_UnexpectedEndTag("html"),
new SourceLocation(5 + Environment.NewLine.Length * 2, 2, 2),
length: 4)),
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(new SourceLocation(5 + Environment.NewLine.Length * 2, 2, 2), contentLength: 4), "html"),
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
});
@ -97,10 +95,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
new MarkupTagBlock(
Factory.Markup($"< {Environment.NewLine} "))),
designTime: true,
expectedErrors: RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_UnfinishedTag(string.Empty),
new SourceLocation(1, 0, 1),
length: 1)));
expectedErrors: RazorDiagnosticFactory.CreateParsing_UnfinishedTag(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), string.Empty));
}
[Fact]
@ -330,10 +326,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
new MarkupBlock(
new MarkupTagBlock(
Factory.Markup("<foo>").Accepts(AcceptedCharactersInternal.None))),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_MissingEndTag("foo"),
new SourceLocation(1, 0, 1),
length: 3)));
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 3), "foo"));
}
[Fact]
@ -453,10 +447,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
Factory.Markup("<foo>").Accepts(AcceptedCharactersInternal.None)),
new MarkupTagBlock(
Factory.Markup("</!-- bar -->").Accepts(AcceptedCharactersInternal.None))),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_MissingEndTag("foo"),
new SourceLocation(1, 0, 1),
length: 3)));
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 3), "foo"));
}
@ -615,10 +607,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
new MarkupBlock(
new MarkupTagBlock(
Factory.Markup("<br/"))),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_UnfinishedTag("br"),
new SourceLocation(1, 0, 1),
length: 2)));
RazorDiagnosticFactory.CreateParsing_UnfinishedTag(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 2), "br"));
}
[Fact]

View File

@ -28,10 +28,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
Factory.MarkupTransition("<text foo bar>").Accepts(AcceptedCharactersInternal.Any)),
new MarkupTagBlock(
Factory.MarkupTransition("</text>"))),
RazorDiagnostic.Create(new RazorError(
LegacyResources.ParseError_TextTagCannotContainAttributes,
new SourceLocation(1, 0, 1),
length: 4)));
RazorDiagnosticFactory.CreateParsing_TextTagCannotContainAttributes(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 4)));
}
[Fact]
@ -43,10 +41,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
Factory.MarkupTransition("<text>")),
new MarkupTagBlock(
Factory.MarkupTransition("</text foo bar>").Accepts(AcceptedCharactersInternal.Any))),
RazorDiagnostic.Create(new RazorError(
LegacyResources.ParseError_TextTagCannotContainAttributes,
new SourceLocation(8, 0, 8),
length: 4)));
RazorDiagnosticFactory.CreateParsing_TextTagCannotContainAttributes(
new SourceSpan(new SourceLocation(8, 0, 8), contentLength: 4)));
}
[Fact]
@ -54,10 +50,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
ParseBlockTest("foo bar <baz>",
new MarkupBlock(),
RazorDiagnostic.Create(new RazorError(
LegacyResources.ParseError_MarkupBlock_Must_Start_With_Tag,
SourceLocation.Zero,
length: 3)));
RazorDiagnosticFactory.CreateParsing_MarkupBlockMustStartWithTag(
new SourceSpan(SourceLocation.Zero, contentLength: 3)));
}
[Fact]
@ -68,10 +62,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
new MarkupTagBlock(
Factory.Markup("</foo>").Accepts(AcceptedCharactersInternal.None)),
Factory.Markup(" ").Accepts(AcceptedCharactersInternal.None)),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_UnexpectedEndTag("foo"),
new SourceLocation(2, 0, 2),
length: 3)));
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(new SourceLocation(2, 0, 2), contentLength: 3), "foo"));
}
[Fact]
@ -85,10 +77,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
Factory.Markup("<foo>").Accepts(AcceptedCharactersInternal.None)),
new MarkupTagBlock(
Factory.Markup("</bar>").Accepts(AcceptedCharactersInternal.None))),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_MissingEndTag("p"),
new SourceLocation(1, 0, 1),
length: 1)));
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), "p"));
}
[Fact]
@ -99,10 +89,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
new MarkupTagBlock(
Factory.Markup("<foo>").Accepts(AcceptedCharactersInternal.None)),
Factory.Markup("blah blah blah blah blah")),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_MissingEndTag("foo"),
new SourceLocation(1, 0, 1),
length: 3)));
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 3), "foo"));
}
[Fact]
@ -115,10 +103,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
new MarkupBlock(new AttributeBlockChunkGenerator("bar", new LocationTagged<string>(" bar=", 4, 0, 4), new LocationTagged<string>(string.Empty, 12, 0, 12)),
Factory.Markup(" bar=").With(SpanChunkGenerator.Null),
Factory.Markup("baz").With(new LiteralAttributeChunkGenerator(new LocationTagged<string>(string.Empty, 9, 0, 9), new LocationTagged<string>("baz", 9, 0, 9)))))),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_UnfinishedTag("foo"),
new SourceLocation(1, 0, 1),
length: 3)));
RazorDiagnosticFactory.CreateParsing_UnfinishedTag(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 3), "foo"));
}
}
}

View File

@ -39,10 +39,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
BlockFactory.MarkupTagBlock("<p>", AcceptedCharactersInternal.None),
BlockFactory.MarkupTagBlock("</>", AcceptedCharactersInternal.None),
Factory.Markup(" ").Accepts(AcceptedCharactersInternal.None)),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_MissingEndTag("p"),
new SourceLocation(1, 0, 1),
length: 1)));
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), "p"));
}
[Fact]

View File

@ -742,9 +742,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
absoluteIndex: 3, lineIndex: 0 , columnIndex: 3, length: 30)),
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(4, 0, 4), contentLength: 1), "do", "}", "{"),
RazorDiagnostic.Create(new RazorError(
LegacyResources.FormatParseError_UnexpectedEndTag("p"),
absoluteIndex: 31, lineIndex: 0, columnIndex: 31, length: 1))
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(filePath: null, absoluteIndex: 31, lineIndex: 0, characterIndex: 31, length: 1), "p")
}
},
{

View File

@ -2343,9 +2343,6 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
var factory = new SpanFactory();
var blockFactory = new BlockFactory(factory);
var errorFormatNormalUnclosed =
"The \"{0}\" element was not closed. All elements must be either self-closing or have a " +
"matching end tag.";
Func<Func<MarkupBlock>, MarkupBlock> buildStatementBlock = (insideBuilder) =>
{
@ -2392,9 +2389,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "!text"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 5))
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(filePath: null, absoluteIndex: 3, lineIndex: 0, characterIndex: 3, length: 5), "!text"),
}
},
{
@ -2530,12 +2526,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
var errorFormatMalformed =
"Found a malformed '{0}' tag helper. Tag helpers must have a start and end tag or be self " +
"closing.";
var errorFormatNormalUnclosed =
"The \"{0}\" element was not closed. All elements must be either self-closing or have a " +
"matching end tag.";
var errorFormatNormalNotStarted =
"Encountered end tag \"{0}\" with no matching start tag. Are your start/end tags properly " +
"balanced?";
RazorDiagnostic MissingEndTagError(string tagName)
{
return RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(filePath: null, absoluteIndex: 3, lineIndex: 0, characterIndex: 3, length: tagName.Length), tagName);
}
Func<Func<MarkupBlock>, MarkupBlock> buildStatementBlock = (insideBuilder) =>
{
@ -2567,9 +2563,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "!text", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 5)),
MissingEndTagError("!text"),
}
},
{
@ -2579,9 +2573,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
blockFactory.EscapedMarkupTagBlock("</", "text>", AcceptedCharactersInternal.None))),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalNotStarted, "!text", CultureInfo.InvariantCulture),
absoluteIndex: 4, lineIndex: 0, columnIndex: 4, length: 5)),
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(filePath: null, absoluteIndex: 4, lineIndex: 0, characterIndex: 4, length: 5), "!text"),
}
},
{
@ -2609,9 +2602,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
blockFactory.MarkupTagBlock("</text>", AcceptedCharactersInternal.None))),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "!text", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 5)),
MissingEndTagError("!text"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "text", CultureInfo.InvariantCulture),
absoluteIndex: 11, lineIndex: 0, columnIndex: 11, length: 4))
@ -2628,9 +2619,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
factory.Markup("text>").Accepts(AcceptedCharactersInternal.None)))),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "text", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 4))
MissingEndTagError("text"),
}
},
{
@ -2661,9 +2650,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "text", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 4))
MissingEndTagError("text"),
}
},
{
@ -2683,9 +2670,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
factory.EmptyHtml()),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalNotStarted, "text", CultureInfo.InvariantCulture),
absoluteIndex: 19, lineIndex: 0, columnIndex: 19, length: 4)),
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(filePath: null, absoluteIndex: 19, lineIndex: 0, characterIndex: 19, length: 4), "text"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "text", CultureInfo.InvariantCulture),
absoluteIndex: 19, lineIndex: 0, columnIndex: 19, length: 4))
@ -2712,11 +2698,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
var factory = new SpanFactory();
var blockFactory = new BlockFactory(factory);
var errorEOFMatchingBrace =
"End of file or an unexpected character was reached before the \"{0}\" tag could be parsed. " +
"Elements inside markup blocks must be complete. They must either be self-closing " +
"(\"<br />\") or have matching end tags (\"<p>Hello</p>\"). If you intended " +
"to display a \"<\" character, use the \"&lt;\" HTML entity.";
RazorDiagnostic UnfinishedTagError(string tagName, int length)
{
return RazorDiagnosticFactory.CreateParsing_UnfinishedTag(
new SourceSpan(filePath: null, absoluteIndex: 3, lineIndex: 0, characterIndex: 3, length: length),
tagName);
}
Func<Func<MarkupBlock>, MarkupBlock> buildPartialStatementBlock = (insideBuilder) =>
{
@ -2739,9 +2727,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!text}"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 6))
UnfinishedTagError("!text}", 6),
}
},
{
@ -2756,9 +2742,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!text"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 5))
UnfinishedTagError("!text", 5),
}
},
{
@ -2783,9 +2767,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!text"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 5))
UnfinishedTagError("!text", 5),
}
},
{
@ -2810,9 +2792,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!text"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 5))
UnfinishedTagError("!text", 5),
}
},
{
@ -2840,9 +2820,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!text"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 5))
UnfinishedTagError("!text", 5),
}
},
{
@ -2871,9 +2849,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!text"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 5))
UnfinishedTagError("!text", 5),
}
}
};
@ -2896,11 +2872,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
var factory = new SpanFactory();
var blockFactory = new BlockFactory(factory);
var errorEOFMatchingBrace =
"End of file or an unexpected character was reached before the \"{0}\" tag could be parsed. " +
"Elements inside markup blocks must be complete. They must either be self-closing " +
"(\"<br />\") or have matching end tags (\"<p>Hello</p>\"). If you intended " +
"to display a \"<\" character, use the \"&lt;\" HTML entity.";
RazorDiagnostic UnfinishedTagError(string tagName)
{
return RazorDiagnosticFactory.CreateParsing_UnfinishedTag(
new SourceSpan(filePath: null, absoluteIndex: 3, lineIndex: 0, characterIndex: 3, length: tagName.Length),
tagName);
}
Func<Func<MarkupBlock>, MarkupBlock> buildPartialStatementBlock = (insideBuilder) =>
{
@ -2923,9 +2901,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!}"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2))
UnfinishedTagError("!}"),
}
},
{
@ -2936,9 +2912,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!p}"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 3))
UnfinishedTagError("!p}"),
}
},
{
@ -2950,9 +2924,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!p"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2))
UnfinishedTagError("!p"),
}
},
{
@ -2977,9 +2949,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!p"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2))
UnfinishedTagError("!p"),
}
},
{
@ -3004,9 +2974,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!p"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2))
UnfinishedTagError("!p"),
}
},
{
@ -3038,9 +3006,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!p"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2))
UnfinishedTagError("!p"),
}
},
{
@ -3068,9 +3034,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!p"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2))
UnfinishedTagError("!p"),
}
},
{
@ -3100,9 +3064,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorEOFMatchingBrace, "!p"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2))
UnfinishedTagError("!p"),
}
}
};
@ -3235,12 +3197,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
var errorFormatMalformed =
"Found a malformed '{0}' tag helper. Tag helpers must have a start and end tag or be self " +
"closing.";
var errorFormatNormalUnclosed =
"The \"{0}\" element was not closed. All elements must be either self-closing or have a " +
"matching end tag.";
var errorFormatNormalNotStarted =
"Encountered end tag \"{0}\" with no matching start tag. Are your start/end tags properly " +
"balanced?";
RazorDiagnostic MissingEndTagError(string tagName, int index = 3)
{
return RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(filePath: null, absoluteIndex: index, lineIndex: 0, characterIndex: index, length: tagName.Length), tagName);
}
Func<Func<MarkupBlock>, MarkupBlock> buildStatementBlock = (insideBuilder) =>
{
@ -3272,9 +3234,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "!p", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2)),
MissingEndTagError("!p"),
}
},
{
@ -3284,9 +3244,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
blockFactory.EscapedMarkupTagBlock("</", "p>", AcceptedCharactersInternal.None))),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalNotStarted, "!p", CultureInfo.InvariantCulture),
absoluteIndex: 4, lineIndex: 0, columnIndex: 4, length: 2)),
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(filePath: null, absoluteIndex: 4, lineIndex: 0, characterIndex: 4, length: 2), "!p"),
}
},
{
@ -3314,9 +3273,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
blockFactory.MarkupTagBlock("</p>", AcceptedCharactersInternal.None))),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "!p", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2)),
MissingEndTagError("!p"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "p", CultureInfo.InvariantCulture),
absoluteIndex: 8, lineIndex: 0, columnIndex: 8, length: 1))
@ -3330,9 +3287,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
blockFactory.EscapedMarkupTagBlock("</", "p>", AcceptedCharactersInternal.None)))),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "p", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 1)),
MissingEndTagError("p"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "p", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 1))
@ -3363,9 +3318,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "p", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 1)),
MissingEndTagError("p"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "p", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 1))
@ -3388,9 +3341,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
factory.EmptyHtml()),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalNotStarted, "p", CultureInfo.InvariantCulture),
absoluteIndex: 13, lineIndex: 0, columnIndex: 13, length: 1)),
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(filePath: null, absoluteIndex: 13, lineIndex: 0, characterIndex: 13, length: 1), "p"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "p", CultureInfo.InvariantCulture),
absoluteIndex: 13, lineIndex: 0, columnIndex: 13, length: 1))
@ -3413,15 +3365,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
factory.EmptyHtml()),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "strong", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 6)),
MissingEndTagError("strong"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "strong", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 6)),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalNotStarted, "strong", CultureInfo.InvariantCulture),
absoluteIndex: 17, lineIndex: 0, columnIndex: 17, length: 6)),
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(filePath: null, absoluteIndex: 17, lineIndex: 0, characterIndex: 17, length: 6), "strong"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "strong", CultureInfo.InvariantCulture),
absoluteIndex: 17, lineIndex: 0, columnIndex: 17, length: 6))
@ -3465,24 +3414,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
factory.EmptyHtml()),
new []
{
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "p", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 1)),
MissingEndTagError("p"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "p", CultureInfo.InvariantCulture),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 1)),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "strong", CultureInfo.InvariantCulture),
absoluteIndex: 6, lineIndex: 0, columnIndex: 6, length: 6)),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "!p", CultureInfo.InvariantCulture),
absoluteIndex: 24, lineIndex: 0, columnIndex: 24, length: 2)),
MissingEndTagError("!p", index: 24),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatMalformed, "strong", CultureInfo.InvariantCulture),
absoluteIndex: 29, lineIndex: 0, columnIndex: 29, length: 6)),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalNotStarted, "!p", CultureInfo.InvariantCulture),
absoluteIndex: 38, lineIndex: 0, columnIndex: 38, length: 2)),
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(filePath: null, absoluteIndex: 38, lineIndex: 0, characterIndex: 38, length: 2), "!p"),
}
},
};
@ -3495,9 +3439,6 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
var factory = new SpanFactory();
var blockFactory = new BlockFactory(factory);
var errorFormatNormalUnclosed =
"The \"{0}\" element was not closed. All elements must be either self-closing or have a " +
"matching end tag.";
Func<Func<MarkupBlock>, MarkupBlock> buildStatementBlock = (insideBuilder) =>
{
@ -3544,9 +3485,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
RazorDiagnosticFactory.CreateParsing_ExpectedEndOfBlockBeforeEOF(
new SourceSpan(new SourceLocation(1, 0, 1), contentLength: 1), LegacyResources.BlockName_Code, "}", "{"),
RazorDiagnostic.Create(new RazorError(
string.Format(errorFormatNormalUnclosed, "!p"),
absoluteIndex: 3, lineIndex: 0, columnIndex: 3, length: 2))
RazorDiagnosticFactory.CreateParsing_MissingEndTag(
new SourceSpan(filePath: null, absoluteIndex: 3, lineIndex: 0, characterIndex: 3, length: 2), "!p"),
}
},
{
@ -4261,10 +4201,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
Factory.EmptyHtml());
var expectedErrors = new[]
{
RazorDiagnostic.Create(new RazorError(
"Encountered end tag \"div\" with no matching start tag. Are your start/end tags properly balanced?",
new SourceLocation(9, 0, 9),
3)),
RazorDiagnosticFactory.CreateParsing_UnexpectedEndTag(
new SourceSpan(new SourceLocation(9, 0, 9), contentLength: 3), "div"),
};
RunParseTreeRewriterTest(documentContent, expectedOutput, expectedErrors);

View File

@ -1,2 +1,2 @@
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,11): Error RZ9999: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,11): Error RZ1026: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,7): Error RZ1006: The explicit expression block is missing a closing ")" character. Make sure you have a matching ")" character for all the "(" characters within this block, and that none of the ")" characters are being interpreted as markup.

View File

@ -1,2 +1,2 @@
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,11): Error RZ9999: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,11): Error RZ1026: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,7): Error RZ1006: The explicit expression block is missing a closing ")" character. Make sure you have a matching ")" character for all the "(" characters within this block, and that none of the ")" characters are being interpreted as markup.

View File

@ -1,3 +1,3 @@
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(4,3): Error RZ9999: Encountered end tag "body" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(5,3): Error RZ9999: Encountered end tag "html" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(4,3): Error RZ1026: Encountered end tag "body" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(5,3): Error RZ1026: Encountered end tag "html" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(3,2): Error RZ1006: The if block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup.

View File

@ -1,3 +1,3 @@
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(4,3): Error RZ9999: Encountered end tag "body" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(5,3): Error RZ9999: Encountered end tag "html" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(4,3): Error RZ1026: Encountered end tag "body" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(5,3): Error RZ1026: Encountered end tag "html" with no matching start tag. Are your start/end tags properly balanced?
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(3,2): Error RZ1006: The if block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup.