[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
Thu Jul 4 02:44:12 CEST 2019


On Wed, Jul 3, 2019 at 7:57 PM J. Gareth Moreton <gareth at moreton-family.com>
wrote:

> While I like the idea in principle, one thing that I'm a bit worried about
> is how whitespace is handled, like what counts for a leading or trailing
> space in the string when between lines, since Pascal parsers (and those for
> many other languages) traditionally, I believe, discard everything
> following the last non-whitespace character in a line.  Also, with the
> backtick suggestion, what should one do if they wish to include a control
> character (e.g. a linefeed) or the backtick character itself?
>

I've looked through the sources extensively (and started playing around
with a basic implementation, actually.) FPC doesn't care about anything
other than #13, #10 when it comes to terminating lines, currently.

For the backtick, it just needs to not intentionally error out on #13 and
#10, and instead continue until it hits another backtick.

As far as including the backtick itself, the rough version I have going
accepts it the same way a single-quote literal is currently accepted (which
is to say, if you want a single quote literal, you have to do four of them
in a row. Same applies to the backtick.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190703/4f51eb3f/attachment.html>


More information about the fpc-devel mailing list