Browse Source

+ Added warning if docnode not found (option --warn-no-node

michael 21 years ago
parent
commit
58e76bd37a
2 changed files with 24 additions and 3 deletions
  1. 18 2
      utils/fpdoc/dglobals.pp
  2. 6 1
      utils/fpdoc/fpdoc.pp

+ 18 - 2
utils/fpdoc/dglobals.pp

@@ -211,6 +211,7 @@ type
     HasContentFile: Boolean;
     HasContentFile: Boolean;
     HidePrivate: Boolean;	// Hide private class members in output?
     HidePrivate: Boolean;	// Hide private class members in output?
     HideProtected: Boolean;	// Hide protected class members in output?
     HideProtected: Boolean;	// Hide protected class members in output?
+    WarnNoNode : Boolean;       // Warn if no description node found for element.
   end;
   end;
 
 
 
 
@@ -963,7 +964,10 @@ var
   PackageDocNode, TopicNode,ModuleDocNode: TDocNode;
   PackageDocNode, TopicNode,ModuleDocNode: TDocNode;
   
   
 begin
 begin
+  Writeln('Reading',AFileName);
   ReadXMLFile(Doc, AFilename);
   ReadXMLFile(Doc, AFilename);
+  if (Doc=nil) then
+    Writeln('Failed to read ',AFileName);
   DescrDocs.Add(Doc);
   DescrDocs.Add(Doc);
   DescrDocNames.Add(AFilename);
   DescrDocNames.Add(AFilename);
 
 
@@ -1018,10 +1022,17 @@ function TFPDocEngine.FindDocNode(AElement: TPasElement): TDocNode;
 begin
 begin
   Result:=Nil;
   Result:=Nil;
   If Assigned(AElement) then
   If Assigned(AElement) then
+    begin
     if AElement.InheritsFrom(TPasUnresolvedTypeRef) then
     if AElement.InheritsFrom(TPasUnresolvedTypeRef) then
       Result := FindDocNode(AElement.GetModule, AElement.Name)
       Result := FindDocNode(AElement.GetModule, AElement.Name)
     else
     else
       Result := RootDocNode.FindChild(AElement.PathName);
       Result := RootDocNode.FindChild(AElement.PathName);
+    if (Result=Nil) and 
+       WarnNoNode and
+       (Length(AElement.PathName)>0) and 
+       (AElement.PathName[1]='#') then
+      Writeln('No documentation node found for identifier : ',AElement.PathName);
+    end;  
 end;
 end;
 
 
 function TFPDocEngine.FindDocNode(ARefModule: TPasModule;
 function TFPDocEngine.FindDocNode(ARefModule: TPasModule;
@@ -1105,6 +1116,8 @@ begin
     if TDOMDocument(DescrDocs[i]) = ExElement.OwnerDocument then
     if TDOMDocument(DescrDocs[i]) = ExElement.OwnerDocument then
     begin
     begin
       Result := ExtractFilePath(DescrDocNames[i]) + ExElement['file'];
       Result := ExtractFilePath(DescrDocNames[i]) + ExElement['file'];
+      if (ExtractFileExt(Result)='') then
+        Result:=Result+'.pp';
       exit;
       exit;
     end;
     end;
   SetLength(Result, 0);
   SetLength(Result, 0);
@@ -1136,7 +1149,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2004-06-06 10:53:02  michael
+  Revision 1.4  2004-08-28 18:03:23  michael
+  + Added warning if docnode not found (option --warn-no-node
+
+  Revision 1.3  2004/06/06 10:53:02  michael
   + Added Topic support
   + Added Topic support
 
 
   Revision 1.2  2003/11/28 12:51:37  sg
   Revision 1.2  2003/11/28 12:51:37  sg
@@ -1170,4 +1186,4 @@ end.
 
 
   Revision 1.6  2001/12/17 22:16:02  sg
   Revision 1.6  2001/12/17 22:16:02  sg
   * Added TFPDocEngine.HideProtected
   * Added TFPDocEngine.HideProtected
-}
+}

+ 6 - 1
utils/fpdoc/fpdoc.pp

@@ -99,6 +99,8 @@ begin
     CmdLineAction := actionHelp
     CmdLineAction := actionHelp
   else if s = '--hide-protected' then
   else if s = '--hide-protected' then
     Engine.HideProtected := True
     Engine.HideProtected := True
+  else if s = '--warn-no-node' then
+    Engine.WarnNoNode := True
   else if s = '--show-private' then
   else if s = '--show-private' then
     Engine.HidePrivate := False
     Engine.HidePrivate := False
   else
   else
@@ -305,7 +307,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2003-10-08 11:41:54  yuri
+  Revision 1.5  2004-08-28 18:03:23  michael
+  + Added warning if docnode not found (option --warn-no-node
+
+  Revision 1.4  2003/10/08 11:41:54  yuri
   + Initial OS/2 IPF support added
   + Initial OS/2 IPF support added
 
 
   Revision 1.3  2003/03/27 17:14:13  sg
   Revision 1.3  2003/03/27 17:14:13  sg