In the wake of Delphi 12 support, DWScript just got support for the “triple apostrophe” multi-line string syntax introduced with Delphi 12. This syntax comes in addition to the previously supported multi-line syntaxes.
As there is some degree of ambiguity in the new syntax, the syntax in DWScript is based on my current understanding of what the Delphi 12 doc and parser do.
To summarize all string literals supported by DWScript:
- ‘ (single quote, aka apostrophe), when not followed by two apostrophes and a new line. This is the classic Pascal string, single apostrophes can be escaped by doubling them.
- ”’ (triple single quote, aka triple apostrophe), must be followed by a new line, and is closed by a newline followed by a triple apostrophe, indentation (as defined by the closing triple apostrophe) is removed. Triple apostrophes are not allowed in the content and cannot be escaped.
- ” (double quote), multi-line string with no indent removal. Double quotes can be escaped by doubling them.
- #’ and #”, multi-line strings, common indentation is removed. The single or double quote can be escaped by doubling it.
DWScript did not have a literal string length limitation, so not change there.