Documentation
¶
Overview ¶
Package resolver provides token reference resolution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveAliases ¶
ResolveAliases resolves all alias references in the token list. Updates ResolvedValue and IsResolved fields on each token.
func ResolveGroupExtensions ¶
ResolveGroupExtensions resolves $extends relationships in DTCG 2025.10 files. It creates copies of inherited tokens with updated paths and names. Child tokens override inherited tokens with the same terminal name.
This function should be called AFTER parsing, BEFORE alias resolution. For Draft schema, this is a no-op that returns the tokens unchanged.
Types ¶
type DependencyGraph ¶
type DependencyGraph struct {
// contains filtered or unexported fields
}
DependencyGraph represents a directed graph of token dependencies.
func BuildDependencyGraph ¶
func BuildDependencyGraph(tokens []*token.Token) *DependencyGraph
BuildDependencyGraph builds a dependency graph from a list of tokens.
func (*DependencyGraph) Dependencies ¶
func (g *DependencyGraph) Dependencies(tokenName string) []string
Dependencies returns the list of tokens that the given token depends on.
func (*DependencyGraph) Dependents ¶
func (g *DependencyGraph) Dependents(tokenName string) []string
Dependents returns the list of tokens that depend on the given token.
func (*DependencyGraph) FindCycle ¶
func (g *DependencyGraph) FindCycle() []string
FindCycle returns the cycle path if one exists, or nil if no cycle.
func (*DependencyGraph) HasCycle ¶
func (g *DependencyGraph) HasCycle() bool
HasCycle returns true if the graph contains a circular dependency.
func (*DependencyGraph) TopologicalSort ¶
func (g *DependencyGraph) TopologicalSort() ([]string, error)
TopologicalSort returns tokens in dependency order (dependencies first). Returns error if graph contains a cycle.