source

package
v2.0.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SkipHorizontalWhitespaceForward

func SkipHorizontalWhitespaceForward(content string, offset int) int

func SkipWhitespaceForward

func SkipWhitespaceForward(content string, offset int) int

Types

type Snippet

type Snippet struct {
	Text  string
	Caret string
	Line  int
}

func NewSnippet

func NewSnippet(src []string, line int) Snippet

func NewSnippetWithCaret

func NewSnippetWithCaret(lines []string, span Span, line int) Snippet

type Source

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

func New

func New(name, text string) *Source

func NewAnonymous

func NewAnonymous(text string) *Source

func Read

func Read(path string) (*Source, error)

func (*Source) Content

func (s *Source) Content() string

func (*Source) Empty

func (s *Source) Empty() bool

func (*Source) LocationAt

func (s *Source) LocationAt(span Span) (line, column int)

func (*Source) MarshalJSON

func (s *Source) MarshalJSON() ([]byte, error)

func (*Source) Name

func (s *Source) Name() string

func (*Source) Snippet

func (s *Source) Snippet(span Span) []Snippet

func (*Source) UnmarshalJSON

func (s *Source) UnmarshalJSON(bytes []byte) error

type Span

type Span struct {
	Start int `json:"start"`
	End   int `json:"end"`
}

Jump to

Keyboard shortcuts

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