Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrDetail ¶
func NewErrDetail ¶
type Node ¶
Node contains access to the start and end positions of a token.
func NewFileNode ¶
NewFileNode returns a fake node which just points to 1:1 of the file, whatever that is.
type Pos ¶
type Pos struct { // File contains the absolute file path. File string // Offset in bytes Offset int // Line denotes the one-based line number in the denoted File. Line int // Col denotes the one-based column number in the denoted Line. Col int }
A Pos describes a resolved position within a file.
type PosError ¶
PosError represents a very specific positional error with a lot of explaining noise. Use Explain.
func NewPosError ¶
NewPosError creates a new PosError with the given root cause and optional details.
type Position ¶
type Position struct {
BeginPos, EndPos Pos
}
type String ¶
A String holds a positional value.
func Lines ¶
func Lines(filename string, r io.ByteReader) ([]String, error)
Lines parses the given bytes and returns the correct located string for each line.
func (String) Locate ¶
Locate creates a new string with the applied position, assuming this string is ever in a single line.
Click to show internal directories.
Click to hide internal directories.