textpatch

package
v0.18.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package textpatch applies ordered exact search-replace pairs to a text atomically: each pair's Old must match exactly once in the text as it stands when that pair applies, pairs apply in sequence, and the first failing pair aborts the whole application (20260826-120330-d-tac-8f8).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(text string, pairs []Pair) (string, error)

Apply returns text with every pair applied in order, or an error naming the first failing pair — Old empty, absent, or matching more than once. On error the input text is unchanged by contract: nothing partial escapes.

Types

type Pair

type Pair = types.PatchPair

Pair is one exact search-replace edit — defined in pkg/application/types (as PatchPair) because the exported surface names it (s-tac-ah2).

Jump to

Keyboard shortcuts

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