[swift-evolution] [Review] SE-0168: Multi-Line String Literals

Adrian Zubarev adrian.zubarev at devandartist.com
Tue Apr 11 12:06:00 CDT 2017


Can you elaborate a small example please, so I can better understand what you asked for?



-- 
Adrian Zubarev
Sent with Airmail

Am 11. April 2017 um 18:51:45, Ricardo Parada (rparada at mac.com) schrieb:



Hi Adrian,

I think having the closing """ on a line by itself activates the indentation stripping feature. So if it was to change as you suggest then how would you turn off indentation stripping?



On Apr 11, 2017, at 11:08 AM, Adrian Zubarev via swift-evolution <swift-evolution at swift.org> wrote:

This would be consistent and less confusing to learn.

Can’t we make the indent algorithm work like this instead?
let string = """\↵
····<tag>↵
······content text↵
····</tag>""" // Indent starts with the first non space character

// result

<tag>↵
··content text↵
</tag>
The line where the closing delimiter is trims all space chapters and the indent for the whole multi-line string is starting at the point where the first non-space chapters is in that line.

What do you think?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170411/14223f24/attachment.html>


More information about the swift-evolution mailing list