Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CycleDetector ¶
type CycleDetector struct {
// Cycles found in the AST
Cycles []Cycle
// contains filtered or unexported fields
}
func New ¶
func New() *CycleDetector
CycleDetector detects cycles otherwise known as strongly connected components (SCCs) using Tarjan's algorithm Cycles differ from SCCs in one subtle way: a single node is considered an SCC even if it's not self-referential we discard these trivial SCCs are they are not cycles.
func (*CycleDetector) AreCircular ¶
AreCircular checks if two TypeDefs are part of the same cycle.
func (*CycleDetector) DetectCycles ¶
func (c *CycleDetector) DetectCycles(t ast.TypeDefs) []Cycle
func (*CycleDetector) IsPartOfCycle ¶
func (c *CycleDetector) IsPartOfCycle(t *ast.TypeDef) bool
IsPartOfCycle checks if a TypeDef is part of a cycle
func (*CycleDetector) Traverse ¶
func (c *CycleDetector) Traverse(t *ast.TypeDef)
Click to show internal directories.
Click to hide internal directories.