Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trie ¶
type Trie[K, V any] struct { // contains filtered or unexported fields }
though generic it is only meant to be used with K = *token.Token and V = ast.Alias
func New ¶
func New[K, V any](key_eq, key_less orderedmap.CompFunc[K]) *Trie[K, V]
create a new trie should only be used with K = *token.Token and V = ast.Alias
func (*Trie[K, V]) Contains ¶
strictly checks if the given keys are in the trie returns either the value for the key or nil
func (*Trie[K, V]) Insert ¶
func (t *Trie[K, V]) Insert(key []K, value V)
insert a value into the trie
func (*Trie[K, V]) PrettyPrint ¶
pretty prints the trie
func (*Trie[K, V]) Search ¶
func (t *Trie[K, V]) Search(keys TrieKeyGen[K]) []V
finds all values that match the given keys and all values encountered on the way
type TrieKeyGen ¶
generate keys for the trie it is given a unique, incrementing index for the node visited and the key of the possible child should return false if there are no keys left on the path should not be stateful or be able to revert to a previous state using the index