[fpc-pascal] fcl-passrc errors

Michael Van Canneyt michael at freepascal.org
Sun Oct 13 00:43:12 CEST 2019



On Sat, 12 Oct 2019, Ryan Joseph wrote:

> More tests with the parser but it seems like it doesn’t know quite a bit of syntax. Are these not implemented yet?
>
> 1) class operators for records
>
> EParserError: Expected "procedure" at token "operator" in file /Users/ryanjoseph/Developer/Projects/FPC/GLCanvas/GLCanvas.pas at line 115 column 7
>
> class operator TVertex3.= (constref a, b: TVertex3): boolean;
> begin
>  result := (@a = @b);
> end;

This can be.

>
> 2)  For..in loops
>
> EParserError: Expected := or in at token "(" in file /Users/ryanjoseph/Developer/Projects/FPC/NewEngine/Sources/Examples/EmptyWindow.pas at line 138 column 14
>

For in loops should be supported, but I've never seen this before:

>  for pointer(entity) in entities do

What is for pointer(entity) in entities  supposed to do ?

It can be that this syntax is not supported (no surprise, since I don't have
a clue what this is supposed to do).


>    begin
>      entity.Update;
>      entity.Draw(renderer);
>      renderer.PushBox(entity.GetHitBox, TRGBA.RedColor);
>    end;
>
> 3) {$i settings} will not find the file “settings.inc”. This is valid in FPC but the parser seems to have other rules.

They should be the same.

As said, pas2js uses fcl-passrc, and pas2js handles inifiles just as FPC
does.

You must provide valid include path and file resolvers, of course.

Michael.


More information about the fpc-pascal mailing list