[fpc-pascal] Using include files in code tools

Mattias Gaertner nc-gaertnma at netcologne.de
Thu May 7 12:26:53 CEST 2020

On Thu, 7 May 2020 16:26:12 +0700
Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:

> When using code tools I've found that it needs to start from a main
> unit (otherwise other relevant macros may not be set) and then insert
> includes into the source text. This is fine but when I inspect the
> node tree (TCodeTreeNode) how do I know which include a node came
> from?

Nodes are always associated with a Tool. Tool.MainFilename gives the
file, where parsing started.

> I need this information so I can get navigate to the include file AND
> relative text offset into the include file text. 

There are plenty of functions for include files. Can you give an
example what you need?


More information about the fpc-pascal mailing list