Docmods Import Tweak

BlitzMax Forums/BlitzMax Module Tweaks/Docmods Import Tweak

Brucey(Posted 2006) [#1]
Greetings :-)

I've hacked docmods to be able to process imports.
What do I mean?

Imagine you have a module with the following :
Import "moredocumentedtypes.bmx"

The current docmods simply skips over the import and you subsequently don't get to see the documentation which resides in that file.

My hack causes the parser to pick up "...bmx" imports, parse those, and add the documentation to the module docs.
Useful if you are fed up with 4000 line .bmx files that you want to split apart yet be able to document properly.

It's only 2 lines to bmxtoker.bmx and about 40 lines to docparser.bmx


So, the question is... what is the best way to distribute it? (should anyone want it...)


kfprimm(Posted 2006) [#2]
post whatever files you modified in this thread.


Brucey(Posted 2006) [#3]
UPDATE : Now also parses included files
Here we are then.
Assuming that Mark doesn't mind the source for these being posted...

The changes made allow docmods to parse .bmx file imports, rather than just process the main .bmx for a module.
This means that you can split the module into separate .bmx files and have it fully documented at the same time.

bmxtoker.bmx


docparser.bmx


Note: the source code for docmods is included with Blitzmax and can be found in the BlitzMax/src folder.

Enjoy :-)


Dreamora(Posted 2006) [#4]
Nice :-)

Hopefully the "damned" miss of parsing of includes is fixed in the near future as well


Brucey(Posted 2006) [#5]
I didn't realise people still used includes.... isn't that just for old blitz backwards compatibility? :-p


Dreamora(Posted 2006) [#6]
No
Its the only way to come around BMs incapability to separate declaration and implementation.

If you have a class a that uses parts of class b and a class b that has a "back reference" (user - owner like) to class a you MUST include them, import will not work due to circle import references.

There is not much you can do about that core design issue ... They better had stolen more from java and C# (package design based not stupid idiotic import approach of C++)


Brucey(Posted 2006) [#7]
I've updated the above code to take into account "include" now.

So now you can put documentation in imported and included source for your modules and it will be included into the module docs...

:o)


Dreamora(Posted 2006) [#8]
Great addition
Thank you :-)

Now I only need to fix up the missing type docmod headers and all should work


dmaz(Posted 2006) [#9]
ok... before I go through the trouble ;) of installing this change I was wondering if I could document my source files from projects? I was thinking I could create a mod that just imported all the files I want to doc.... does that sound like a good or bad idea?


Dreamora(Posted 2006) [#10]
There is no reason not to do it actually ^^


Warren(Posted 2006) [#11]
Just wanted to say thanks for doing this, Brucey! Works like a champ!