parser

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileDiff

type FileDiff struct {
	OldPath   string
	NewPath   string
	IsNew     bool
	IsDeleted bool
	IsRenamed bool
	Extension string
	Hunks     []Hunk
}

FileDiff represents all changes in a single file

func ParseDiff

func ParseDiff(diffOutput string) ([]FileDiff, error)

ParseDiff parses git diff output into structured FileDiff objects

type Hunk

type Hunk struct {
	OldStart int
	OldLines int
	NewStart int
	NewLines int
	Lines    []Line
}

Hunk represents a chunk of changes in a file

type Line

type Line struct {
	Type       LineType
	Content    string
	OldLineNum int // 0 if not applicable
	NewLineNum int // 0 if not applicable
}

Line represents a single line in a diff

type LineType

type LineType int

LineType represents the type of a line in a diff

const (
	LineUnchanged LineType = iota
	LineAdded
	LineDeleted
	LineContext
)

Jump to

Keyboard shortcuts

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