Browse Source

* synchronized with trunk

git-svn-id: branches/wasm@48359 -
nickysn 4 years ago
parent
commit
dccd4d5b37

+ 1 - 0
.gitattributes

@@ -16765,6 +16765,7 @@ tests/webtbf/tw37476.pp svneol=native#text/pascal
 tests/webtbf/tw37763.pp svneol=native#text/pascal
 tests/webtbf/tw37763.pp svneol=native#text/pascal
 tests/webtbf/tw3790.pp svneol=native#text/plain
 tests/webtbf/tw3790.pp svneol=native#text/plain
 tests/webtbf/tw3812.pp svneol=native#text/plain
 tests/webtbf/tw3812.pp svneol=native#text/plain
+tests/webtbf/tw38287.pp svneol=native#text/pascal
 tests/webtbf/tw38289a.pp svneol=native#text/pascal
 tests/webtbf/tw38289a.pp svneol=native#text/pascal
 tests/webtbf/tw38289b.pp svneol=native#text/pascal
 tests/webtbf/tw38289b.pp svneol=native#text/pascal
 tests/webtbf/tw3930a.pp svneol=native#text/plain
 tests/webtbf/tw3930a.pp svneol=native#text/plain

+ 11 - 9
compiler/aarch64/aasmcpu.pas

@@ -1018,6 +1018,7 @@ implementation
           A_TST,
           A_TST,
           A_FCMP,A_FCMPE,
           A_FCMP,A_FCMPE,
           A_CBZ,A_CBNZ,
           A_CBZ,A_CBNZ,
+          A_PRFM,A_PRFUM,
           A_RET:
           A_RET:
             result:=operand_read;
             result:=operand_read;
           A_STR,A_STUR:
           A_STR,A_STUR:
@@ -1026,14 +1027,6 @@ implementation
             else
             else
               { check for pre/post indexed in spilling_get_operation_type_ref }
               { check for pre/post indexed in spilling_get_operation_type_ref }
               result:=operand_read;
               result:=operand_read;
-          A_STLXP,
-          A_STLXR,
-          A_STXP,
-          A_STXR:
-            if opnr=0 then
-              result:=operand_write
-            else
-              result:=operand_read;
           A_STP:
           A_STP:
             begin
             begin
               if opnr in [0,1] then
               if opnr in [0,1] then
@@ -1102,12 +1095,21 @@ implementation
            A_FCVTZS,
            A_FCVTZS,
            A_SDIV,
            A_SDIV,
            A_SMULL,
            A_SMULL,
+           A_STLXP,
+           A_STLXR,
+           A_STXP,
+           A_STXR,
            A_SUB,
            A_SUB,
+           A_SXTB,
+           A_SXTH,
+           A_SXTW,
            A_UBFIZ,
            A_UBFIZ,
            A_UBFX,
            A_UBFX,
            A_UCVTF,
            A_UCVTF,
            A_UDIV,
            A_UDIV,
-           A_UMULL:
+           A_UMULL,
+           A_UXTB,
+           A_UXTH:
              if opnr=0 then
              if opnr=0 then
                result:=operand_write
                result:=operand_write
              else
              else

+ 3 - 0
compiler/aarch64/cgcpu.pas

@@ -587,6 +587,9 @@ implementation
         manipulated_a: tcgint;
         manipulated_a: tcgint;
         leftover_a: word;
         leftover_a: word;
       begin
       begin
+{$ifdef extdebug}
+        list.concat(tai_comment.Create(strpnew('Generating constant ' + tostr(a))));
+{$endif extdebug}
         case a of
         case a of
           { Small positive number }
           { Small positive number }
           $0..$FFFF:
           $0..$FFFF:

+ 8 - 2
compiler/scanner.pas

@@ -135,6 +135,8 @@ interface
           { if nexttoken<>NOTOKEN, then nexttokenpos holds its filepos }
           { if nexttoken<>NOTOKEN, then nexttokenpos holds its filepos }
           next_filepos   : tfileposinfo;
           next_filepos   : tfileposinfo;
 
 
+          { current macro nesting depth }
+          macro_nesting_depth,
           comment_level,
           comment_level,
           yylexcount     : longint;
           yylexcount     : longint;
           ignoredirectives : TFPHashList; { ignore directives, used to give warnings only once }
           ignoredirectives : TFPHashList; { ignore directives, used to give warnings only once }
