[fpc-devel] Some thoughts on multi-line string support, and a possible syntax that I think is perfectly clean and Pascal-ish.
Marco van de Voort
fpc at pascalprogramming.org
Thu Jul 4 15:35:37 CEST 2019
Op 2019-07-04 om 15:30 schreef Ben Grasset:
> On Thu, Jul 4, 2019 at 9:14 AM Marco van de Voort
> <fpc at pascalprogramming.org <mailto:fpc at pascalprogramming.org>> wrote:
>
> Take a large pascal file with several strings. Normal, non multi-line
> strings.
>
> Now, as a thought experiment, remove the closing ' from one of the
> strings at the top.
>
> In the case of no multiline string support: error on the line with
> the
> missing closing string comment.
>
>
> That's not even how it works, though. Absolutely nothing is changed
> about the behaviour of "normal" single-line single-quote strings in
> the (again, working!) implementation I have of this.
>
> Multiline strings are explicitly and only opened / closed used
> *backticks*.
>
New magic characters in the scanner. Yeah. Really nice (NOT!)
> Everything about the feature is far more simple than you seem to think
> it is (which is a big part of why I was able to make it work so quickly.)
Anyway, do you miss imagination or so?
const
singleline = ' accidentally not terminated;
// lots of lines
singleline2 = ' `this is a legal string with backticks`';
More information about the fpc-devel
mailing list