cue/load: prepare for files package refactor
Currently when files are specified on the command line,
they're considered after all packages have been evaluated
with respect to modules. We need to change that so that
we consider imports from files before creating the loader,
which requires factoring the `cueFilesPackage` method
out from `loader`.
This change makes some preparations for that by:
- parsing file arguments before invoking `loadPackages`
- passing the `filesMode` boolean as an argument rather
than indirectly in `Config`, where it doesn't really feel
like it belongs anyway, as `Config` isn't really the right
place for values that change over time.
For #3144
For #3147
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: If6c342757e97a3752edb3fefea64ad4bdfdbe23f
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194761
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>