Skip to main content

Crate mtplatx_doc_diff

Crate mtplatx_doc_diff 

Source
Expand description

Semantic tree diff.

The diff engine compares two Documents at the semantic level, never at the source-text level. It emits an ordered Patch of Operations that can be replayed to transform old into new.

The implementation is a Myers-style block LCS over top-level blocks. For nested structures (lists, tables, quotes) the inner diff is approximated by re-running the same algorithm over the child vectors.

Structs§

DiffStats
Summary statistics about a diff.
Patch
A complete edit script.

Enums§

DiffError
Operation
A kind of edit.

Functions§

apply
Apply a patch to a document, returning the new document.
diff
Diff two documents, returning a Patch.
inlines_equal_ignoring_ws
Compare two inline sequences. Returns true if they are equivalent under a whitespace-insensitive comparison. Currently exact — kept as a hook for future fuzzy matching.