@@ -2922,7 +2924,10 @@ type
         if assigned(inputfile.next) then
         if assigned(inputfile.next) then
          begin
          begin
            if inputfile.is_macro then
            if inputfile.is_macro then
-             to_dispose:=inputfile
+             begin
+               to_dispose:=inputfile;
+               dec(macro_nesting_depth);
+             end
            else
            else
              begin
              begin
                to_dispose:=nil;
                to_dispose:=nil;
@@ -3686,6 +3691,7 @@ type
         addfile(hp);
         addfile(hp);
         with inputfile do
         with inputfile do
          begin
          begin
+           inc(macro_nesting_depth);
            setmacro(p,len);
            setmacro(p,len);
          { local buffer }
          { local buffer }
            inputbuffer:=buf;
            inputbuffer:=buf;
@@ -4868,7 +4874,7 @@ type
                  mac:=tmacro(search_macro(pattern));
                  mac:=tmacro(search_macro(pattern));
                  if assigned(mac) and (not mac.is_compiler_var) and (assigned(mac.buftext)) then
                  if assigned(mac) and (not mac.is_compiler_var) and (assigned(mac.buftext)) then
                   begin
                   begin
-                    if yylexcount<max_macro_nesting then
+                    if (yylexcount<max_macro_nesting) and (macro_nesting_depth<max_macro_nesting) then
                      begin
                      begin
                        mac.is_used:=true;
                        mac.is_used:=true;
                        inc(yylexcount);
                        inc(yylexcount);

+ 8 - 2
packages/fcl-db/src/sqldb/sqldb.pp

@@ -802,6 +802,7 @@ type
     Property Proxy : TSQLConnection Read FProxy;
     Property Proxy : TSQLConnection Read FProxy;
   Published
   Published
     Property ConnectorType : String Read FConnectorType Write SetConnectorType;
     Property ConnectorType : String Read FConnectorType Write SetConnectorType;
+    Property Port;
   end;
   end;
 
 
   TSQLConnectionClass = Class of TSQLConnection;
   TSQLConnectionClass = Class of TSQLConnection;
@@ -1197,8 +1198,12 @@ end;
 
 
 procedure TCustomSQLStatement.DeAllocateCursor;
 procedure TCustomSQLStatement.DeAllocateCursor;
 begin
 begin
-  if Assigned(FCursor) and Assigned(Database) then
-    DataBase.DeAllocateCursorHandle(FCursor);
+  if Assigned(FCursor) then
+     begin
+     if Assigned(Database) then
+       DataBase.DeAllocateCursorHandle(FCursor);
+     FreeAndNil(FCursor);
+     end;
 end;
 end;
 
 
 function TCustomSQLStatement.ExpandMacros( OrigSQL : String ) : String;
 function TCustomSQLStatement.ExpandMacros( OrigSQL : String ) : String;
@@ -1515,6 +1520,7 @@ begin
     end;
     end;
   finally;
   finally;
     DeAllocateCursorHandle(Cursor);
     DeAllocateCursorHandle(Cursor);
+    FreeAndNil(Cursor);
   end;
   end;
 end;
 end;
 
 

+ 11 - 0
tests/webtbf/tw38287.pp

@@ -0,0 +1,11 @@
+{$macro on}
+var
+  a,b,s : real;
+
+begin
+  a:=1;
+  b:=2;
+{$define sum:=a+b }
+{$define b:=sum} { DON’T do this !!!}
+  s:=sum;         { Will be infinitely recursively expanded... }
+end.

+ 7 - 2
utils/fpdoc/dw_basehtml.pp

@@ -1012,7 +1012,7 @@ begin
           break;
           break;
         ThisPackage := ThisPackage.NextSibling;
         ThisPackage := ThisPackage.NextSibling;
         end;
         end;
-      if Length(s) = 0 then
+      if (Length(s) = 0) and Assigned(Module) then
         begin
         begin
         { Okay, then we have to try all imported units of the current module }
         { Okay, then we have to try all imported units of the current module }
         UnitList := Module.InterfaceSection.UsesList;
         UnitList := Module.InterfaceSection.UsesList;
@@ -1038,6 +1038,8 @@ begin
     end
     end
   else if Element is TPasEnumValue then
   else if Element is TPasEnumValue then
     s := ResolveLinkID(Element.Parent.PathName)
     s := ResolveLinkID(Element.Parent.PathName)
