andiff

package
v0.240828.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2024 License: 0BSD Imports: 5 Imported by: 0

Documentation

Overview

Package andiff implements the O(nlogn) anchored diff algorithm. Shamefully stolen from Go's src/internal/diff/diff.go. Heavily modified to better match effdump's needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	// The individual left and right lines.
	LT, RT []string

	Ops []Op

	Hash uint64
}

Diff describes a diff.

func Compute

func Compute(lt, rt string, rmregexp *regexp.Regexp) Diff

Compute computes the Diff between two strings. If rmregexp is non-nil, the matching parts are removed from each line first.

type Op

type Op struct {
	Del, Add, Keep int
}

Op describes a single diff operation / transformation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL