Browse Source

* Patch from Reinier Olislagers to update copyright and emit a more friendly message if an input file is not found (bug ID 22639)

git-svn-id: trunk@22078 -
michael 13 years ago
parent
commit
4a9d012d3a
4 changed files with 25 additions and 6 deletions
  1. 2 1
      utils/fpdoc/dglobals.pp
  2. 4 1
      utils/fpdoc/fpdoc.pp
  3. 18 3
      utils/fpdoc/makeskel.pp
  4. 1 1
      utils/fpdoc/testunit.xml

+ 2 - 1
utils/fpdoc/dglobals.pp

@@ -129,7 +129,8 @@ resourcestring
 
 
   STitle           = 'FPDoc - Free Pascal Documentation Tool';
   STitle           = 'FPDoc - Free Pascal Documentation Tool';
   SVersion         = 'Version %s [%s]';
   SVersion         = 'Version %s [%s]';
-  SCopyright       = '(c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, [email protected]';
+  SCopyright1      = '(c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, [email protected]';
+  SCopyright2      = '(c) 2005 - 2012 various FPC contributors';
 
 
   SCmdLineHelp     = 'Usage: %s [options]';
   SCmdLineHelp     = 'Usage: %s [options]';
   SUsageOption010  = '--content         Create content file for package cross-references';
   SUsageOption010  = '--content         Create content file for package cross-references';

+ 4 - 1
utils/fpdoc/fpdoc.pp

@@ -3,6 +3,8 @@
     FPDoc  -  Free Pascal Documentation Tool
     FPDoc  -  Free Pascal Documentation Tool
     Copyright (C) 2000 - 2003 by
     Copyright (C) 2000 - 2003 by
       Areca Systems GmbH / Sebastian Guenther, [email protected]
       Areca Systems GmbH / Sebastian Guenther, [email protected]
+    2005-2012 by
+      various FPC contributors
 
 
     See the file COPYING, included in this distribution,
     See the file COPYING, included in this distribution,
     for details about the copyright.
     for details about the copyright.
@@ -353,7 +355,8 @@ begin
 {$ENDIF}
 {$ENDIF}
   WriteLn(STitle);
   WriteLn(STitle);
   WriteLn(Format(SVersion, [DefFPCVersion, DefFPCDate]));
   WriteLn(Format(SVersion, [DefFPCVersion, DefFPCDate]));
-  WriteLn(SCopyright);
+  WriteLn(SCopyright1);
+  WriteLn(SCopyright2);
   WriteLn;
   WriteLn;
   ParseCommandLine;
   ParseCommandLine;
   if (FWriteProjectFile<>'') then
   if (FWriteProjectFile<>'') then

+ 18 - 3
utils/fpdoc/makeskel.pp

@@ -3,8 +3,13 @@
     FPDoc  -  Free Pascal Documentation Tool
     FPDoc  -  Free Pascal Documentation Tool
     Copyright (C) 2000 - 2003 by
     Copyright (C) 2000 - 2003 by
       Areca Systems GmbH / Sebastian Guenther, [email protected]
       Areca Systems GmbH / Sebastian Guenther, [email protected]
+    2005-2012 by
+      various FPC contributors
 
 
-    * Skeleton XML description file generator
+    * Skeleton XML description file generator.
+    This generator scans Pascal source code for identifiers and emits XML files
+    suitable for further processing with the fpdoc documentation system:
+    users can edit the XML file and add (help) description.
 
 
     See the file COPYING, included in this distribution,
     See the file COPYING, included in this distribution,
     for details about the copyright.
     for details about the copyright.
@@ -28,7 +33,6 @@ uses
 resourcestring
 resourcestring
   STitle = 'MakeSkel - FPDoc skeleton XML description file generator';
   STitle = 'MakeSkel - FPDoc skeleton XML description file generator';
   SVersion = 'Version %s [%s]';
   SVersion = 'Version %s [%s]';
-  SCopyright = '(c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, [email protected]';
   SCmdLineHelp = 'See documentation for usage.';
   SCmdLineHelp = 'See documentation for usage.';
   SCmdLineInvalidOption = 'Ignoring unknown option "%s"';
   SCmdLineInvalidOption = 'Ignoring unknown option "%s"';
   SNoPackageNameProvided = 'Please specify a package name with --package=<name>';
   SNoPackageNameProvided = 'Please specify a package name with --package=<name>';
@@ -188,6 +192,14 @@ Var
 begin
 begin
   Result := AClass.Create(AName, AParent);
   Result := AClass.Create(AName, AParent);
   Result.Visibility:=AVisibility;
   Result.Visibility:=AVisibility;
+  // Let function/procedure arguments and function results
+  // inherit visibility from their parents if visDefault visibility is
+  // specified.
+  // This allows easier text searches on visibility in the resulting XML
+  if (AVisibility=visDefault) and
+    ((Result is TPasArgument) or (Result is TPasResultElement)) then
+    Result.Visibility:=AParent.Visibility;
+
   if AClass.InheritsFrom(TPasModule) then
   if AClass.InheritsFrom(TPasModule) then
     CurModule := TPasModule(Result);
     CurModule := TPasModule(Result);
   // Track this element
   // Track this element
@@ -344,6 +356,8 @@ Var
   N : TDocNode;
   N : TDocNode;
      
      
 begin
 begin
+  if not(FileExists(AFileName)) then
+    raise Exception.CreateFmt('Cannot find source file %s to document.',[AFileName]);
   FNodeList:=TStringList.Create;
   FNodeList:=TStringList.Create;
   Try
   Try
     FEmittedList:=TStringList.Create;
     FEmittedList:=TStringList.Create;
@@ -614,7 +628,8 @@ var
 begin
 begin
   WriteLn(STitle);
   WriteLn(STitle);
   WriteLn(Format(SVersion, [FPCVersion, FPCDate]));
   WriteLn(Format(SVersion, [FPCVersion, FPCDate]));
-  WriteLn(SCopyright);
+  WriteLn(SCopyright1);
+  WriteLn(SCopyright2);
   InitOptions;
   InitOptions;
   Try
   Try
     E:=ParseCommandLine;
     E:=ParseCommandLine;

+ 1 - 1
utils/fpdoc/testunit.xml

@@ -488,7 +488,7 @@ Appears in 2.0
 
 
 <!-- function result Visibility: default -->
 <!-- function result Visibility: default -->
 <element name="OverloadedFunc.Result">
 <element name="OverloadedFunc.Result">
-<short></short>
+<short>Soso</short>
 </element>
 </element>
 
 
 <!-- argument Visibility: default -->
 <!-- argument Visibility: default -->