[fpc-devel] Some thoughts on multi-line string support, and a possible syntax that I think is perfectly clean and Pascal-ish.
Ben Grasset
operator97 at gmail.com
Sat Jul 6 18:05:49 CEST 2019
On Sat, Jul 6, 2019 at 11:51 AM Ryan Joseph <genericptr at gmail.com> wrote:
> You can of course shift the strings all the way to the left (which is ugly)
>
Is it though? I think it looks fine, personally, if you place the initial
backtick on the next line after the equal sign, like this:
const MultiLine =
`Sentence one.
Another sentence.
A third sentence.
A fourth sentence.
A fifth sentence.`;
Do keep in mind that I also have working syntax highlighting for this that
I intend to submit as a Lazarus SynEdit patch, which includes the ability
to "fold" a multi-line string as though it were a multi-line comment. Of
course, not everyone uses Lazarus, but many many people do.
In general though I think that using indentation as an actual "argument"
against this is very strange (which I know you were not doing, to be
clear.)
The *most* logical way for it to work (and how it does work currently) is
for the strings to be interpreted by the compiler precisely as they are
written (with the exception of the line endings, which are of course
handled with Michael's directive syntax.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190706/e6ef0dab/attachment-0001.html>
More information about the fpc-devel
mailing list