[fpc-devel] Some thoughts on multi-line string support, and a possible syntax that I think is perfectly clean and Pascal-ish.

Sven Barth pascaldragon at googlemail.com
Wed Jul 3 23:48:47 CEST 2019


Am 03.07.2019 um 22:20 schrieb Ben Grasset:
> On Wed, Jul 3, 2019 at 3:27 PM gabor <gabor at poczta.onet.pl 
> <mailto:gabor at poczta.onet.pl>> wrote:
>
>     I am also against this
>
>
> program Example;
>
> (*
>   This is a perfectly
>   normal multi-line
>   Pascal comment.
> *)
>
> const SA = `
>   This is a multiline
>   string using hypothetical backticks.
>   Imagine it was fully syntax-highlighted
>   like normal strings and the comment
>   above are.
> `;
>
> const SB =
> ' This is a multiline' + sLineBreak +
> ' string using the current syntax.' + sLineBreak +
> ' Do you really' + sLineBreak +
> ' find this to be' + sLineBreak +
> ' more readable?';
>
> begin
> end.
In case case of readability: most cases of multi line string constants 
are likely to be embedded scripts (shaders, SQL, whatever) and thus the 
$INCLUDESTRING directive mentioned in the bug report is much more 
useable, because it allows you to view the embedded file in its own 
editor together with syntax hightlighting and possibly code completion.

I'm with Michael here: I see no *need* for a separate syntax for a multi 
line string. I see however the need for the ability to include multi 
line text as a string.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190703/5dc617c4/attachment.html>


More information about the fpc-devel mailing list