Browse Source

* Merging revisions 40928,40929,40937,40945,40946 from trunk:
------------------------------------------------------------------------
r40928 | michael | 2019-01-20 12:15:07 +0100 (Sun, 20 Jan 2019) | 1 line

* Remove debug statement
------------------------------------------------------------------------
r40929 | michael | 2019-01-20 12:17:46 +0100 (Sun, 20 Jan 2019) | 1 line

* Remove debug statement
------------------------------------------------------------------------
r40937 | michael | 2019-01-20 14:47:25 +0100 (Sun, 20 Jan 2019) | 1 line

* Fix filename allocator for operators
------------------------------------------------------------------------
r40945 | michael | 2019-01-20 18:56:30 +0100 (Sun, 20 Jan 2019) | 1 line

* Correct options for parsing
------------------------------------------------------------------------
r40946 | michael | 2019-01-20 18:57:27 +0100 (Sun, 20 Jan 2019) | 1 line

* Do not save so much session info
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@40948 -

michael 6 years ago
parent
commit
8f7e8163a5

+ 1 - 1
utils/fpdoc/dglobals.pp

@@ -1263,7 +1263,7 @@ begin
   M:=CurModule;
   CurModule:=Nil;
   try
-    ParseSource(Self,AInputLine,AOSTarget,ACPUTarget,True);
+    ParseSource(Self,AInputLine,AOSTarget,ACPUTarget,[poUseStreams,poSkipDefaultDefs]);
     Result:=CurModule;
   finally
     CurModule:=M;

+ 29 - 48
utils/fpdoc/dw_html.pp

@@ -340,12 +340,14 @@ begin
   FExtension := AExtension;
 end;
 
-function TLongNameFileAllocator.GetFilename(AElement: TPasElement;
-  ASubindex: Integer): String;
+function TLongNameFileAllocator.GetFilename(AElement: TPasElement; ASubindex: Integer): String;
+
 var
-  s: String;
+  n,s: String;
   i: Integer;
+
 begin
+  Result:='';
   if AElement.ClassType = TPasPackage then
     Result := 'index'
   else if AElement.ClassType = TPasModule then
@@ -354,53 +356,30 @@ begin
   begin
     if AElement is TPasOperator then
     begin
-      Result := LowerCase(AElement.Parent.PathName) + '.op-';
-      s := Copy(AElement.Name, Pos(' ', AElement.Name) + 1, Length(AElement.Name));
-      s := Copy(s, 1, Pos('(', s) - 1);
-      if s = ':=' then
-        s := 'assign'
-      else if s = '+' then
-        s := 'add'
-      else if s = '-' then
-        s := 'sub'
-      else if s = '*' then
-        s := 'mul'
-      else if s = '/' then
-        s := 'div'
-      else if s = '**' then
-        s := 'power'
-      else if s = '=' then
-        s := 'equal'
-      else if s = '<>' then
-        s := 'unequal'
-      else if s = '<' then
-        s := 'less'
-      else if s = '<=' then
-        s := 'lessequal'
-      else if s = '>' then
-        s := 'greater'
-      else if s = '>=' then
-        s := 'greaterthan'
-      else if s = '><' then
-        s := 'symmetricdifference';
-      Result := Result + s + '-';
+      if Assigned(AElement.Parent) then
+        result:=LowerCase(AElement.Parent.PathName);
+      With TPasOperator(aElement) do
+        Result:= Result + 'op-'+OperatorTypeToOperatorName(OperatorType);
       s := '';
+      N:=LowerCase(aElement.Name); // Should not contain any weird chars.
+      Delete(N,1,Pos('(',N));
       i := 1;
-      while AElement.Name[i] <> '(' do
-        Inc(i);
-      Inc(i);
-      while AElement.Name[i] <> ')' do
-      begin
-        if AElement.Name[i] = ',' then
-        begin
-          s := s + '-';
-          Inc(i);
-        end else
-          s := s + AElement.Name[i];
-        Inc(i);
-      end;
-      Result := Result + LowerCase(s) + '-' + LowerCase(Copy(AElement.Name,
-        Pos('):', AElement.Name) + 3, Length(AElement.Name)));
+      Repeat
+        I:=Pos(',',N);
+        if I=0 then
+          I:=Pos(')',N);
+        if I>1 then
+          begin
+          if (S<>'') then
+            S:=S+'-';
+          S:=S+Copy(N,1,I-1);
+          end;
+        Delete(N,1,I);
+      until I=0;
+      // First char is maybe :
+      if (N<>'') and  (N[1]=':') then
+        Delete(N,1,1);
+      Result:=Result + '-'+ s + '-' + N;
     end else
       Result := LowerCase(AElement.PathName);
     // searching for TPasModule - it is on the 2nd level