+  else if Element is TPasAliasType then
+    s := ResolveLinkID(TPasAliasType(Element).DestType.PathName)
   else
   else
     s := ResolveLinkID(Element.PathName);
     s := ResolveLinkID(Element.PathName);
 
 
@@ -1049,7 +1051,10 @@ begin
   else
   else
     begin
     begin
     Result := nil;
     Result := nil;
-    AppendText(Parent, Element.Name); // unresolved items
+    if  Element is TPasAliasType then
+      AppendText(Parent, TPasAliasType(Element).DestType.Name)
+    else
+      AppendText(Parent, Element.Name); // unresolved items
     end;
     end;
 end;
 end;
 
 

+ 32 - 13
utils/fpdoc/dw_html.pp

@@ -1744,7 +1744,6 @@ end;
 procedure THTMLWriter.CreateClassMainPage(aClass : TPasClassType);
 procedure THTMLWriter.CreateClassMainPage(aClass : TPasClassType);
 
 
   procedure AppendGenericTypes(CodeEl : TDomElement; AList : TFPList; isSpecialize : Boolean);
   procedure AppendGenericTypes(CodeEl : TDomElement; AList : TFPList; isSpecialize : Boolean);
-
   Var
   Var
     I : integer;
     I : integer;
   begin
   begin
@@ -1759,6 +1758,16 @@ procedure THTMLWriter.CreateClassMainPage(aClass : TPasClassType);
     AppendSym(CodeEl, '>');
     AppendSym(CodeEl, '>');
   end;
   end;
 
 
+  procedure AppendGeneric(ACodeEl : TDomElement ; AGenericObject: TPasClassType);
+  begin
+    if AGenericObject.GenericTemplateTypes.Count>0 then
+    begin
+      AppendKw(ACodeEl, ' generic ');
+      AppendText(ACodeEl, ' ' + UTF8Decode(AGenericObject.Name) + ' ');
+      AppendGenericTypes(ACodeEl,AGenericObject.GenericTemplateTypes,false);
+    end;
+  end;
+
   procedure AppendInterfaceInfo(ACodeEl : TDomElement ; AThisClass: TPasClassType);
   procedure AppendInterfaceInfo(ACodeEl : TDomElement ; AThisClass: TPasClassType);
   var
   var
     i:Integer;
     i:Integer;
@@ -1777,7 +1786,7 @@ procedure THTMLWriter.CreateClassMainPage(aClass : TPasClassType);
 
 
 var
 var
   ParaEl,TableEl, TREl, TDEl, CodeEl: TDOMElement;
   ParaEl,TableEl, TREl, TDEl, CodeEl: TDOMElement;
-  ThisClass, PrevClass: TPasClassType;
+  ThisClass, PrevClass: TPasType;
   ThisTreeNode: TPasElementNode;
   ThisTreeNode: TPasElementNode;
 begin
 begin
   //WriteLn('@ClassPageBody.CreateMainPage Class=', AClass.Name);
   //WriteLn('@ClassPageBody.CreateMainPage Class=', AClass.Name);
@@ -1799,11 +1808,14 @@ begin
   TDEl := CreateTD(TREl);
   TDEl := CreateTD(TREl);
   CodeEl := CreateCode(CreatePara(TDEl));
   CodeEl := CreateCode(CreatePara(TDEl));
   AppendKw(CodeEl, 'type');
   AppendKw(CodeEl, 'type');
+
+  if not Assigned(AClass.GenericTemplateTypes) then
+      Dolog('ERROR generic init: %s', [AClass.name]);
   if AClass.GenericTemplateTypes.Count>0 then
   if AClass.GenericTemplateTypes.Count>0 then
-    AppendKw(CodeEl, ' generic ');
-  AppendText(CodeEl, ' ' + UTF8Decode(AClass.Name) + ' ');
-  if AClass.GenericTemplateTypes.Count>0 then
-    AppendGenericTypes(CodeEl,AClass.GenericTemplateTypes,false);
+    AppendGeneric(CodeEl, AClass)
+  else
+    AppendText(CodeEl, ' ' + UTF8Decode(AClass.Name) + ' ');
+
   AppendSym(CodeEl, '=');
   AppendSym(CodeEl, '=');
   AppendText(CodeEl, ' ');
   AppendText(CodeEl, ' ');
   AppendKw(CodeEl, UTF8Decode(ObjKindNames[AClass.ObjKind]));
   AppendKw(CodeEl, UTF8Decode(ObjKindNames[AClass.ObjKind]));
