Menu

#38 {$INCLUDE} support

open
TridenT
Parser (17)
5
2012-07-18
2004-11-19
Sparky961
No

First off, this looks like the start of a very useful tool.

The problem I seem to have found is when a source
directory contains non-unit, non-program, non-anything
files that are just a block of code that is $INCLUDEd into
another source file. The said file, in my case, has a .PAS
extension and is thus flagged as an error such as:

Could not convert the unit: Expected program, package,
library, unit

Or

Could not convert the unit: Assertion failure (D:
\Projets\Ex\DelphiCodeToDoc\Source\Parse\BuildParseTre
e.pas, line 522)

I realize that this is bad structure, but I'm forced with
dealing with code that has a 20 year history.

Let me know if I need to elaborate on the problem.

-Brian

Discussion

  • TridenT

    TridenT - 2004-11-20

    Logged In: YES
    user_id=248829

    Brian, if your file is not a unit nor a program, it shouldn't have
    an ".pas" extension, but maybe a ".inc" one.
    I can understand the issue, but the modification I can make
    will depend on what YOU want :
    simply ignore such file without exception.
    Add support for $INCLUDE directive
    * any other idea ?

    Do you really these files in the documentation ? Because in
    the revision to come, you will be able to select which files and
    folders to add/remove, not only the whole root folder.
    I wait some answer from your side.
    TridenT

     
  • Sparky961

    Sparky961 - 2004-11-22

    Logged In: YES
    user_id=1074228

    I agree with you that the source file shouldn't have the .PAS
    extension. I don't know if this is a historical thing, or just plain
    bad coding style but the fact is that I have to deal with this
    code :(

    The idea of changing the extensions is a good one, and would
    require only a small amount of effort on my part. However,
    having the option to choose which files to include sounds
    much better. Even with this change, supporting the $INCLUDE
    directive would still be necessary though.

    So, in short I think that doing the following would solve my
    particular problem:
    - Support $INCLUDE directive
    - Allow selection of which files to process
    - (Optional) detect and mark files that are program/unit/etc. in
    file selection dialog to make selection easier

    I believe this would solve my issue without causing any
    problems with well-written code ;)

    -Brian

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.