edges

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: Apache-2.0, NCSA Imports: 4 Imported by: 15

Documentation

Overview

Package edges defines constants for Kythe edges.

Index

Constants

View Source
const (
	ChildOf                 = Prefix + "childof"
	Extends                 = Prefix + "extends"
	ExtendsPrivate          = Prefix + "extends/private"
	ExtendsPrivateVirtual   = Prefix + "extends/private/virtual"
	ExtendsProtected        = Prefix + "extends/protected"
	ExtendsProtectedVirtual = Prefix + "extends/protected/virtual"
	ExtendsPublic           = Prefix + "extends/public"
	ExtendsPublicVirtual    = Prefix + "extends/public/virtual"
	ExtendsVirtual          = Prefix + "extends/virtual"
	Generates               = Prefix + "generates"
	Named                   = Prefix + "named"
	Overrides               = Prefix + "overrides"
	Param                   = Prefix + "param"
	Satisfies               = Prefix + "satisfies"
	Typed                   = Prefix + "typed"
)

Edge kind labels

View Source
const (
	Completes         = Prefix + "completes"
	CompletesUniquely = Prefix + "completes/uniquely"
	Defines           = Prefix + "defines"
	DefinesBinding    = Prefix + "defines/binding"
	Documents         = Prefix + "documents"
	Ref               = Prefix + "ref"
	RefCall           = Prefix + "ref/call"
	RefImplicit       = Prefix + "ref/implicit"
	RefCallImplicit   = Prefix + "ref/call/implicit"
	RefImports        = Prefix + "ref/imports"
	RefInit           = Prefix + "ref/init"
	RefInitImplicit   = Prefix + "ref/init/implicit"
	Tagged            = Prefix + "tagged"
)

Edge kinds associated with anchors

View Source
const Prefix = schema.Prefix + "edge/"

Prefix defines the common prefix for all Kythe edge kinds.

Variables

This section is empty.

Functions

func Canonical

func Canonical(kind string) string

Canonical returns the canonical forward version of an edge kind.

func IsAnchorEdge

func IsAnchorEdge(kind string) bool

IsAnchorEdge reports whether kind is one associated with anchors.

func IsForward

func IsForward(kind string) bool

IsForward reports whether kind is a forward edge kind.

func IsReverse

func IsReverse(kind string) bool

IsReverse reports whether kind is a reverse edge kind.

func IsVariant

func IsVariant(x, y string) bool

IsVariant reports whether x is equal to or a subkind of y. For example, each of the following returns true:

IsVariant("/kythe/edge/defines/binding", "/kythe/edge/defines")
IsVariant("/kythe/edge/defines", "/kythe/edge/defines")

Moreover IsVariant(x, y) == IsVariant(Mirror(x), Mirror(y)) for all x, y.

func Mirror

func Mirror(kind string) string

Mirror returns the opposite-directional edge label for kind.

func OrdinalKind added in v0.0.27

func OrdinalKind(kind string) bool

OrdinalKind reports whether kind (which does not have an ordinal suffix) generally has an associated ordinal (e.g. /kythe/edge/param edges).

func ParamIndex added in v0.0.27

func ParamIndex(i int) string

ParamIndex returns an edge label of the form "param.i" for the i given.

func ParseOrdinal

func ParseOrdinal(kind string) (base string, ordinal int, hasOrdinal bool)

ParseOrdinal reports whether kind has an ordinal suffix (.nnn), and if so, returns the value of the ordinal as an integer. If not, the original kind is returned as written and ordinal == 0.

Types

This section is empty.

Jump to

Keyboard shortcuts

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