[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
Fri Jul 5 07:44:34 CEST 2019


On Thu, Jul 4, 2019 at 1:51 PM Marco van de Voort <fpc at pascalprogramming.org>
wrote:

>
> Op 2019-07-04 om 17:36 schreef Michael Van Canneyt:
> >
> >> Your argument works if you start with a string that's started with a
> >> backtick, but not correctly terminated.
> >
> > To be correct, I think the argument about unterminated line endings
> > needs to be seen for what it is: a nuisance, but not more a nuisance
> > than a mismatched {$IFDEF}.
>
> If $ifdef was a single char token, maybe. And for a trivial feature, not
> a core one, like conditional compiling.
>
> >
> > So the compiler will correctly give an error.
>
> ... but not at or near the place where the mistake is made.
>

I think I can pretty easily make the compiler give an informative error in
the specific case of an odd number of backticks.

Something like "Unterminated multi-line string: opened at line ABC, broken
by unexpected character at line DEF."

I'll work on this next.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190705/88c5c3f2/attachment-0001.html>


More information about the fpc-devel mailing list