@@ -419,7 +398,9 @@ begin
 
   if ASubindex > 0 then
     Result := Result + '-' + IntToStr(ASubindex);
+
   Result := Result + Extension;
+//  Writeln('Result filename : ',Result);
 end;
 
 function TLongNameFileAllocator.GetRelativePathToTop(AElement: TPasElement): String;

+ 14 - 2
utils/fpdoc/fpdoc.lpi

@@ -4,9 +4,12 @@
     <Version Value="10"/>
     <General>
       <Flags>
+        <SaveClosedFiles Value="False"/>
         <SaveOnlyProjectUnits Value="True"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <SaveJumpHistory Value="False"/>
+        <SaveFoldState Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
@@ -27,9 +30,18 @@
     </PublishOptions>
     <RunParams>
       <local>
-        <FormatVersion Value="1"/>
-        <CommandLineParams Value="--package=fpdoc --input=testunit.pp --output=testunit --format=html --descr=testunit.xml"/>
+        <CommandLineParams Value="--macro=FPCDIR=../fpcsrc --project=rtl-project.xml --format=html --output=rtl --footer-date=&quot;mmm dd yyyy&quot;"/>
+        <WorkingDirectory Value="/home/michael/FPC/build/tag_3_2_0/fpcdocs"/>
       </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default">
+          <local>
+            <CommandLineParams Value="--macro=FPCDIR=../fpcsrc --project=rtl-project.xml --format=html --output=rtl --footer-date=&quot;mmm dd yyyy&quot;"/>
+            <WorkingDirectory Value="/home/michael/FPC/build/tag_3_2_0/fpcdocs"/>
+          </local>
+        </Mode0>
+      </Modes>
     </RunParams>
     <RequiredPackages Count="1">
       <Item1>

+ 1 - 1
utils/fpdoc/fpdocproj.pas

@@ -146,7 +146,7 @@ begin
         F:=W;
       end;
     end;
-  AFile:=F;
+  aFile:=F;
   AOption:=O;
 end;
 

+ 15 - 6
utils/fpdoc/makeskel.lpi

@@ -1,13 +1,17 @@
 <?xml version="1.0"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="9"/>
+    <Version Value="11"/>
     <General>
       <Flags>
+        <SaveClosedFiles Value="False"/>
+        <SaveOnlyProjectUnits Value="True"/>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
         <LRSInOutputDirectory Value="False"/>
+        <SaveJumpHistory Value="False"/>
+        <SaveFoldState Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
@@ -15,23 +19,28 @@
     <VersionInfo>
       <Language Value=""/>
       <CharSet Value=""/>
-      <StringTable ProductVersion=""/>
     </VersionInfo>
     <BuildModes Count="1">
       <Item1 Name="default" Default="True"/>
     </BuildModes>
     <PublishOptions>
       <Version Value="2"/>
-      <IgnoreBinaries Value="False"/>
-      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
-      <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
     </PublishOptions>
     <RunParams>
       <local>
-        <FormatVersion Value="1"/>
         <CommandLineParams Value="--package=fpvectorial --input=/home/felipe/Programas/fpctrunk/packages/fpvectorial/src/fpvectorial.pas"/>
         <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
       </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default">
+          <local>
+            <CommandLineParams Value="--update --disable-protected --disable-private --emit-class-separator --package=rtl --disable-arguments --disable-function-results --descr=matrix.xml --input=&quot;-Fi../packages/rtl-extra/src/inc  ../packages/rtl-extra/src/inc/matrix.pp &quot; --output=matrix.new.xml"/>
+            <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+            <WorkingDirectory Value="/home/michael/docs/"/>
+          </local>
+        </Mode0>
+      </Modes>
     </RunParams>
     <Units Count="2">
       <Unit0>

+ 1 - 1
utils/fpdoc/makeskel.pp

@@ -398,7 +398,7 @@ begin
     FEmittedList:=TStringList.Create;
     FEmittedList.Sorted:=True;
     try
-      Module:=ParseSource(Self,AFileName,ATarget,ACPU);
+      Module:=ParseSource (Self,AFileName,ATarget,ACPU,[poUseStreams,poSkipDefaultDefs]);
       If UpdateMode then
         begin
         N:=FindDocNode(Module);

+ 1 - 1
utils/fpdoc/mkfpdoc.pp

@@ -274,7 +274,7 @@ begin
         if FProcessedUnits.IndexOf(Cmd)=-1 then
           begin
           FProcessedUnits.Add(Cmd);
-          ParseSource(Engine,Cmd+' '+Arg, Options.OSTarget, Options.CPUTarget);
+          ParseSource(Engine,Cmd+' '+Arg, Options.OSTarget, Options.CPUTarget,[poUseStreams,poSkipDefaultDefs]);
           end;
       except
         on E: EParserError do