(value []string)
| 34 | } |
| 35 | |
| 36 | func NewScope(value []string) Scope { |
| 37 | scope := map[string][]Selector{} |
| 38 | for _, v := range value { |
| 39 | selectors := []Selector{} |
| 40 | for _, part := range strings.Split(v, "&") { |
| 41 | selectors = append(selectors, NewSelector(strings.Split(part, "."))) |
| 42 | } |
| 43 | scope[v] = selectors |
| 44 | } |
| 45 | return Scope{Selectors: scope} |
| 46 | } |
| 47 | |
| 48 | // Macthes the scope `s` matches `s2`. |
| 49 | func (s Scope) Matches(blk nlp.Block) bool { |
no test coverage detected
searching dependent graphs…