hpatchsyntax

package
v0.0.0-...-db4406f Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MaxHeredocBodyBytes = 1 << 20

MaxHeredocBodyBytes bounds the decoded payload retained by one heredoc.

Variables

This section is empty.

Functions

func DecodeQuoted

func DecodeQuoted(source string) (string, string, error)

DecodeQuoted decodes one JSON-compatible quoted operand and returns the unconsumed source. Literal horizontal tabs are normalized to the equivalent JSON escape before decoding; every other quoted-string validation rule is retained.

Types

type CommandFrame

type CommandFrame struct {
	Delimiter string
	Body      string
	Next      int
}

CommandFrame describes one inline command or complete heredoc command.

func FrameCommand

func FrameCommand(lines []PhysicalLine, headerIndex int, command string) (CommandFrame, error)

FrameCommand returns the complete physical-line span and decoded body for the command at headerIndex. Malformed frames retain their attributable lines so parsers and diagnostics do not reinterpret payload-shaped data as commands.

type PhysicalLine

type PhysicalLine struct {
	Text       string
	Terminator string
}

PhysicalLine retains a script line's exact terminator separately from its text.

func SplitPhysicalLines

func SplitPhysicalLines(source string) []PhysicalLine

SplitPhysicalLines splits LF and CRLF scripts without losing body terminators.

Jump to

Keyboard shortcuts

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