Documentation ¶
Overview ¶
Package tag provides helper functions to work with the Tag member of the Node struct. To tag nodes during an operation, create a new context (e.g. SeenContext) and tag all nodes using that context. This ensures that any stale tags from an earlier context do not intefere with the new tags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SeenContext ¶
SeenContext is a tagging context used to mark nodes as having been visited during the current operation.
func NewSeenContext ¶
func NewSeenContext() SeenContext
NewSeenContext returns an initialized SeenContext.
func (SeenContext) IsSeen ¶
func (c SeenContext) IsSeen(n *node.Node) bool
IsSeen returns whether the given node was marked visited using the current context.
func (SeenContext) MarkSeen ¶
func (c SeenContext) MarkSeen(n *node.Node)
MarkSeen marks the given node as having been visited in the current context.
Click to show internal directories.
Click to hide internal directories.