Recent

Author Topic: Tinkering with fcl-passrc  (Read 3642 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Tinkering with fcl-passrc
« on: May 06, 2021, 09:36:33 am »
I've made myself an out-of-tree copy of fcl-passrc from 3.2.0 to play with, with no particular urgency or objective.

If I use the supplied .lpi, I can build pasrewrite without problems, but am disappointed- nay, devastated- :-) to receive errors like

Expected "Semicolon" at token "Identifier otherwise" in file watchRelative.lpr at line 145 column 5 line:145 column:5 file:watchRelative.lpr

and

Exception at 00000000004E2731: EPasWriter:
Writing not yet implemented for TPasImplCaseOf implementation elements.

from perfectly legal code with which the compiler is entirely satisfied.

At that point I turned my attention to test_parser. To make life easy I set up a Lazarus project based on pasrewrite's .lpi, but I'm getting stuck on this line with the indicated error message:

Code: [Select]
procedure GetHiddenModifiers(Mfs:TProcedureModifiers);
  begin
   if pmInline in Mfs then WriteFmt(true,'inline;',false);
   if pmAssembler in Mfs then WriteFmt(true,'assembler;',false);
   if pmVarargs in Mfs then WriteFmt(true,'varargs;',false);     // <================
   if pmCompilerProc in Mfs then WriteFmt(true,'compilerproc;',false);
  end;

test_parser.pp(1305,7) Error: Identifier not found "pmVarargs"

Does anybody have an idiot's guide to getting this built out-of-tree and testable?

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9353
  • FPC developer.
Re: Tinkering with fcl-passrc
« Reply #1 on: May 06, 2021, 10:10:20 am »
I don't know its error handling that well (since for fpdoc it is mostly irrelevant, since the code it processes is supposed to compile)

But the gap between 3.2.0 and trunk is enormous for fcl-passrc . I believe 3.2.0 is roughly trunk state early 2020, 3.2.2 will contain the trunk state september 2020, and there are already 142 commits past that.

So in short: for relevance, use trunk :)
« Last Edit: May 06, 2021, 11:29:59 am by marcov »

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Re: Tinkering with fcl-passrc
« Reply #2 on: May 06, 2021, 10:13:33 am »
Will build trunk later today and report back, thanks :-)

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9353
  • FPC developer.
Re: Tinkering with fcl-passrc
« Reply #3 on: May 06, 2021, 11:30:45 am »
Note that trunk fcl-passrc might build fine with 3.2.x.

If 3.2.2 is released and we are still using SVN, I'll sync fcl-passrc and pas2js again with trunk.

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Re: Tinkering with fcl-passrc
« Reply #4 on: May 07, 2021, 05:52:02 pm »
Built trunk which describes itself as 3.3.1 and installed it:

/usr/local/src/fcl-passrc/examples$ fpc -i
Free Pascal Compiler version 3.3.1

Compiler date      : 2021/05/07
Compiler CPU target: x86_64
...


I've copied fcl-passrc out-of-tree so that I can tinker with it, I can compile pasrewrite but not test_parser.

/usr/local/src/fcl-passrc/examples$ fpc pasrewrite.pp
Free Pascal Compiler version 3.3.1 [2021/05/07] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling pasrewrite.pp
Linking pasrewrite
482 lines compiled, 0.6 sec, 924208 bytes code, 512200 bytes data

/usr/local/src/fcl-passrc/examples$ fpc test_parser.pp
Free Pascal Compiler version 3.3.1 [2021/05/07] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test_parser.pp
test_parser.pp(264,3) Warning: Case statement does not handle all possible cases
test_parser.pp(316,4) Warning: Case statement does not handle all possible cases
test_parser.pp(295,4) Warning: Case statement does not handle all possible cases
test_parser.pp(1028,3) Warning: Case statement does not handle all possible cases
test_parser.pp(1290,4) Warning: Case statement does not handle all possible cases
test_parser.pp(1305,7) Error: Identifier not found "pmVarargs"
test_parser.pp(1446,21) Error: Identifier not found "okGeneric"
test_parser.pp(1893,12) Warning: Symbol "ParseSource" is deprecated: "use version with options"
test_parser.pp(1970) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode

Can also build parsepp, the description implies that testunit1 is a test file rather than useful program.

Any thoughts or suggestions would be appreciated.

MarkMLl

Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9353
  • FPC developer.
Re: Tinkering with fcl-passrc
« Reply #5 on: May 07, 2021, 09:00:34 pm »
What can I say ?

Code: Pascal  [Select][+][-]
  1. Free Pascal Compiler version 3.3.1 [2021/04/22] for i386
  2. Copyright (c) 1993-2021 by Florian Klaempfl and others
  3. Target OS: Win32 for i386
  4. Compiling pasrewrite.pp
  5. Linking pasrewrite.exe
  6. 482 lines compiled, 0.5 sec, 396224 bytes code, 12788 bytes data
  7.  

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Re: Tinkering with fcl-passrc
« Reply #6 on: May 07, 2021, 09:20:51 pm »
Err... rather a lot by the looks of it :-)

