<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey all,<div class=""><br class=""></div><div class="">I’ve been playing with multi-line string literals recently and was wondering, are the below cases supported intentionally or did they just fall out of the implementation?</div><div class=""><br class=""></div><div class="">1) Nested multi-line strings:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="color: #ba2da2" class="">let</span> x = <span style="color: #d12f1b" class="">"""</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class="">outer multi-line</div><div style="margin: 0px; line-height: normal;" class="">\<span style="color: #d12f1b" class="">(</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class=""><span style="color: #000000" class="">&nbsp; </span>"""</div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class="">&nbsp; &nbsp; inner multiline</div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class="">&nbsp; """</div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class="">)</div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class="">outer multi-line</div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class="">"""</div><div style="margin: 0px; line-height: normal; color: rgb(62, 30, 129);" class="">print<span style="color: #000000" class="">(</span><span style="color: #4f8187" class="">x</span><span style="color: #000000" class="">)</span></div></div></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255);" class=""><br class=""></div><div class=""><br class=""></div><div class="">2) Multi-line strings nested in "single-line" strings:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27); background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="color: #ba2da2" class="">let</span><span style="color: #000000" class=""> x = </span>"outer string <span style="color: #000000" class="">\</span>(<span style="color: #000000" class=""> </span>"""</div><div style="margin: 0px; line-height: normal;" class="">&nbsp; &nbsp; inner multiline</div><div style="margin: 0px; line-height: normal;" class="">&nbsp; """) outer string"</div><div style="margin: 0px; line-height: normal; color: rgb(62, 30, 129);" class="">print<span style="color: #000000" class="">(</span><span style="color: #4f8187" class="">x</span><span style="color: #000000" class="">)</span></div></div></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(62, 30, 129); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class=""><br class=""></span></div><div class="">I’ve been looking at still syntax highlighting strings in the invalid states they pass through while writing or editing them, and trying to keep any changes to the file’s highlighted ranges as localized as possible. At the moment when you open an interpolation in an otherwise terminated multi-line string literal you get one giant &nbsp;unknown token – an unterminated string – from the opening triple quotes, past the ‘closing’ triple quotes (that we treat as nested opening quotes), to the end of the file.</div><div class=""><br class=""></div><div class="">It’d be great to be able to bound the unknown token to what were more likely intended to be closing quotes, so we still produce tokens for (and syntax highlight) the rest of the file. Of course with nesting you can’t be sure they’re closing quotes though, so I wanted to check if the nesting support was intentional.</div><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Nathan</div></body></html>