mod/modfile: add FixLegacy function
This implements the core functionality required
to migrate legacy module.cue files to the new syntax.
For #3137
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I27cf3e7241d64d56398289c1400d51ef79b0f813
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194769
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>