[fpc-devel] Internal error 200310221 with SVN 1885

2005-12-06 Thread Mark de Wever
I just started to test a program of mine with the development tree and
ran into an internal error 200310221. Compiling with 2.0.0 does work.
Only tested on linux-i386. When reducing the program to a small testcase
I also encountered internal error 200402171 (unfortunatly only saw it
later in the logs, so no idea how the program looked at that moment.)

Attached the sample program, when putting it in one unit it magically
starts to work.

Regards,

Mark de Wever
program psw_demo;

uses
psw;

begin

end.
unit psw;

interface
{$mode objfpc} 

uses
classes;

{$define error_200310221}
type
TSDL_Text=class
public
fText:string;
end;

TSDL_EditBox=class
public
fCaption:string;
fTextWidget:TSDL_Text;
{$ifdef error_200310221}
property Caption:string read fTextWidget.fText;
{$else} 
property Caption:string read fCaption;
{$endif}
end;

implementation

end.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Internal error 200310221 with SVN 1885

2005-12-06 Thread Mark de Wever
On Tue, Dec 06, 2005 at 10:05:12PM +0100, Jonas Maebe wrote:
 
 On 06 Dec 2005, at 22:00, Mark de Wever wrote:
 
  just started to test a program of mine with the development tree and
 ran into an internal error 200310221. Compiling with 2.0.0 does work.
 Only tested on linux-i386. When reducing the program to a small  
 testcase
 I also encountered internal error 200402171 (unfortunatly only saw it
 later in the logs, so no idea how the program looked at that moment.)
 
 Attached the sample program, when putting it in one unit it magically
 starts to work.
 
 Please enter it in the bug reporting system on the website so it  
 won't be forgotten.

I wanted to do that, but I can only enter one source :-( 

Mark de Wever
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] [RFC] fpdoc output comment from the source

2005-12-04 Thread Mark de Wever
On Sat, Dec 03, 2005 at 06:13:30PM +0100, Michalis Kamburelis wrote:
 Mark de Wever wrote:
 Hi all,
 
 I like to put a lot of comment in the source and I would like fpdoc to
 output this comment into the output files. I wrote a small patch to do
 this with types, it puts all the comment in front of a type declaration 
 into the output html as section Comment text. 
 
 
 (This is kind of shameless self promotion, since I took the PasDoc 
 projects this year: )
 
 If you want to get documentation generated from comments in your source 
 code, PasDoc may be a better tool for you. See [http://pasdoc.sf.net/].

I just looked into pasdoc and it looks promising, I'm testing it at the
moment.

Mark
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] [RFC] fpdoc output comment from the source

2005-12-04 Thread Mark de Wever
On Sun, Dec 04, 2005 at 12:11:20AM +0100, Sebastian Günther wrote:
 Florian Klaempfl schrieb:
  
  Why ;)? Indeed, if you want generated docs from comments, better use pasdoc.
 
 the source scanner used by fpDoc supports reading of comments for quite
 some time; but as I already told you (or was it Mattias?), the final
 support in fpDoc is still missing.
 If there is really interest in this feature, I will have a look at it.
 (And no, I didn't inspect the sent patch yet.)
 Any more opinions? Important, not so important?

For now I switched to pasdoc, since it fulfills my shortterm needs. But
I still would be interested to see this option in fpDoc. 

Mark de Wever
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] [RFC] fpdoc output comment from the source

2005-12-03 Thread Mark de Wever
Hi all,

I like to put a lot of comment in the source and I would like fpdoc to
output this comment into the output files. I wrote a small patch to do
this with types, it puts all the comment in front of a type declaration 
into the output html as section Comment text. 

Since I'm not really familiar with both fpdoc and passrc internals I
don't know whether this is the best way to do it, could someone
enlighten me?

Would people like to include this option in fpdoc, behind the option
--include-comment?

Greets,

Mark de Wever

PS comment of the type (* comment *) don't work, don't know why and
didn't look into it yet.
Index: utils/fpdoc/dglobals.pp
===
--- utils/fpdoc/dglobals.pp (revision 1871)
+++ utils/fpdoc/dglobals.pp (working copy)
@@ -49,6 +49,7 @@
   SDocUnitOverview   = 'Overview of unit ''%s''';
   SDocOverview   = 'Overview';
   SDocSearch = 'Search';
+  SDocCommentText= 'Comment text';
   SDocDeclaration= 'Declaration';
   SDocDescription= 'Description';
   SDocErrors = 'Errors';
