<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>possible improvement, one could allow</div><div id="AppleMailSignature">leading spaces before the "data line token"</div><div id="AppleMailSignature">thus enabling indentation, like so</div><div id="AppleMailSignature">{</div><div id="AppleMailSignature">&nbsp; &nbsp; &nbsp; &nbsp;let str =</div><div id="AppleMailSignature">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \\dataaaaaaaaaahgdfhhfdxfg cvcsffggcfg</div><div id="AppleMailSignature">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \\c jggjvhfh fhffhfgxfxgdgfhgj &nbsp;jvhhfhfhcgxgc</div><div id="AppleMailSignature">&nbsp; &nbsp; &nbsp; &nbsp; .</div><div id="AppleMailSignature">&nbsp; &nbsp; &nbsp; &nbsp; .</div><div id="AppleMailSignature">}<br><br>TedvG<div><div><div apple-content-edited="true"><div><div><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);"></span></font></div></div></div></div></div></div><div><br>On 25 Apr 2016, at 20:47, Ted F.A. van Gaalen &lt;<a href="mailto:tedvgiosdev@gmail.com">tedvgiosdev@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">This could be a simple solution:&nbsp;</div><div class=""><br class=""></div><div class="">Starting each line with a special token.</div><div class=""><br class=""></div><div class="">In the example here it is the \\ &nbsp;double-backslash . &nbsp;</div><div class="">when the \\ appears in the first two columns of a source line,&nbsp;</div><div class="">this tells the compiler that it is a data line and that more might follow.</div><div class="">the last line starting with \\ completes the data entry.</div><div class=""><br class=""></div><div class="">Here is an example of a string declaration with some XML</div><div class="">(no escape sequences needed for “)&nbsp;</div><div class="">Of course it could be anything other kind of textual data as well.</div><div class=""><br class=""></div><div class="">let &nbsp;str = &nbsp;<div class=""><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;!DOCTYPE html&gt;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;html&gt;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;body&gt;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;h1&gt;W3Schools Internal Note&lt;/h1&gt;\n</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;div&gt;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;b&gt;To:&lt;/b&gt; &lt;span id="to"&gt;&lt;/span&gt;&lt;br&gt;\n</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;b&gt;From:&lt;/b&gt; &lt;span id="from"&gt;&lt;/span&gt;&lt;br&gt;\n</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;b&gt;Message:&lt;/b&gt; &lt;span id="message"&gt;&lt;/span&gt;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;/div&gt;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\\n</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\&lt;script&gt;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class=""><a href="smb://var" class="">\\var</a> txt, parser, xmlDoc;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class=""><a href="smb://txt" class="">\\txt</a> = "&lt;note&gt;" +</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\"&lt;to&gt;Tove&lt;/to&gt;" +</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class=""><a href="smb://etc" class="">\\etc</a>. this is the last data line.</font></div></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Conditions:&nbsp;</div><div class=""><br class=""></div><div class="">- Every line starting with \\ in first and second column of the line&nbsp;</div><div class="">&nbsp; is &nbsp;treated as a data line.</div><div class="">- All characters behind the \\ are regarded as data, thus note that:</div><div class="">&nbsp; &nbsp; &nbsp;- the “ is not regarded as a string delimiter</div><div class="">&nbsp; &nbsp; &nbsp;- the // chars and whatever follows it are interpreted as data on such a line, not as comment.</div><div class="">&nbsp; &nbsp; &nbsp;- &nbsp;\\ &nbsp;within the data itself are treated as data e.g. this line is valid:</div><div class=""><a href="smb://There" class="">\\There</a> \\ are three backslashes (as data) in this line \\\\ today.</div><div class="">\\</div><div class="">the above data line is empty but is allowed.&nbsp;</div><div class=""><div class=""><br class=""></div><div class="">- Leading and embedded spaces are respected.</div><div class="">- Tabs, Linefeeds etc. can be inserted the usual way using \t \n etc.&nbsp;</div></div><div class=""><div class="">- trailing spaces and line terminators cr lf are ignored, filtered out.</div></div><div class=""><br class=""></div><div class="">let dutchNumbers = &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div class="">\\ een twee drie vier vijf</div><div class=""><br class=""></div><div class="">\\ zes zeven acht negen tien &nbsp;&nbsp;</div><div class=""><a href="smb://these" class="">\\these</a> two data lines are orphans,</div><div class=""><br class=""></div><div class="">Blank lines or other Swift statement lines in-between</div><div class="">breaks a set of \\ data lines&nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">All \\ lines together are treated as one single string literal</div><div class="">and may occur everywhere where “normal” string literals are allowed.</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; // E.g. this if statement would be correct:</div><div class="">&nbsp; &nbsp; // Yes, this would be legal but doesn’t look so great: Indentation not possible here</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;if cars ==&nbsp;</div><div class=""><a href="smb://Ford" class="">\\Ford</a></div><div class="">\\ Delorean</div><div class="">\\ Chevrolet</div><div class="">&nbsp; &nbsp; &nbsp; {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; doSomething()</div><div class="">&nbsp; &nbsp; &nbsp; }</div></div><div class=""><br class=""></div><div class="">An array with 2 string elements:&nbsp;</div><div class=""><br class=""></div><div class="">var ar =</div><div class="">[&nbsp;</div><div class=""><a href="smb://sdkdslkdslkdsldkshfkjdljfsdljkfdshjklfd" class="">\\sdkdslkdslkdsldkshfkjdljfsdljkfdshjklfd</a> dioioioioio \n\nsljkf sdflkf dsl;dfsk sdlfk dfsfkds&nbsp;</div><div class="">\\ sdkdfkdfldkfd fdfldk &nbsp; fdlkfd jkfds &nbsp;hjklfd dsljkf sdflkf dsl;dfsk sdlfk dfsfkds&nbsp;</div><div class="">,</div><div class=""><a href="smb://There" class="">\\There</a> are many ships in the ha</div><div class=""><a href="smb://rbour" class="">\\rbour</a> that are soon sailing away.</div><div class="">]</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I also thought about using “” &nbsp;as token, but this would be interpreted as an empty string.</div><div class="">or “”” but this is an empty string followed by an unclosed string literal.</div><div class=""><br class=""></div><div class="">Should be relatively easy to implement? What y’all think?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Kind Regards</div><div class="">TedvG</div></div></blockquote></body></html>