Ok, here's a link to my github fork
<https://github.com/Akira13641/freepascal> implementing the multi-line
string functionality.

It now includes complete support for user-selected line ending settings,
using the directive syntax suggested by Michael.

So, for example, if you view the output of the following program in an
editor that can display the line endings directly:

program Example;

{$H+}
{$MULTILINESTRINGLINEENDING CR}

const A =
`
😊
😊
😊
😊
😊
`;

{$MULTILINESTRINGLINEENDING CRLF}

const B =
`
😊
😊
😊
😊
😊
`;

{$MULTILINESTRINGLINEENDING LF}

const C =
`
😊
😊
😊
😊
😊
`;

{$MULTILINESTRINGLINEENDING PLATFORM}

const D =
`
😊
😊
😊
😊
😊
`;

{$MULTILINESTRINGLINEENDING RAW}

const E =
`
😊
😊
😊
😊
😊
`;

begin
  Write(A);
  Write(B);
  Write(C);
  Write(D);
  Write(E);
end.

you'll see that each string adheres to the setting above it. Note that
"platform" means whatever line ending your operating system uses, and "raw"
means whatever the line endings in the source file itself are. Currently
"raw" is the default.

Once I have a set of proper tests written, I suppose I'll submit a formal
patch to the FPC bugtracker.

>
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to