cue/load: factor out syntax cache
We need to be able to read the file syntax
before creating the loader so we can determine
imports from command line files, but currently the syntax
cache is only created as part of the loader.
This CL factors out the syntax cache into its own
value so it can be used independently of the loader.
For #3144
For #3147
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I2845406e7006a2ff9cc0b6d5dbb59798a8b1b30d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194764
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>