[fpc-devel] [patch] fpdoc linear writer ResolveLink fix

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Aug 27 14:51:50 CEST 2010

Op 2010-08-27 13:16, Marco van de Voort het geskryf:
> Did you compare html?

Yes, but I used fpGUI documentation only. For RTL, FCL I used LaTex and IPF

> Could you btw explain the logic behind the canweexit hack? I don't fully
> understand why underscores are now equal to points. Won't this cause
> problems for people that use unit names with underscores? 

It's not a hack, just a more accurate check to know when we must exit the
method. Or you don't like the method name - which I think is descriptive of
what it does. ;-)

ALinkDest comes in with the format
ResolveLink always returns something, even if the link was unresolved (in
which case it returs the package name). So simply checking to see if Result
contains a string longer than 0 makes no sense - hence it always exits
before it got to the recursive lookup bit. A simple test: place
System.Writeln([1-4]) calls before each ResolveLink call. It never reaches
the 3rd or 4th iterations.

So why the '.' replacement to '_'? Because ResoveLink returns the link in a
underscore format. So we change ALinkDest (initially passed in value) into
something in the same format as what ResolveLink returns. Then we check to
see if the original string is in the Result variable - if it is, we know we
resolved the link successfully, so we can exit.

Any no it's not a IPF thing, and it doesn't affect unit names with
underscores - fpGUI used underscores in every unit. Generating Latex, IPF
or HTML documentation for fpGUI classes work fine at the moment.

> Specially if users are using whole words like generics_collection or
> something else whose fragments might clash with other identifiers now.

No, it doesn't affect any identifiers I could see. Again, fpGUI uses
underscores in all units, and many classes or types have underscores as
well.  If you know of an issue, please supply and example.

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-devel mailing list