ParserResults Class¶
Represents the results of parsing a Razor document
- Namespace
Microsoft.AspNetCore.Razor
- Assemblies
- Microsoft.AspNetCore.Razor
Constructors¶
-
ParserResults
(Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor>, Microsoft.AspNetCore.Razor.ErrorSink)¶ Instantiates a new
Microsoft.AspNetCore.Razor.ParserResults
instance.Arguments: - document (Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block) – The
Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block
for the syntax tree. - tagHelperDescriptors (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor>) – The
Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor
s that apply to the current Razor document. - errorSink (Microsoft.AspNetCore.Razor.ErrorSink) – The
Microsoft.AspNetCore.Razor.ParserResults.ErrorSink
used to collectMicrosoft.AspNetCore.Razor.RazorError
s encountered when parsing the current Razor document.
public ParserResults(Block document, IEnumerable<TagHelperDescriptor> tagHelperDescriptors, ErrorSink errorSink)
- document (Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block) – The
-
ParserResults
(System.Boolean, Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor>, Microsoft.AspNetCore.Razor.ErrorSink) Instantiates a new
Microsoft.AspNetCore.Razor.ParserResults
instance.Arguments: - success (System.Boolean) – <code>true</code> if parsing was successful, <code>false</code> otherwise.
- document (Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block) – The
Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block
for the syntax tree. - tagHelperDescriptors (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor>) – The
Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor
s that apply to the current Razor document. - errorSink (Microsoft.AspNetCore.Razor.ErrorSink) – The
Microsoft.AspNetCore.Razor.ParserResults.ErrorSink
used to collectMicrosoft.AspNetCore.Razor.RazorError
s encountered when parsing the current Razor document.
protected ParserResults(bool success, Block document, IEnumerable<TagHelperDescriptor> tagHelperDescriptors, ErrorSink errorSink)
-
Properties¶
-
Microsoft.AspNetCore.Razor.ParserResults.
Document
¶ The root node in the document’s syntax tree.
Return type: Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block public Block Document { get; }
-
Microsoft.AspNetCore.Razor.ParserResults.
ErrorSink
¶ Used to aggregate
Microsoft.AspNetCore.Razor.RazorError
s.Return type: Microsoft.AspNetCore.Razor.ErrorSink public ErrorSink ErrorSink { get; }
-
Microsoft.AspNetCore.Razor.ParserResults.
ParserErrors
¶ The list of errors which occurred during parsing.
Return type: System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Razor.RazorError> public IEnumerable<RazorError> ParserErrors { get; }
-
Microsoft.AspNetCore.Razor.ParserResults.
Prefix
¶ Text used as a required prefix when matching HTML.
Return type: System.String public string Prefix { get; }
-
Microsoft.AspNetCore.Razor.ParserResults.
Success
¶ Indicates if parsing was successful (no errors).
Return type: System.Boolean Returns: <code>true</code> if parsing was successful, <code>false</code> otherwise. public bool Success { get; }
-
Microsoft.AspNetCore.Razor.ParserResults.
TagHelperDescriptors
¶ The
Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor
s found for the current Razor document.Return type: System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor> public IEnumerable<TagHelperDescriptor> TagHelperDescriptors { get; }
-