source

package
v1.8.22 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitLines

func SplitLines(source string) []string

Types

type LineTable

type LineTable struct {
	// contains filtered or unexported fields
}

func NewLineTable

func NewLineTable(source []byte) *LineTable

func (*LineTable) DisplayWidth

func (lt *LineTable) DisplayWidth(start, end int) int

func (*LineTable) LineCount

func (lt *LineTable) LineCount() int

func (*LineTable) LineText

func (lt *LineTable) LineText(lineIdx int) string

func (*LineTable) Lookup

func (lt *LineTable) Lookup(offset int) Position

func (*LineTable) Range

func (lt *LineTable) Range(start, end int) Range

type Position

type Position struct {
	Offset int
	Line   int
	Col    int
}

type Range

type Range struct {
	Start Position
	End   Position
}

func (Range) Contains

func (r Range) Contains(offset int) bool

func (Range) IsEmpty

func (r Range) IsEmpty() bool

Directories

Path Synopsis
Package walk provides CST traversal and indexed node lookup.
Package walk provides CST traversal and indexed node lookup.

Jump to

Keyboard shortcuts

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