position

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Positions *Positions
}

Builder provide functions to constuct positions

func (*Builder) NewNodeListPosition

func (b *Builder) NewNodeListPosition(list []node.Node) *Position

NewNodeListPosition returns new Position

func (*Builder) NewNodeListTokenPosition

func (b *Builder) NewNodeListTokenPosition(list []node.Node, t token.Token) *Position

NewNodeListTokenPosition returns new Position

func (*Builder) NewNodeNodeListPosition

func (b *Builder) NewNodeNodeListPosition(n node.Node, list []node.Node) *Position

NewNodeNodeListPosition returns new Position

func (*Builder) NewNodePosition

func (b *Builder) NewNodePosition(n node.Node) *Position

NewNodePosition returns new Position

func (*Builder) NewNodeTokenPosition

func (b *Builder) NewNodeTokenPosition(n node.Node, t token.Token) *Position

NewNodeTokenPosition returns new Position

func (*Builder) NewNodesPosition

func (b *Builder) NewNodesPosition(startNode node.Node, endNode node.Node) *Position

NewNodesPosition returns new Position

func (*Builder) NewOptionalListTokensPosition

func (b *Builder) NewOptionalListTokensPosition(list []node.Node, t token.Token, endToken token.Token) *Position

NewOptionalListTokensPosition returns new Position

func (*Builder) NewTokenNodeListPosition

func (b *Builder) NewTokenNodeListPosition(t token.Token, list []node.Node) *Position

NewTokenNodeListPosition returns new Position

func (*Builder) NewTokenNodePosition

func (b *Builder) NewTokenNodePosition(t token.Token, n node.Node) *Position

NewTokenNodePosition returns new Position

func (*Builder) NewTokenPosition

func (b *Builder) NewTokenPosition(t token.Token) *Position

NewTokenPosition returns new Position

func (*Builder) NewTokensPosition

func (b *Builder) NewTokensPosition(startToken token.Token, endToken token.Token) *Position

NewTokensPosition returns new Position

type Position

type Position struct {
	StartLine int
	EndLine   int
	StartPos  int
	EndPos    int
}

Position represents node position

func (Position) String

func (p Position) String() string

type Positions

type Positions map[node.Node]*Position

Positions a collection of positions attached to nodes

func (Positions) AddPosition

func (p Positions) AddPosition(node node.Node, position *Position)

AddPosition attaches a position to a node

Jump to

Keyboard shortcuts

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