internal/core/compile: add matchN builtin validator
The matchN validator can be used to implement a host
of useful validators, including the JSON schema
equavalent of "not", "oneOf", and "anyOf".
Issue #3176
Issue #3165
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I904bfe38a09a8a83d08a09d46866a69f87c8cc7c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198922
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>