PParser fails on "strict private" and types containing function references lazarus / 62-General ---------------------------------------------------------------------- Bogen85 · 2022-10-01 04:01 The following is not understood: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  tCleanupProc = reference to procedure;  tCleanup     = record  strict private    cleaner: tCleanupProc;    class operator finalize (var self: tCleanup);    class operator initialize (var self: tCleanup);  procedure assign (const _cleaner: tCleanupProc);  public    property x: tCleanupProc write assign;    procedure run;  end; It fails on strict private. Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i EParserError: Expected "," or ":" at token "Identifier private" in file src/main.pas at line 15 column 10 It strict private is replaced with private then it fails on cleaner: tCleanupProc; Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i EParserError: Expected "," or ":" at token "Identifier cleaner" in file src/main.pas at line 17 column 5 This is all with Free Pascal Compiler version 3.3.1 [2022/09/26] for x86_64 on Linux. The code in question that contains the above snippet compiles and runs fine. I'll try to put together a complete example extracted from the program in question and file an issue concerning this, as PParser is part of FPC's FCL in fcl-passrc. ---------------------------------------------------------------------- Bogen85 · 2022-10-01 05:37 Well, it also can't parse an interface that starts out with this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TAuto = record The code in question works fine... ---------------------------------------------------------------------- ASerge · 2022-10-01 05:48 Quote from: Bogen85 on October 01, 2022, 06:01:37 amIt fails on strict private. Did you add {$MODESWITCH ADVANCEDRECORDS}? ---------------------------------------------------------------------- Bogen85 · 2022-10-01 06:04 The code question compiles and runs fine without {$MODESWITCH ADVANCEDRECORDS} It is the PParser unit that can't parse it. However, I added {$MODESWITCH ADVANCEDRECORDS}. It compiles and runs as expected, but PParser unit still can't parse it. So far PParser parses every other unit I've thrown at it, except for: types with in themstrict privatetypes with function references in them I filed an issue on the first, types with in them https://gitlab.com/freepascal.org/fpc/source/-/issues/39931 ---------------------------------------------------------------------- PascalDragon · 2022-10-01 17:31 Quote from: Bogen85 on October 01, 2022, 08:04:43 amSo far PParser parses every other unit I've thrown at it, except for: types with in themstrict privatetypes with function references in them I filed an issue on the first, types with in them https://gitlab.com/freepascal.org/fpc/source/-/issues/39931 Please also report issues for the others with example code. ---------------------------------------------------------------------- Bogen85 · 2022-10-01 18:59 Quote from: PascalDragon on October 01, 2022, 07:31:32 pmPlease also report issues for the others with example code. Working on it... Filed one for PParser fails on a record with strict private   https://gitlab.com/freepascal.org/fpc/source/-/issues/39935 I'm finding more problems with record parsing though (for items that work in class parsing).... Quite a few more... Should I file individual bug reports? I would prefer to file one will the all failing cases for records I'm finding. (Where the code with those records is working) ---------------------------------------------------------------------- PascalDragon · 2022-10-03 12:32 Quote from: Bogen85 on October 01, 2022, 08:59:50 pmShould I file individual bug reports? I would prefer to file one will the all failing cases for records I'm finding. (Where the code with those records is working) It should be separate issues as they might have different, underlying causes. ---------------------------------------------------------------------- Bogen85 · 2022-10-03 13:39 Quote from: PascalDragon on October 03, 2022, 02:32:17 pmQuote from: Bogen85 on October 01, 2022, 08:59:50 pmShould I file individual bug reports? I would prefer to file one will the all failing cases for records I'm finding. (Where the code with those records is working) It should be separate issues as they might have different, underlying causes. Alright, it will take a bit longer, but I will get them submitted. I may create one that has ALL the test cases I've found, then create individual reports for each of the issues, referring back to the common one. As I find new  faults, I'll update the common one, and add a submit a new issue, like with the others. Is that acceptable? ---------------------------------------------------------------------- PascalDragon · 2022-10-04 11:57 Quote from: Bogen85 on October 03, 2022, 03:39:40 pmIs that acceptable? No, because each of the issues should have its own test case, after all it might be that one issue takes much longer to solve than another and then either the developer would need to extract a test case anyway or the fixes wouldn't be correctly tested until everything is fixed. ---------------------------------------------------------------------- Bogen85 · 2022-10-04 14:04 Quote from: PascalDragon on October 04, 2022, 01:57:06 pmQuote from: Bogen85 on October 03, 2022, 03:39:40 pmIs that acceptable? No, because each of the issues should have its own test case, after all it might be that one issue takes much longer to solve than another and then either the developer would need to extract a test case anyway or the fixes wouldn't be correctly tested until everything is fixed. Understood! Thanks! I will get to them as I need these items addressed, it will just take a while.