ParseResult class

Parsing Result — Contains the AST and structured diagnostic information

Provides a richer parsing output than just DocumentNode, supporting diagnostic panel APIs and error filtering.

Usage example:

final result = LatexParser().parseWithDiagnostics("\\frac{a}{b} + \\unknowncmd");
print("AST: ${result.document}");
print("Error count: ${result.errors.length}");
print("Warning count: ${result.warnings.length}");
for (final d in result.diagnostics) {
  print("${d.severity}: ${d.message} at${d.range}");
}

Constructors

ParseResult({required DocumentNode document, required List<ParseDiagnostic> diagnostics})
const

Properties

diagnostics → List<ParseDiagnostic>
final
document → DocumentNode
final
errors → List<ParseDiagnostic>
Filters out all diagnostics with the ERROR severity level
no setter
hasDiagnostics → bool
Whether there are any diagnostics
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
warnings → List<ParseDiagnostic>
Filters out all diagnostics with the WARNING severity level
no setter

Methods

diagnosticsByCategory(DiagnosticCategory category) → List<ParseDiagnostic>
Filters diagnostics by category
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited