Sign in Join

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

Mailing lists / lazarus / 2020-05

R: lazarus Digest, Vol 148, Issue 26

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Simone Tacconi

This new feature would be very useful for me. I hope it can be implemented. In the meantime, what is the hook for comments?

Thanks in advance.

Message: 2
Date: Sun, 17 May 2020 12:46:38 +0200 (CEST)
From: Michael Van Canneyt
To: Simone Tacconi via lazarus
Subject: Re: [Lazarus] Parsing compiler directive with fcl-passrc Message-ID: <alpine.DEB.2.21.2005171244270.28263 at home> Content-Type: text/plain; charset="utf-8"; Format="flowed"

Simone Tacconi wrote 5 lines
I know that in general, compiler directives are processed by the preprocessor before the parser. In my case I use fcl-passrc in a code analysis tool that I am building and I would need to detect directives during parsing.  It's possible?  In the PasTree unit I don't see data structures for comments / directives.  Thanks.

No, it is currently not possible.

There is already a hook for comments.

We could additionally provide a hook that is called whenever a directive is encountered. Then you can create your own structures.

Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200518/51d93b49/attachment.html>

Reply by email

Michael Van Canneyt
Simone Tacconi wrote
This new feature would be very useful for me. I hope it can be implemented. In the meantime, what is the hook for comments?

I was mistaken.

The OnDirective event is already there on TPascalScanner.

The last parsed comment is currently available in parser.LastComment. But I have added an OnComment handler. rev 45415.

Michael.

Show quoted text 30 lines
Thanks in advance. Message: 2 Date: Sun, 17 May 2020 12:46:38 +0200 (CEST) From: Michael Van Canneyt To: Simone Tacconi via lazarus Subject: Re: [Lazarus] Parsing compiler directive with fcl-passrc Message-ID: <alpine.DEB.2.21.2005171244270.28263 at home> Content-Type: text/plain; charset="utf-8"; Format="flowed" On Sun, 17 May 2020, Simone Tacconi via lazarus wrote: > I know that in general, compiler directives are processed by the > preprocessor before the parser. In my case I use fcl-passrc in a code > analysis tool that I am building and I would need to detect directives > during parsing.  It's possible?  In the PasTree unit I don't see data > structures for comments / directives.  Thanks. No, it is currently not possible. There is already a hook for comments. We could additionally provide a hook that is called whenever a directive is encountered. Then you can create your own structures. Michael.

Reply by email