On Oct 12, 2019, at 6:43 PM, Michael Van Canneyt <mich...@freepascal.org> wrote:

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.

It’s a bug then? I found another advanced record bug below.



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).

Just type casting because the array is an array of pointers. I get these errors otherwise "Incompatible types: got "Pointer" expected “TEntity"”. I could use a proper type in a generic array but I don’t always do that.

I actually just posted to the list about this earlier.



 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.

Another bug then. Should I make a bug report for these?

Here’s another one I found. No section headers in records?

Expected "," or ":" at token "Identifier IDSize" in file /Users/ryanjoseph/Developer/Projects/FPC/NewEngine/Sources/Base/UImage.pas at line 94 column 4

TGAHeader = packed record
private
IDSize: uint8_t;         // Size of ID info following header
colorMapType: uint8_t;   // Whether this is a paletted image
imageType: uint8_t;      // type of image 0=none, 1=indexed, 2=rgb, 3=grey, +8=rle packed



Regards,
Ryan Joseph

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

Reply via email to