<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> schrieb am So., 13. Okt. 2019, 08:20:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> 2) For..in loops<br>
><br>
> EParserError: Expected := or in at token "(" in file<br>
> /Users/ryanjoseph/Developer/Projects/FPC/NewEngine/Sources/Examples/EmptyWindow.pas at line 138 column<br>
> 14<br>
> <br>
><br>
> For in loops should be supported, but I've never seen this before:<br>
><br>
> for pointer(entity) in entities do<br>
> <br>
><br>
> What is for pointer(entity) in entities supposed to do ?<br>
><br>
> It can be that this syntax is not supported (no surprise, since I don't have<br>
> a clue what this is supposed to do).<br>
> <br>
> <br>
> Just type casting because the array is an array of pointers. I get these errors otherwise "Incompatible types: got "Pointer"<br>
> expected “TEntity"”. I could use a proper type in a generic array but I don’t always do that.<br>
<br>
I didn't know you could do this in a for in loop. FPC eats this ?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">It currently does, but it might as well be a bug in FPC. I'll have to cross check with Delphi. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
><br>
> begin<br>
> entity.Update;<br>
> entity.Draw(renderer);<br>
> renderer.PushBox(entity.GetHitBox, TRGBA.RedColor);<br>
> end;<br>
><br>
> 3) {$i settings} will not find the file “settings.inc”. This is valid in FPC but the parser seems to<br>
> have other rules.<br>
> <br>
><br>
> They should be the same.<br>
><br>
> As said, pas2js uses fcl-passrc, and pas2js handles inifiles just as FPC<br>
> does.<br>
> <br>
> <br>
> Another bug then. Should I make a bug report for these?<br>
<br>
Not yet.<br>
<br>
I have no idea how you call the parser. Include files most<br>
definitely work: the documentation generator uses fcl-passrc, and the<br>
RTL/FCL is full of include files.<br>
<br>
Probably your invocation of the parser is simply wrong or missing some<br>
arguments.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Could the missing ".inc" be the problem? I have not checked, but it could be that FPC always adds ".inc" if no extension is present. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div></div>