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

Michael Van Canneyt michael at freepascal.org
Fri Jul 5 01:39:28 CEST 2019



On Thu, 4 Jul 2019, Ben Grasset wrote:

> On Thu, Jul 4, 2019 at 12:29 PM Michael Van Canneyt <michael at freepascal.org>
> wrote:
>
>> I would think this is a given...
>> After all, they are valid characters in a single line string now, that
>> must be kept
>> for backward compatibility.
>>
>
> One more question in this general regard... what would be the most
> desirable way for the compiler to handle the appearance of a single
> apostrophe inside a multi-line string?

for reasons of symmetry, if
'`' (quote backtick quote) 
is legal, then
`'` (backtick quote backtick)
should also be. I see no point in allowing a normal quote to end a ` string,
as the opposite also does not happen. A backtick also does not end a
single-quoted string.

The backticked string is in all respects the same as a regular string,
except that the single quote delimiter is replaced by a backtick delimiter.

That means that `this is `` a bakcticked string with a backtick in it`
should also work.

if memory serves well, Martin Friebe already pointed this out, and IMO rightly so.

Michael.


More information about the fpc-devel mailing list