RomanYankovsky / DelphiAST

Abstract syntax tree builder for Delphi
Mozilla Public License 2.0
271 stars 116 forks source link

Update IIncludeHandler interface #291

Closed RomanYankovsky closed 4 years ago

RomanYankovsky commented 4 years ago

In order to provide more information for IIncludeHandler.GetIncludeFileContent() implementation, I've made few changes.

This is needed in to be able to find .inc files in complex cases.

For example, you include jcl.inc. It's in your search path. So you can easily find it. Then jcl.inc has this line:

{$I jedi\jedi.inc} // Pull in the JCL/J-VCL shared directives

jedi\jedi.inc path is relative to jcl.inc. Thus order to find it, IIncludeHandler implementation needs to know full path to jcl.inc. That's why ParentFileName is passed to GetIncludeFileContent().

Wosi commented 4 years ago

Great! This refactoring was on my to-do-list for a long time. Thanks :-)