Index: utils/fpdoc/dw_html.pp
===
--- utils/fpdoc/dw_html.pp  (revision 1871)
+++ utils/fpdoc/dw_html.pp  (working copy)
@@ -183,6 +183,7 @@
   AShFlags: Byte): Byte;
 Procedure AppendShortDescr(AContext : TPasElement;Parent: TDOMNode; 
DocNode : TDocNode);
 procedure AppendShortDescr(Parent: TDOMNode; Element: TPasElement);
+procedure AppendCommentText(const AText: DOMString);
 procedure AppendDescr(AContext: TPasElement; Parent: TDOMNode;
   DescrNode: TDOMElement; AutoInsertBlock: Boolean);
 procedure AppendDescrSection(AContext: TPasElement; Parent: TDOMNode;
@@ -1311,6 +1312,14 @@
   AppendShortDescr(Element,Parent,Engine.FindDocNode(Element));
 end;
 
+procedure THTMLWriter.AppendCommentText(const AText: DOMString);
+begin
+  if( AText  '' ) then begin
+   AppendText(CreateH2(BodyElement), SDocCommentText);
+   AppendText(CreatePara(BodyElement), AText);
+   end;
+end;
+
 procedure THTMLWriter.AppendDescr(AContext: TPasElement; Parent: TDOMNode;
   DescrNode: TDOMElement; AutoInsertBlock: Boolean);
 begin
@@ -2269,6 +2278,7 @@
   AppendShortDescr(CreatePara(BodyElement), AType);
   AppendText(CreateH2(BodyElement), SDocDeclaration);
   AppendSourceRef(AType);
+  AppendCommentText(AType.CommentText);
 
   TableEl := CreateTable(BodyElement);
   TREl := CreateTR(TableEl);
Index: fcl/passrc/pastree.pp
===
--- fcl/passrc/pastree.pp   (revision 1871)
+++ fcl/passrc/pastree.pp   (working copy)
@@ -76,6 +76,7 @@
 FRefCount: LongWord;
 FName: string;
 FParent: TPasElement;
+FCommentText: string;
   public
 SourceFilename: string;
 SourceLinenumber: Integer;
@@ -91,6 +92,7 @@
 property RefCount: LongWord read FRefCount;
 property Name: string read FName write FName;
 property Parent: TPasElement read FParent;
+property CommentText:string read FCommentText write FCommentText; // 
comment before the element
   end;
 
   TPasSection = class(TPasElement)
@@ -514,6 +516,7 @@
   inherited Create;
   FName := AName;
   FParent := AParent;
+  FCommentText := '';
 end;
 
 procedure TPasElement.AddRef;
Index: fcl/passrc/pparser.pp
===
--- fcl/passrc/pparser.pp   (revision 1871)
+++ fcl/passrc/pparser.pp   (working copy)
@@ -95,6 +95,7 @@
 FFileResolver: TFileResolver;
 FScanner: TPascalScanner;
 FEngine: TPasTreeContainer;
+FCurTokenCommentText: string;
 FCurToken: TToken;
 FCurTokenString: String;
 // UngetToken support:
@@ -152,6 +153,7 @@
 property Scanner: TPascalScanner read FScanner;
 property Engine: TPasTreeContainer read FEngine;
 
+property CurTokenCommentText: string read FCurTokenCommentText;
 property CurToken: TToken read FCurToken;
 property CurTokenString: String read FCurTokenString;
   end;
@@ -251,9 +253,13 @@
   Dec(FTokenBufferIndex);
 end;
 // Fetch new token
+FCurTokenCommentText:='';
 try
   repeat
 FCurToken := Scanner.FetchToken;
+   if( FCurToken = tkComment )then begin
+   
FCurTokenCommentText:=FCurTokenCommentText+Scanner.CurTokenString;
+   end;
   until not (FCurToken in [tkWhitespace, tkComment]);
 except
   on e: EScannerError do
@@ -869,6 +875,7 @@
 function TPasParser.ParseTypeDecl(Parent: TPasElement): TPasType;
 var
   TypeName: String;
+  Comment: String;
 
   procedure ParseRange;
   begin
@@ -891,6 +898,7 @@
 
 begin
   TypeName := CurTokenString;
+  Comment := CurTokenCommentText;
   ExpectToken(tkEqual);
   NextToken;
   HadPackedModifier := False; { Assume not present }
@@ -1092,6 +1100,8 @@
   ParseRange;
 end