func parseObjectP(tokens []string, baseCaseParser, keySequenceParser predicate.Parser) (predicate.Predicate, []string, error) {
	if len(tokens) == 0 {
		return nil, nil, errz.NewMatchError("expected a key sequence")
	}
	tk := tokens[0]
	key, rem, err := parseKey(tk)
	if err != nil {
		return nil, nil, err
	}
	var p predicate.Predicate
	if len(rem) <= 0 {
		tokens = tokens[1:]
		p, tokens, err = baseCaseParser.Parse(tokens)
	} else {
		tokens[0] = rem
		p, tokens, err = keySequenceParser.Parse(tokens)
	}
	if err != nil {
		if errz.IsMatchError(err) {
			err = fmt.Errorf("expected a predicate after %v", key)
		}
	}
	return objectP(key, p), tokens, err
}
This helper's used by parseObjectPredicate and parseObjectExpression.
package meta
import (
	"fmt"
	"strings"
	"github.com/puppetlabs/wash/cmd/internal/find/parser/errz"
	"github.com/puppetlabs/wash/cmd/internal/find/parser/predicate"
)
func parseObjectPredicate(tokens []string) (predicate.Predicate, []string, error) {
	if p, tokens, err := parseEmptyPredicate(tokens); err == nil {
		return p, tokens, err
	}
	parseOAPredicate := predicate.ToParser(parseOAPredicate)
	return parseObjectP(
		tokens,
		parseOAPredicate,
		parseOAPredicate,
	)
}