@@ -1816,16 +1828,23 @@ begin
   else
   else
     ThisTreeNode := TreeClass.GetPasElNode(AClass);
     ThisTreeNode := TreeClass.GetPasElNode(AClass);
   if not Assigned(ThisTreeNode) Then
   if not Assigned(ThisTreeNode) Then
-    DoLog('EROOR Tree Class information: '+ThisClass.PathName);
+    DoLog('ERROR Tree Class information: '+ThisClass.PathName);
 
 
   if Assigned(AClass.AncestorType) then
   if Assigned(AClass.AncestorType) then
   begin
   begin
     AppendSym(CodeEl, '(');
     AppendSym(CodeEl, '(');
     // Show parent class information
     // Show parent class information
-    //TODO: Specialized generic classes is not processed now.
-    //      TLazFixedRoundBufferListMemBase as example
-    AppendHyperlink(CodeEl, AClass.AncestorType);
-    AppendInterfaceInfo(CodeEl, AClass);
+    if (AClass.AncestorType is TPasSpecializeType) then
+    begin
+      AppendText(CodeEl, 'specialize ');
+      AppendHyperlink(CodeEl, TPasSpecializeType(AClass.AncestorType).DestType);
+      AppendText(CodeEl, '<,>');
+    end
+    else
+    begin
+      AppendHyperlink(CodeEl, AClass.AncestorType);
+      AppendInterfaceInfo(CodeEl, AClass);
+    end;
     AppendSym(CodeEl, ')');
     AppendSym(CodeEl, ')');
   end;
   end;
   // Class members
   // Class members
@@ -1847,8 +1866,8 @@ begin
 
 
     // Show class item
     // Show class item
     AppendHyperlink(CodeEl, ThisClass);
     AppendHyperlink(CodeEl, ThisClass);
-    if Assigned(PrevClass) then // Interfaces from prevClass
-      AppendInterfaceInfo(CodeEl, PrevClass);
+    if Assigned(PrevClass) and (PrevClass Is TPasClassType)  then // Interfaces from prevClass
+      AppendInterfaceInfo(CodeEl, TPasClassType(PrevClass));
     AppendShortDescrCell(TREl, ThisClass);
     AppendShortDescrCell(TREl, ThisClass);
 
 
     if Assigned(ThisTreeNode) then
     if Assigned(ThisTreeNode) then

+ 5 - 5
utils/fpdoc/dw_markdown.pp

@@ -421,7 +421,7 @@ begin
           break;
           break;
         ThisPackage := ThisPackage.NextSibling;
         ThisPackage := ThisPackage.NextSibling;
         end;
         end;
-      if Length(s) = 0 then
+      if (Length(s) = 0) and Assigned(Module) then
         begin
         begin
         { Okay, then we have to try all imported units of the current module }
         { Okay, then we have to try all imported units of the current module }
         UnitList := Module.InterfaceSection.UsesList;
         UnitList := Module.InterfaceSection.UsesList;
@@ -1577,7 +1577,7 @@ procedure TMarkdownWriter.CreateClassMainPage(aClass : TPasClassType);
 var
 var
   i: Integer;
   i: Integer;
   ThisInterface,
   ThisInterface,
-  ThisClass: TPasClassType;
+  ThisClass: TPasType;
   ThisTreeNode: TPasElementNode;
   ThisTreeNode: TPasElementNode;
   DocNode: TDocNode;
   DocNode: TDocNode;
 
 
@@ -1627,12 +1627,12 @@ begin
     // Show class item
     // Show class item
     if Assigned(ThisClass) Then
     if Assigned(ThisClass) Then
       AppendHyperlink(ThisClass);
       AppendHyperlink(ThisClass);
-    if Assigned(ThisClass) and (ThisClass.Interfaces.count>0) then
+    if Assigned(ThisClass) and (AClass.Interfaces.count>0) then
       begin
       begin
       AppendText('(');
       AppendText('(');
-      for i:=0 to ThisClass.interfaces.count-1 do
+      for i:=0 to AClass.interfaces.count-1 do
         begin
         begin
-        ThisInterface:=TPasClassType(ThisClass.Interfaces[i]);
+        ThisInterface:= TPasType(AClass.Interfaces[i]);
         if I>0 then
         if I>0 then
           AppendText(', ');
           AppendText(', ');
         AppendHyperlink( ThisInterface);
         AppendHyperlink( ThisInterface);

