position

package
v0.0.0-...-93548a8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package position implements a data structure for storing source code positions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Position

type Position struct {
	Filename string // Source filename in which this token appears.
	Line     int    // Line in the source for this token.
	Startcol int    // Starting and ending columns in the source for this token.
	Endcol   int
}

A Position is the location in the source program that a token appears. It can specify a single character in the pinput, in which case the start and end columns are the same, or a span of sequential characters on one line.

func (Position) String

func (p Position) String() string

String formats a position to be useful for printing messages associated with this position, e.g. compiler errors.

Jump to

Keyboard shortcuts

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