pub struct RecoverySalvageMetrics {
pub recovered_node_count: usize,
pub unrecovered_diagnostic_count: usize,
pub error_node_count: usize,
pub first_unrecovered_error_node: Option<String>,
}Expand description
Recovery-salvage metrics computed for a single parsed file.
Used by accuracy closeout reporting to distinguish salvageable structured recovery from unrecovered parser damage.
Distinct from crate::RecoverySalvageProfile in two ways: this type
carries unrecovered_diagnostic_count (non-recovery diagnostics) for finer
classification, and exposes is_dirty()/is_structured_recovery_only()
helpers used by the corpus closeout reports.
Fields§
§recovered_node_count: usizeNumber of ParseError::Recovered diagnostics observed.
unrecovered_diagnostic_count: usizeNumber of non-recovery diagnostics observed (diagnostics.len() - recovered_node_count).
error_node_count: usizeNumber of NodeKind::Error nodes observed in the AST.
first_unrecovered_error_node: Option<String>Message from the earliest unrecovered ERROR node (by start offset),
if any.
Implementations§
Source§impl RecoverySalvageMetrics
impl RecoverySalvageMetrics
Sourcepub fn is_dirty(&self) -> bool
pub fn is_dirty(&self) -> bool
Returns true when the parse produced any error node, recovered diagnostic, or unrecovered diagnostic.
Sourcepub fn is_structured_recovery_only(&self) -> bool
pub fn is_structured_recovery_only(&self) -> bool
Returns true when the parse only produced structured recovery
diagnostics — i.e. recovered diagnostics with no ERROR AST nodes and
no other diagnostics.
Trait Implementations§
Source§impl Clone for RecoverySalvageMetrics
impl Clone for RecoverySalvageMetrics
Source§fn clone(&self) -> RecoverySalvageMetrics
fn clone(&self) -> RecoverySalvageMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more