+ 55 - 4
utils/fpdoc/dwriter.pp

@@ -256,6 +256,8 @@ Type
     FModule: TPasModule;
     FModule: TPasModule;
     FPageInfos: TFPObjectList;     // list of TPageInfo objects
     FPageInfos: TFPObjectList;     // list of TPageInfo objects
     FLinkUnresolvedCnt: Integer;
     FLinkUnresolvedCnt: Integer;
+    FOutputPageNames: TStringList;
+    function GetOutputPageNames: TStrings;
     function GetPageCount: Integer;
     function GetPageCount: Integer;
     function LinkFix(ALink:String):String;
     function LinkFix(ALink:String):String;
   Protected
   Protected
@@ -286,6 +288,7 @@ Type
     function  ModuleHasClasses(AModule: TPasModule): Boolean;
     function  ModuleHasClasses(AModule: TPasModule): Boolean;
     // Allocate pages etc.
     // Allocate pages etc.
     Procedure DoWriteDocumentation; override;
     Procedure DoWriteDocumentation; override;
+    Function MustGeneratePage(aFileName : String) : Boolean; virtual;
 
 
     Property PageInfos : TFPObjectList Read FPageInfos;
     Property PageInfos : TFPObjectList Read FPageInfos;
     Property SubPageNames: Boolean Read FSubPageNames;
     Property SubPageNames: Boolean Read FSubPageNames;
@@ -298,6 +301,7 @@ Type
     Property Module: TPasModule  Read FModule Write FModule;
     Property Module: TPasModule  Read FModule Write FModule;
     Property CurDirectory: String Read FCurDirectory Write FCurDirectory;    // relative to curdir of process
     Property CurDirectory: String Read FCurDirectory Write FCurDirectory;    // relative to curdir of process
     property BaseDirectory: String read FBaseDirectory Write FBaseDirectory; // relative path to package base directory
     property BaseDirectory: String read FBaseDirectory Write FBaseDirectory; // relative path to package base directory
+    Property OutputPageNames : TStrings Read GetOutputPageNames;
  end;
  end;
 
 
   TFPDocWriterClass = Class of TFPDocWriter;
   TFPDocWriterClass = Class of TFPDocWriter;
@@ -328,7 +332,7 @@ function SortPasElements(Item1, Item2: Pointer): Integer;
 
 
 implementation
 implementation
 
 
-uses fpdocstrs;
+uses strutils, fpdocstrs;
 
 
 function SortPasElements(Item1, Item2: Pointer): Integer;
 function SortPasElements(Item1, Item2: Pointer): Integer;
 begin
 begin
@@ -418,6 +422,16 @@ begin
   Result := PageInfos.Count;
   Result := PageInfos.Count;
 end;
 end;
 
 
+function TMultiFileDocWriter.GetOutputPageNames: TStrings;
+begin
+  If (FoutputPageNames=Nil) then
+    begin
+    FOutputPageNames:=TStringList.Create;
+    FOutputPageNames.Sorted:=True;
+    end;
+  Result:=FOutputPageNames;
+end;
+
 procedure TMultiFileDocWriter.OutputResults();
 procedure TMultiFileDocWriter.OutputResults();
 begin
 begin
   DoLog('Unresolved links: %d', [FLinkUnresolvedCnt]);
   DoLog('Unresolved links: %d', [FLinkUnresolvedCnt]);
@@ -826,22 +840,59 @@ begin
      with TPageInfo(PageInfos[i]) do
      with TPageInfo(PageInfos[i]) do
        begin
        begin
        FileName:= Allocator.GetFilename(Element, SubpageIndex);
        FileName:= Allocator.GetFilename(Element, SubpageIndex);
-       FinalFilename := GetFileBaseDir(Engine.Output) + FileName;
-       CreatePath(FinalFilename);
-       WriteDocPage(FileName,ELement,SubPageIndex);
+       if MustGeneratePage(FileName) then
+         begin
+         FinalFilename := GetFileBaseDir(Engine.Output) + FileName;
+         CreatePath(FinalFilename);
+         WriteDocPage(FileName,ELement,SubPageIndex);
+         end;
        end;
        end;
 end;
 end;
 
 
