[fpc-devel] MakeSkel etc. programs

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Dec 15 04:15:12 CET 2011


Michael Van Canneyt schrieb:

>> BTW is it really required to add "-Fi.", so that the parser finds 
>> include files in the current directory (of the unit file)?
> 
> To my knowledge, it should not be necessary ?

MakeSkel currently complains about missing "dw_htmlchm.inc", when 
creating the skeletons for the units in fpdoc\.


>> When I tried to create the skeletons for all *.pas and *.pp files, I 
>> stumbled across exceptions with missing interface sections. It would 
>> be nice to prevent such exceptions, when MakeSkel tries to process an 
>> program file, whereupon AModule.InterfaceSection is Nil!
> 
> makeskel or fpdoc were not designed to be run on programs, so the errors 
> are normal.

Such errors are acceptable when a single unit is processed, but it's not 
nice when a batch of units is stopped before it ends. Such (input) 
errors should not occur frequently, but cannot be omitted easily when 
wildcards are used (e.g. --input-dir in fpdoc).


>>  program MakeSkel;
>> instead of
>>  program *UnitDiff*;
>> Please fix this glitch.
> 
> Fixed and committed. Rev. 19850.

Thanks :-)


>> Now I'll try to further extend MkSkel by using FPDoc projects, so that 
>> the correct input specifications are used, including all compiler 
>> options. Then it will be easy to check the RTL and other packages for 
>> updates, and to create the skeletons for all contained units :-)
> 
> If you do so, and intend to provide a patch, please keep the patch 
> clean. All your other patches were mostly unusable because of all the 
> 'noise' in them, forcing me to re-implement almost from scratch whatever 
> you did.

Hmm, I didn't intend to supply an patch. I tried, however, to allow for 
SVN updates without conflicts, and left the original units as unchanged 
as possible. My "private" changes are enclosed in {$IFDEF DoDi}, which 
should be easy to find and remove.

Now I created an unfiltered patch, which covers the following:

dglobals.pp:
- Added --common-options=value (compiler options common to all input files).
- Added method TFPDocEngine.OutputLog.
- Catch not assigned(CurModule.InterfaceSection), emit warning.

dw_html.pp:
- Log "Now creating file..." (should occur only when verbose).
- Catch and log error in Element.

fpclasschart, unitdiff: nothing but morphing into unit.

fpdoc.pp: (morph into unit)
- Fix Options.ShowPrivate:=True (was False, what seems not to make 
sense). Also the property declaration is a bit weird:
   Property ShowPrivate : Boolean Read FHidePrivate Write FHidePrivate;
Should the option read --hide-private?
- Added --common-options.
- Added create auto-project, unless invoked with a project.

fpdocproj.pas:
- Added CommonOptions.

fpdocxmlopts.pas:
- Added CommonOptions.

makeskel.pp: (almost evitable)
- Added Engine.OnLog := @Engine.OutputLog; (enable logging in parser)
- Added OnHandleOption (for non-standard options).

mkfpdoc.pp:
- Catch incomplete imports (package without content file).
- If verbose, log "Creating project" (for use with auto-project).


I can try to enclose above optional changes into $IFDEFs, if you like:
   CommonOptions
   AutoProject
   OnHandleOption
   VerboseLog
   CatchErrors
and include only selected files into the patch.

DoDi




More information about the fpc-devel mailing list