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

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Aug 27 00:48:26 CEST 2010


On 26 August 2010 21:17, Marco van de Voort  wrote:
>
> What is the pos() case meant to solve?  If relative link starts with the
> current modules unit name, then try package.relativelink?

Looking at it again... I first created the "if Pos(...) =1
then...else" code - that solved some of the problems. Then with more
testing I noticed more unresolved links and with debugging found out
that the recursive "loop through all modules, then through all
packages" code was never reached. I then tweaked the code with the "if
CanWeExit() then" method.

But looking at it now, I think you might be right. Now that the Result
is correctly checked for and the recursive lookups are reached, the
first "if Pos(...) = 1 then" code might not be needed any more.


> But what if the relative link is to a different unit? I'm not sure, but
> afaik this will break stuff that worked before ?

Have you got an example?  I modified the fpGUI Class documentation
over and over, to try all kinds of links. With package info, with
module info, with no info other than a identifier etc. etc... The
resolve link code seem to work pretty well with all the cases I threw
at it. I obviously tested with know problem cases from RTL and FCL
too.  Every unresolved think I found was manually looked up (it was
pretty handy dumping the AddLabel() parameter values to a text file to
search against.

As you mentioned, I think the only redundant section is maybe the
first "if Pos(..) = 1" block.

I'll double check this at work tomorrow.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list