+function TMultiFileDocWriter.MustGeneratePage(aFileName: String): Boolean;
+begin
+  Result:=Not Assigned(FOutputPageNames);
+  if Not Result then
+    Result:=FOutputPageNames.IndexOf(aFileName)<>-1;
+  Writeln(afilename ,': ',result);
+end;
+
 class procedure TMultiFileDocWriter.Usage(List: TStrings);
 class procedure TMultiFileDocWriter.Usage(List: TStrings);
 begin
 begin
   List.AddStrings(['--use-subpagenames', SUsageSubNames]);
   List.AddStrings(['--use-subpagenames', SUsageSubNames]);
+  List.AddStrings(['--only-pages=LIST', SUsageOnlyPages]);
 end;
 end;
 
 
 function TMultiFileDocWriter.InterPretOption(const Cmd, Arg: String): boolean;
 function TMultiFileDocWriter.InterPretOption(const Cmd, Arg: String): boolean;
+
+Var
+  I : Integer;
+  FN : String;
+
 begin
 begin
+  Writeln('Cmd : ',Cmd);
   Result := True;
   Result := True;
   if Cmd = '--use-subpagenames' then
   if Cmd = '--use-subpagenames' then
     FSubPageNames:= True
     FSubPageNames:= True
+  else
+  if Cmd = '--only-pages' then
+    begin
+    Result:=Arg<>'';
+    if Result then
+      begin
+      if Arg[1]='@' then
+        begin
+        FN:=Copy(Arg,2,Length(Arg)-1);
+        OutputPageNames.LoadFromFile(FN);
+        end
+      else
+        begin
+        For I:=1 to WordCount(Arg,[',']) do
+          OutputPageNames.Add(ExtractWord(I,Arg,[',']));
+        end;
+      Writeln('OutputPagenames ',OutputPagenames.CommaText);
+      end
+    end
   else
   else
     Result:=inherited InterPretOption(Cmd, Arg);
     Result:=inherited InterPretOption(Cmd, Arg);
 end;
 end;

+ 2 - 2
utils/fpdoc/fpdoc.lpi

@@ -158,8 +158,8 @@
       </Debugging>
       </Debugging>
     </Linking>
     </Linking>
     <Other>
     <Other>
-      <CustomOptions Value="-dCheckPasTreeRefCount
--dDebugRefCount"/>
+      <CustomOptions Value="-dCheckPasTreeRefCountx
+-dDebugRefCountx"/>
       <OtherDefines Count="1">
       <OtherDefines Count="1">
         <Define0 Value="CheckPasTreeRefCount"/>
         <Define0 Value="CheckPasTreeRefCount"/>
       </OtherDefines>
       </OtherDefines>

+ 23 - 11
utils/fpdoc/fpdocclasstree.pp

@@ -16,17 +16,17 @@ Type
 
 
   TPasElementNode = Class
   TPasElementNode = Class
   Private
   Private
-    FElement : TPasClassType;
+    FElement : TPasType;
     FParentNode: TPasElementNode;
     FParentNode: TPasElementNode;
     FChildren : TFPObjectList;
     FChildren : TFPObjectList;
     function GetChild(aIndex : Integer): TPasElementNode;
     function GetChild(aIndex : Integer): TPasElementNode;
     function GetChildCount: Integer;
     function GetChildCount: Integer;
   Public
   Public
-    Constructor Create (aElement : TPasClassType);
+    Constructor Create (aElement : TPasType);
     Destructor Destroy; override;
     Destructor Destroy; override;
     Procedure AddChild(C : TPasElementNode);
     Procedure AddChild(C : TPasElementNode);
     Procedure SortChildren;
     Procedure SortChildren;
-    Property Element : TPasClassType Read FElement;
+    Property Element : TPasType Read FElement;
     Property ParentNode : TPasElementNode read  FParentNode;
     Property ParentNode : TPasElementNode read  FParentNode;
     Property Children [aIndex : Integer] : TPasElementNode Read GetChild;
     Property Children [aIndex : Integer] : TPasElementNode Read GetChild;
     Property ChildCount : Integer Read GetChildCount;
     Property ChildCount : Integer Read GetChildCount;
@@ -45,7 +45,7 @@ Type
     FRootObjectName : string;
     FRootObjectName : string;
     FRootObjectPathName : string;
     FRootObjectPathName : string;
   Protected
   Protected
