cue
cue copied to clipboard
Multiline string rejects line terminator elision
What version of CUE are you using (cue version)?
$ cue version
cue version v0.10.0
go version go1.23.0
-buildmode exe
-compiler gc
-trimpath true
CGO_ENABLED 0
GOARCH amd64
GOOS linux
GOAMD64 v1
cue.lang.version v0.10.0
Does this issue reproduce with the latest stable release?
Yes
What did you do?
Tried to evaluate the string from the spec under String and byte sequence literals:
"""
lily:
out of the water
out of itself
bass
picking \
bugs
off the moon
— Nick Virgilio, Selected Haiku, 1988
"""
What did you expect to see?
According to the spec page it should be equivalent to:
"lily:\nout of the water\nout of itself\n\n" +
"bass\npicking bugs\noff the moon\n" +
" — Nick Virgilio, Selected Haiku, 1988"
What did you see instead?
cannot get syntax for "-": unknown escape sequence:
-:7:14
Notes
Here's a playground with this issue: https://cuelang.org/play/?id=7uimnxuUVGR#w=function&i=cue&f=eval&o=cue
A smaller reproduction case: https://cuelang.org/play/?id=hxhDZo_g4zz#w=function&i=cue&f=eval&o=cue
Ah this seems related to https://github.com/cue-lang/cue/issues/2317
Yes; this is #2317. Line continuations with backslashes are not implemented right now.