-
Notifications
You must be signed in to change notification settings - Fork 223
Add TagHelper parse tree rewriter. #109
Add TagHelper parse tree rewriter. #109
Conversation
|
||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.AspNet.Razor.Generator.Compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This namespace will change once this is completed: #39 For now I've made it consistent with the other chunks.
if (NextIs(HtmlSymbolType.ForwardSlash)) | ||
{ | ||
AcceptAndMoveNext(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this addition looks like an unrelated bug fix. what does it have to do with visiting the parse tree (and rewriting some elements as TagHelperBlock
s)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, found an issue that I introduced in the HtmlBlock translation where the parser deadlocked in veryy edge case scenarios inside of script tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please send out a separate PR, preferably with tests of the edge case
/cc @anurse |
5b494d1
to
858b88b
Compare
EditHandler = span.EditHandler, | ||
Kind = span.Kind | ||
}; | ||
var htmlSymbols = ((IEnumerable<HtmlSymbol>)span.Symbols).ToArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't have CSharpSymbol
instances in this collection but probably still worth being careful: span.Symbols.OfType<HtmlSymbol>().ToArray()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was a nit
⌚ |
Addressed comments. |
BuildCurrentlyTrackedBlock(); | ||
} | ||
|
||
private bool IsValidTagHelper(string tagName, Block childBlock) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsPotentialTagHelper
attributeChildren.Parent = this; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove trailing whitespace
|
TagHelpers: Create parse visitors that understand "special" html #71
NOTE: This does not support malformed tag helpers. It expects all tags (that are tag helpers) are validly formed. That fix will come with: #104
Also I opened a separate test PR due to size here: #110
Issue: #71