-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/cueimports: export API and fix for CUE syntax
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>
- Loading branch information
Showing
2 changed files
with
56 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters