[swift-evolution] [Review] SE-0168: Multi-Line String Literals
adrian.zubarev at devandartist.com
Wed Apr 12 14:09:32 CDT 2017
That’s already a huge part of the proposal. If I understood the indent algorithm correctly than it should already support everyones preferences for their indent style. The indent is determined by the prefix indent before the closing delimiter.
The example you proved should, for my understanding emit 3 warnings that each line in between the delimiter has wrong ident. It also could help you with fix-its to fix that issue and add another whitespace of tab, depending on which indent prefix the closing delimiter has.
The string itself should be equivalent to "aa\nbb\ncc\n" even if you have warnings to fix.
Sent with Airmail
Am 12. April 2017 um 21:00:08, Jarod Long via swift-evolution (swift-evolution at swift.org) schrieb:
The only functional limitation that I see is that if you can't have leading whitespace in the interpreted string if you actually want that. That doesn't seem like a very important use case to me, but if we think it is important, it could be supported by something like having a backslash in the leading whitespace at the location where it should be preserved from.
If we're set on the proposed behavior, have we considered what happens if the closing delimiter goes beyond the non-whitespace content of the string?
let string = """
Does it strip the non-whitespace characters? Does it strip up to the non-whitespace characters? Does it generate an error?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution