[Pas2js] Editing pas2js code in Delphi

Michael Van Canneyt michael at freepascal.org
Sat Aug 1 10:34:08 CEST 2020


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.


More information about the Pas2js mailing list