How on Earth did /that/ happen... it was from trunk svn. More in the morning :-/

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Re: Tinkering with fcl-passrc
« Reply #7 on: May 08, 2021, 10:14:05 am »
I've just worked though it again. My trunk build /did/ have problems but I've redone from scratch, but I still get

Code: Text  [Select][+][-]
  1. /usr/local/src/fcl-passrc/examples$ fpc test_parser.pp
  2. Free Pascal Compiler version 3.3.1 [2021/05/08] for x86_64
  3. Copyright (c) 1993-2021 by Florian Klaempfl and others
  4. Target OS: Linux for x86-64
  5. Compiling test_parser.pp
  6. test_parser.pp(264,3) Warning: Case statement does not handle all possible cases
  7. test_parser.pp(316,4) Warning: Case statement does not handle all possible cases
  8. test_parser.pp(295,4) Warning: Case statement does not handle all possible cases
  9. test_parser.pp(1028,3) Warning: Case statement does not handle all possible cases
  10. test_parser.pp(1290,4) Warning: Case statement does not handle all possible cases
  11. test_parser.pp(1305,7) Error: Identifier not found "pmVarargs"
  12. test_parser.pp(1446,21) Error: Identifier not found "okGeneric"
  13. test_parser.pp(1893,12) Warning: Symbol "ParseSource" is deprecated: "use version with options"
  14. test_parser.pp(1970) Fatal: There were 2 errors compiling module, stopping
  15. Fatal: Compilation aborted
  16. Error: /usr/local/bin/ppcx64 returned an error exitcode

Also

Code: Text  [Select][+][-]
  1. /usr/local/src/fcl-passrc/examples$ fpc -vt test_parser.pp | grep -v 'not found' | grep -v Unitsearch | grep -v ^Using
  2. Configfile search: /home/markMLl/.fpc.cfg
  3. Configfile search: /usr/local/lib/fpc/etc/fpc.cfg
  4. Configfile search: /etc/fpc.cfg
  5. Reading options from file /etc/fpc.cfg
  6. Free Pascal Compiler version 3.3.1 [2021/05/08] for x86_64
  7. Copyright (c) 1993-2021 by Florian Klaempfl and others
  8. Searching file /lib64/ld-linux-x86-64.so.2... found
  9. Compiler: /usr/local/lib/fpc/3.3.1/ppcx64
  10. Target OS: Linux for x86-64
  11. Compiling test_parser.pp
  12. Searching file test_parser.pp... found
  13. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/system.ppu... found
  14. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/system.ppu
  15. Searching file test_parser.pp... found
  16. Searching file test_parser.pp... found
  17. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/fpintres.ppu... found
  18. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/fpintres.ppu
  19. Searching file test_parser.pp... found
  20. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/objpas.ppu... found
  21. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/objpas.ppu
  22. Searching file test_parser.pp... found
  23. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/sysutils.ppu... found
  24. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/sysutils.ppu
  25. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/linux.ppu... found
  26. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/linux.ppu
  27. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/baseunix.ppu... found
  28. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/baseunix.ppu
  29. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/unixtype.ppu... found
  30. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/unixtype.ppu
  31. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/syscall.ppu... found
  32. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/syscall.ppu
  33. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/unix.ppu... found
  34. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/unix.ppu
  35. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/errors.ppu... found
  36. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/errors.ppu
  37. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/sysconst.ppu... found
  38. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/sysconst.ppu
  39. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/unixutil.ppu... found
  40. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/unixutil.ppu
  41. Searching file test_parser.pp... found
  42. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/classes.ppu... found
  43. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/classes.ppu
  44. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/types.ppu... found
  45. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/types.ppu
  46. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/math.ppu... found
  47. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/math.ppu
  48. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/typinfo.ppu... found
  49. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/typinfo.ppu
  50. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/rtlconsts.ppu... found
  51. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/rtlconsts.ppu
  52. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/sortbase.ppu... found
  53. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl/sortbase.ppu
  54. Searching file test_parser.pp... found
  55. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/fcl-passrc/pparser.ppu... found
  56. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/fcl-passrc/pparser.ppu
  57. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/fcl-passrc/pastree.ppu... found
  58. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/fcl-passrc/pastree.ppu
  59. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/fcl-passrc/pscanner.ppu... found
  60. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/fcl-passrc/pscanner.ppu
  61. Searching file /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl-objpas/strutils.ppu... found
  62. PPU Loading /usr/local/lib/fpc/3.3.1/units/x86_64-linux/rtl-objpas/strutils.ppu
  63. Searching file test_parser.pp... found
  64. test_parser.pp(264,3) Warning: Case statement does not handle all possible cases
  65. test_parser.pp(316,4) Warning: Case statement does not handle all possible cases
  66. test_parser.pp(295,4) Warning: Case statement does not handle all possible cases
  67. test_parser.pp(1028,3) Warning: Case statement does not handle all possible cases
  68. test_parser.pp(1290,4) Warning: Case statement does not handle all possible cases
  69. test_parser.pp(1893,12) Warning: Symbol "ParseSource" is deprecated: "use version with options"
  70. test_parser.pp(1970) Fatal: There were 2 errors compiling module, stopping
  71. Fatal: Compilation aborted
  72. Error: /usr/local/bin/ppcx64 returned an error exitcode