-    function AddToList(aElement: TPasClassType): TPasElementNode;
+    function AddToList(aElement: TPasType): TPasElementNode;
   Public
   Public
     Constructor Create(AEngine:TFPDocEngine; APackage : TPasPackage;
     Constructor Create(AEngine:TFPDocEngine; APackage : TPasPackage;
                           AObjectKind : TPasObjKindSet = okWithFields);
                           AObjectKind : TPasObjKindSet = okWithFields);
@@ -85,7 +85,7 @@ begin
     Result:=0
     Result:=0
 end;
 end;
 
 
-constructor TPasElementNode.Create(aElement: TPasClassType);
+constructor TPasElementNode.Create(aElement: TPasType);
 begin
 begin
   FElement:=aElement;
   FElement:=aElement;
 end;
 end;
@@ -154,30 +154,42 @@ begin
   Inherited;
   Inherited;
 end;
 end;
 
 
-function TClassTreeBuilder.AddToList ( aElement: TPasClassType
+function TClassTreeBuilder.AddToList ( aElement: TPasType
   ) : TPasElementNode;
   ) : TPasElementNode;
 
 
 Var
 Var
   aParentNode : TPasElementNode;
   aParentNode : TPasElementNode;
   aName : String;
   aName : String;
+  aElementClass: TPasClassType;
 
 
 begin
 begin
-  Result:= nil;
-  if not (aElement.ObjKind in FObjectKind) then exit;
+  Result:= nil; aElementClass:=nil;
+  if  (aElement is TPasClassType) then
+    aElementClass:= TPasClassType(aElement);
+  if Assigned(aElementClass) and not (aElementClass.ObjKind in FObjectKind) then exit;
+  if not Assigned(aElementClass) and not (aElement is TPasAliasType) then exit;
 
 
   aParentNode:= nil;
   aParentNode:= nil;
   if aElement=Nil then
   if aElement=Nil then
     aName:=FRootObjectName
     aName:=FRootObjectName
+  else if (aElement is TPasAliasType) then
+    aName:=TPasAliasType(aElement).DestType.FullName
   else
   else
     aName:=aElement.PathName;
     aName:=aElement.PathName;
   Result:=TPasElementNode(FElementList.Items[aName]);
   Result:=TPasElementNode(FElementList.Items[aName]);
   if (Result=Nil) then
   if (Result=Nil) then
   begin
   begin
-    if aElement.AncestorType is TPasClassType then
-      aParentNode:=AddToList(aElement.AncestorType as TPasClassType);
+    if Assigned(aElementClass) and (
+        (aElementClass.AncestorType is TPasClassType) or
+        (aElementClass.AncestorType is TPasAliasType)
+                                    ) then
+       aParentNode:=AddToList(aElementClass.AncestorType);
     if not Assigned(aParentNode) then
     if not Assigned(aParentNode) then
       aParentNode:=FRootNode;
       aParentNode:=FRootNode;
-    Result:=TPasElementNode.Create(aElement);
+    if (aElement is TPasAliasType) then
+      Result:=TPasElementNode.Create(TPasAliasType(TPasType(aElement)).DestType)
+    else
+      Result:=TPasElementNode.Create(aElement);
     aParentNode.AddChild(Result);
     aParentNode.AddChild(Result);
     Result.FParentNode := aParentNode;
     Result.FParentNode := aParentNode;
     FElementList.Add(aName,Result);
     FElementList.Add(aName,Result);

+ 1 - 0
utils/fpdoc/fpdocstrs.pp

@@ -189,6 +189,7 @@ resourcestring
   SUsageOption310  = '--write-project=file';
   SUsageOption310  = '--write-project=file';
   SUsageOption320  = '                  Write all command-line options to a project file';
   SUsageOption320  = '                  Write all command-line options to a project file';
   SUsageSubNames   = 'Use the file subnames instead the indexes as postfixes';
   SUsageSubNames   = 'Use the file subnames instead the indexes as postfixes';
+  SUsageOnlyPages  = 'Only write pages in LIST, LIST is comma-separated list of filenames or @filename where the named file contains 1 file per line.';
 
 
   SUsageFormats        = 'The following output formats are supported by this fpdoc:';
   SUsageFormats        = 'The following output formats are supported by this fpdoc:';
   SUsageBackendHelp    = 'Specify an output format, combined with --help to get more help for this backend.';
   SUsageBackendHelp    = 'Specify an output format, combined with --help to get more help for this backend.';