mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-27 00:47:56 +00:00
19 lines
441 B
Go
19 lines
441 B
Go
|
package yqlib
|
||
|
|
||
|
import "container/list"
|
||
|
|
||
|
type Context struct {
|
||
|
MatchingNodes *list.List
|
||
|
Variables map[string]*list.List
|
||
|
}
|
||
|
|
||
|
func (n *Context) SingleChildContext(candidate *CandidateNode) Context {
|
||
|
elMap := list.New()
|
||
|
elMap.PushBack(candidate)
|
||
|
return Context{MatchingNodes: elMap, Variables: n.Variables}
|
||
|
}
|
||
|
|
||
|
func (n *Context) ChildContext(results *list.List) Context {
|
||
|
return Context{MatchingNodes: results, Variables: n.Variables}
|
||
|
}
|