Sign in Join

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

Mailing lists / fpc-pascal / 2018-04

Read comments via fcl-passrc

6 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Michael Fuchs

Hi,

while working with fcl-passrc I search for a possibility to get the comments of a source file in the parsed tree.

I found TPasTreeContainer.NeedComments but it does nothing.

Am I missing something or is this not a feature of fcl-passrc?

thanks
Michael

Mattias Gaertner
to Michael Fuchs
Show quoted text 6 lines
Hi, while working with fcl-passrc I search for a possibility to get the comments of a source file in the parsed tree. I found TPasTreeContainer.NeedComments but it does nothing.

Set that to true. Then create the parser.
Read Parser.SavedComments on every CreateElement.

Mattias

Michael Fuchs
to Mattias Gaertner
Mattias Gaertner wrote
> I found TPasTreeContainer.NeedComments but it does nothing. Set that to true. Then create the parser.

Ok, so I can not use the function ParseSource from unit PParser anymore and have to write my own one?

Read Parser.SavedComments on every CreateElement.

Can I save the comments in the DocComment property of every element or is this used somewhere else?

thanks
Michael

Michael Van Canneyt
to Michael Fuchs
Michael Fuchs wrote 12 lines
Am 23.04.2018 um 12:43 schrieb Mattias Gaertner: >> I found TPasTreeContainer.NeedComments but it does nothing. > > Set that to true. Then create the parser. Ok, so I can not use the function ParseSource from unit PParser anymore and have to write my own one? > Read Parser.SavedComments on every CreateElement. Can I save the comments in the DocComment property of every element or is this used somewhere else?

It's normally not used; The idea is to use this in a pasdoc->fpdoc converter.

Michael.

Michalis Kamburelis
to Michael Van Canneyt
Michael Van Canneyt wrote 20 lines
On Mon, 23 Apr 2018, Michael Fuchs wrote: > Am 23.04.2018 um 12:43 schrieb Mattias Gaertner: >>> I found TPasTreeContainer.NeedComments but it does nothing. >> >> Set that to true. Then create the parser. > > Ok, so I can not use the function ParseSource from unit PParser anymore > and have to write my own one? > >> Read Parser.SavedComments on every CreateElement. > > Can I save the comments in the DocComment property of every element or > is this used somewhere else? It's normally not used; The idea is to use this in a pasdoc->fpdoc converter.

Or the PasDoc inplementation itself :) I want to one day migrate PasDoc code to just use fcl-passrc parser. Currently PasDoc uses custom parser, that reads only interface.

Thanks for making this available.

Regards,
Michalis