///|
/// Classifies whether a mapping preserves source text or replaces one edit.
pub(all) enum RomanEditMappingKind {
RomanUnchangedMapping
RomanReplacedMapping(String)
} derive(Eq, Debug)
///|
/// Maps one half-open source character span to its half-open output span.
pub(all) struct RomanEditMappingSegment {
kind : RomanEditMappingKind
source_span : SourceSpan
output_span : SourceSpan
} derive(Eq, Debug)
///|
/// Retains one validated edit together with its realized output evidence.
pub(all) struct RomanAppliedEdit {
id : String
source_span : SourceSpan
output_span : SourceSpan
source_text : String
replacement_text : String
numeric_value : Int?
reason : RomanEditReason
source_diagnostic_code : DiagnosticCode?
} derive(Eq, Debug)
///|
/// Describes the exact spans and statistics an application will produce.
pub(all) struct RomanEditPreview {
original : String
applied_edits : Array[RomanAppliedEdit]
mapping_segments : Array[RomanEditMappingSegment]
statistics : RomanEditPlanStatistics
} derive(Eq, Debug)
///|
/// Returns atomic output with applied edits and source-to-output mappings.
pub(all) struct RomanEditApplicationReport {
original : String
output : String
applied_edits : Array[RomanAppliedEdit]
mapping_segments : Array[RomanEditMappingSegment]
statistics : RomanEditPlanStatistics
} derive(Eq, Debug)