ParserResults Class

Represents the results of parsing a Razor document

Namespace
Microsoft.AspNetCore.Razor
Assemblies
  • Microsoft.AspNetCore.Razor

Syntax

public class ParserResults
class Microsoft.AspNetCore.Razor.ParserResults

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:
public ParserResults(Block document, IEnumerable<TagHelperDescriptor> tagHelperDescriptors, ErrorSink errorSink)
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:
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.RazorErrors.

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.TagHelperDescriptors found for the current Razor document.

Return type:System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperDescriptor>
public IEnumerable<TagHelperDescriptor> TagHelperDescriptors { get; }