where $ ls -l /usr/local/lib/fpc/3.3.1/units/x86_64-linux/fcl-passrc confirms that those files were built during the last hour; trunk was built using 3.2.0 and (as expected) objects to an attempt to do a complete self-build using 3.3.1

MarkMLl





« Last Edit: May 08, 2021, 04:00:48 pm by MarkMLl »
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

lucamar

  • Hero Member
  • *****
  • Posts: 4025
Re: Tinkering with fcl-passrc
« Reply #8 on: May 08, 2021, 11:57:21 am »
Mark, please, use code tags for such long outputs. Help us keep our fingers and wrists nimble :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Re: Tinkering with fcl-passrc
« Reply #9 on: May 08, 2021, 01:29:18 pm »
Mark, please, use code tags for such long outputs. Help us keep our fingers and wrists nimble :)

It wasn't code, it was text output and I used the tt tag.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9353
  • FPC developer.
Re: Tinkering with fcl-passrc
« Reply #10 on: May 08, 2021, 03:06:54 pm »
I updated my SVN, and now it fails here too, so my guess is that the change is relatively recent phenomenon. Probably one of these:

Code: [Select]
r49253 mattias 2021-04-24 12:55:03 +0200 (Sat, 24 Apr 2021)
pastojs: specialize try except on, issue 38795
r49254 mattias 2021-04-24 13:49:01 +0200 (Sat, 24 Apr 2021)
fcl-passrc: started example issue 38784
r49256 mattias 2021-04-24 15:53:28 +0200 (Sat, 24 Apr 2021)
fcl-passrc: started specialize type reference a>b<.c
r49272 mattias 2021-04-26 23:16:28 +0200 (Mon, 26 Apr 2021)
fcl-passrc: fixed (intf as tobject).ClassType, issue 38805

PascalDragon

  • Hero Member
  • *****
  • Posts: 3075
  • Compiler Developer
Re: Tinkering with fcl-passrc
« Reply #11 on: May 08, 2021, 03:18:46 pm »
Mark, please, use code tags for such long outputs. Help us keep our fingers and wrists nimble :)

It wasn't code, it was text output and I used the tt tag.

It's a good style to use code-tags nevertheless, cause this way the forum software will use a scrollable area and thus one can more easily scroll through posts.

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Re: Tinkering with fcl-passrc
« Reply #12 on: May 08, 2021, 04:03:53 pm »
It's a good style to use code-tags nevertheless, cause this way the forum software will use a scrollable area and thus one can more easily scroll through posts.

I'm sorry, it did occur to me after I'd posted that scrolling and the magic "+" button were of course relevant. I've just been tinkering and I notice that code=text and code=plain are accepted and synonymous.

My particular apologies to anybody afflicted with RSI etc. (BT, DT and managed to improve things with postural changes etc.).

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Re: Tinkering with fcl-passrc
« Reply #13 on: May 08, 2021, 07:36:48 pm »
I updated my SVN, and now it fails here too, so my guess is that the change is relatively recent phenomenon. Probably one of these:

Code: [Select]
r49253 mattias 2021-04-24 12:55:03 +0200 (Sat, 24 Apr 2021)
pastojs: specialize try except on, issue 38795
r49254 mattias 2021-04-24 13:49:01 +0200 (Sat, 24 Apr 2021)
fcl-passrc: started example issue 38784
r49256 mattias 2021-04-24 15:53:28 +0200 (Sat, 24 Apr 2021)
fcl-passrc: started specialize type reference a>b<.c
r49272 mattias 2021-04-26 23:16:28 +0200 (Mon, 26 Apr 2021)
fcl-passrc: fixed (intf as tobject).ClassType, issue 38805

Still fails at r49253.

I've got multiple releases on my system, so I'll try working backwards. It has to be somewhere before 3.2.0 got tagged... any idea when that was?

Later: building test_parser.pp, 3.0.2 is OK but 3.0.4 isn't.

MarkMLl
« Last Edit: May 08, 2021, 09:11:26 pm by MarkMLl »
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 2734
Re: Tinkering with fcl-passrc
« Reply #14 on: May 17, 2021, 11:09:07 am »
Reported as https://bugs.freepascal.org/view.php?id=38887, now fixed in trunk.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018