pos

package
v0.0.0-...-5d41a1c Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePosFlag

func ParsePosFlag(posFlag string) (filename string, startOffset, endOffset int, err error)

ParsePosFlag parses a string of the form "file:pos" or file:start,end" where pos, start, end match #%d and represent byte offsets, and returns its components.

(Numbers without a '#' prefix are reserved for future use, e.g. to indicate line/column positions.)

Types

type QueryPos

type QueryPos struct {
	Fset       *token.FileSet
	Start, End token.Pos           // source extent of query
	Path       []ast.Node          // AST path from query node to root of ast.File
	Exact      bool                // 2nd result of PathEnclosingInterval
	Info       *loader.PackageInfo // type info for the queried package
}

A QueryPos represents the position provided as input to a query: a textual extent in the program's source code, the AST node it corresponds to, and the package to which it belongs. Instances are created by ParseQueryPos.

func ParseQueryPos

func ParseQueryPos(iprog *loader.Program, posFlag string, needExact bool) (*QueryPos, error)

ParseQueryPos parses the source query position pos. If needExact, it must identify a single AST subtree; this is appropriate for queries that allow fairly arbitrary syntax, e.g. "describe".

Jump to

Keyboard shortcuts

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