posrange

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 13

Documentation

Overview

posrange is used to report a position in query strings for error and warning messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pos

type Pos int

Pos is the position in a string. Negative numbers indicate undefined positions.

type PositionRange

type PositionRange struct {
	Start Pos
	End   Pos
}

PositionRange describes a position in the input string of the parser.

func (PositionRange) StartPosInput

func (p PositionRange) StartPosInput(query string, lineOffset int) string

StartPosInput uses the query string to convert the PositionRange into a line:col string, indicating when this is not possible if the query is empty or the position is invalid. When this is used to convert ParseErr to a string, lineOffset is an additional line offset to be added, and is only used inside unit tests.

Jump to

Keyboard shortcuts

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