[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:14:39 CEST 2019
Op 2019-07-04 om 15:07 schreef Ben Grasset:
> Multiline strings, like everything in a source file, are exactly what
> you write them as.
>
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.
With multiline string support (just activated the possibility, assume no
multistring lines in the file), error on whatever follows the next ' in
the file.
Exact nature and location of the error depending on whatever is in the
string. Think of fun cases like that the string finds something like
doprocedure (',',',','); and image this happens to you in somebody
other's code.
I hope this makes it clear that whatever decision or syntax the
discussion ends up with, multiline strings should be turned off by
default, and it is wise to only use them in short files. (a kind like
resourcestrings are often also collected in a separate unit).
More information about the fpc-devel
mailing list