Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2020-08

Editing pas2js code in Delphi

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hello,

In the early days of pas2js development, I wrote a tool which can create a stub unit: this is a unit that can be parsed and understood by delphi. This unit is of course non-functional: all methods are empty.

But using these units, you can edit pas2js code in Delphi if you so desire: The code completion will work if you add them to the search path of your delphi project.

The pas2js repository changed a couple of times in the early days, and in the changes, the sources of this tool were not moved along, and I forgot all about it.

Yesterday, an issue was submitted to change the pas2js sources to be Delphi-parsable (essentially using $IFDEF all over the place to rip out all non-delphi constructs), and this reminded me of the tool I wrote.

The tool has now been added to the pas2js repository, and is documented here:

https://wiki.freepascal.org/pas2s_stub

It is not perfect, but does a reasonable job of re-creating the classes found in pas2js to something delphi can understand. For some cases a little additional hand-crafting is needed.

Michael.