mod/modfile: parse module.cue according to language.version
This change makes it possible to make changes to the
module.cue schema while still using a closed schema
for earlier versions. We refuse module.cue files that
declare a version newer than the current CUE version.
The language.version field is now mandatory in modules
mode because otherwise we cannot tell which schema
we should be using.
Also remove the unimplemented features from the schema
for now: they're always there in the history and the proposal
when we come to implement them, but they complicate
the schema for no good reason.
One unfortunate thing is that the error message when a field
is defined that's explicitly unimplemented is not good.
In the absence of an `error` CUE builtin, we should be able to
fix that in a subsequent CL by inspecting the error to see
whether any of the lines include the `unimplemented`
identifier.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I7bfef3b37e5b66bdbd8fe0614c1b815c7d9f1285
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193275
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>