Mirror of https://github.com/cue-lang/cue cuelang.org
cue go

internal/cueimports: export API and fix for CUE syntax master

The original code still needed some adapting from the original Go version. Specifically: - it looked for semicolons not commas - it recognized the Go backquoted string syntax - it recognized the Go /*...*/ comment syntax Also, make it a little less general, as currently we don't seem to need the import-saving functionality (we can use `parser.ParseFile` with `CommentsOnly` which will keep us honest, even at a little bit of runtime cost), and because of that, we don't need to try to detect syntax errors. We can optimize at a later date if need be. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I276087961c73d04222a115b462e01e130b4cd4e3 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1172690 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>


+56 -104
2 changed files