-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/encoding/yaml: use cue/literal to quote string scalars
The YAML decoder had a function to wrap literal.Quote to use the multi-line """ form when the string had any newlines. It turns out that cue/literal can already do this via the option Form.WithOptionalTabIndent, which enables an "auto" multi-line mode to use the """ form when any newlines are present. While here, I noticed an optimization in our use of strings.Repeat which has already been done upstream for Go 1.23. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: Iba3b9bafb0b434001173db82718b30d1e1b680ef Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193240 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
- Loading branch information
Showing
2 changed files
with
2 additions
and
41 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