parser

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffLine

type DiffLine struct {
	Number  int
	Content string
	Kind    LineKind
}

DiffLine represents a single diff line that belongs to either the left or right side.

type DiffRow

type DiffRow struct {
	Left  *DiffLine
	Right *DiffLine
}

DiffRow represents two aligned lines (left/right) in a diff hunk.

func Parse

func Parse(r io.Reader) ([]DiffRow, error)

Parse consumes unified diff text from r and returns aligned rows suitable for rendering.

type LineKind

type LineKind int

LineKind represents the semantic meaning of a diff line.

const (
	LineKindUnknown LineKind = iota
	LineKindContext
	LineKindAddition
	LineKindDeletion
	LineKindHeader
)

Jump to

Keyboard shortcuts

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