func (c *Context) match(f *Filter, b *Node) bool {
	switch f.Operation() {
	case OpAND, OpOR:
		for _, lf := range f.InnerFilters() {
			if lf.Name() != "" {
				lf = c.Filters[lf.Name()]
			}
			ok := c.match(lf, b)
			if ok == (f.Operation() == OpOR) {
				return ok
			}
		}
		return f.Operation() == OpAND
	default:
		return c.matchKeyValue(f, b)
	}
}
match matches f against b. It returns no errors because
filter should have been parsed during context creation
and missing node properties are considered as a regular fail.
package netmap
import (
	"fmt"
	"strconv"
	"github.com/nspcc-dev/neofs-api-go/v2/netmap"
)
type Filter netmap.Filter
const MainFilterName = "*"
func (c *Context) applyFilter(name string, b *Node) bool {
	return name == MainFilterName || c.match(c.Filters[name], b)
}
func (c *Context) processFilters(p *PlacementPolicy) error {
	for _, f := range p.Filters() {
		if err := c.processFilter(f, true); err != nil {
			return err
		}
	}
	return nil
}
func (c *Context) processFilter(f *Filter, top bool) error {
	if f == nil {
		return fmt.Errorf("%w: FILTER", ErrMissingField)
	}
	if f.Name() == MainFilterName {
		return fmt.Errorf("%w: '*' is reserved", ErrInvalidFilterName)
	}
	if top && f.Name() == "" {
		return ErrUnnamedTopFilter
	}
	if !top && f.Name() != "" && c.Filters[f.Name()] == nil {
		return fmt.Errorf("%w: '%s'", ErrFilterNotFound, f.Name())
	}
	switch f.Operation() {
	case OpAND, OpOR:
		for _, flt := range f.InnerFilters() {
			if err := c.processFilter(flt, false); err != nil {
				return err
			}
		}
	default:
		if len(f.InnerFilters()) != 0 {
			return ErrNonEmptyFilters
		} else if !top && f.Name() != "" {  
			return nil
		}
		switch f.Operation() {
		case OpEQ, OpNE:
		case OpGT, OpGE, OpLT, OpLE:
			n, err := strconv.ParseUint(f.Value(), 10, 64)
			if err != nil {
				return fmt.Errorf("%w: '%s'", ErrInvalidNumber, f.Value())
			}
			c.numCache[f] = n
		default:
			return fmt.Errorf("%w: %s", ErrInvalidFilterOp, f.Operation())
		}
	}
	if top {
		c.Filters[f.Name()] = f
	}
	return nil
}