Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePosFlag ¶
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 ¶
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".