[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 22:39:36 CEST 2019


On Fri, Jul 5, 2019 at 4:36 PM Ryan Joseph <genericptr at gmail.com> wrote:

> The problem is I was using ObjFPC mode. Works fine in Delphi. A bug?
>
> {$mode objfpc}
> {$modeswitch multilinestrings}
> {$multilinestringlineending crlf}
>
> program test;
>
> {$push}
> {$H+}
> const lines = `
>   #version 150
>
>   uniform sampler2D textures[8];
>   in vec2 vertexTexCoord;
>   in vec4 vertexColor;
>   in float vertexUVMap;
>   out vec4 fragColor;
>
>   void main()
>   {
>     if (vertexUVMap == 255) {
>       fragColor = vertexColor;
>     } else {
>       fragColor = texture(textures[int(vertexUVMap)], vertexTexCoord.st);
>       if (vertexColor.a < fragColor.a) {
>         fragColor.a = vertexColor.a;
>       }
>     }
>   }`;
> {$pop}
>
> begin
>   writeln(lines);
> end.
>

I'll have to look at this later today when I have more free time. I did
however test a variety of things (both typed and untyped constants and
variables, and also literals in function calls, and had no issues.)

Note again that {$modeswitch multilinestrings} does not exist yet, though.
Try putting your directives after "program", not before, also.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190705/8d4093b8/attachment-0001.html>


More information about the fpc-devel mailing list