[fpc-devel] Some thoughts on multi-line string support, and a possible syntax that I think is perfectly clean and Pascal-ish.

Sven Barth pascaldragon at googlemail.com
Sat Jul 6 00:48:44 CEST 2019


Am 06.07.2019 um 00:21 schrieb Ryan Joseph:
>
>> On Jul 5, 2019, at 5:45 PM, Ben Grasset <operator97 at gmail.com> wrote:
>>
>> Like, not working in any sense at all? That's definitely not normal.
>>
> I think it’s just the push/pop isn’t working. Just to be clear should the follow code compile? For me I get an error.Try it yourself when you get some time.
>
> {$mode objfpc}
>
> 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.
Ah! Check the location of the error. It's the Writeln, not the 
declaration of the constant. Seems like the compiler doesn't correctly 
handle this case. But to be fair it's really seldom that someone uses $H 
locally, so that's not really a tested situation...

Regards,
Sven


More information about the fpc-devel mailing list