source

package
v1.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package source defines portable Ferret source inputs and coordinates. Span offset units remain defined by the producer of each source value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Position
	SourceName string `json:"sourceName"`
}

Location adds the semantic source name to a Position. SourceName does not imply that the source is backed by a local filesystem path.

type Position

type Position struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

Position identifies a line and column within source text.

type Range

type Range struct {
	Location
	Span Span `json:"span"`
}

Range combines a source Location with its producer-defined Span.

type Source

type Source struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

func New

func New(name, content string) Source

func NewAnonymous

func NewAnonymous(content string) Source

type Span

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

Span identifies a producer-defined interval within source text. Its offset units are defined by the producer rather than by the universal API.

Jump to

Keyboard shortcuts

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