Re: [fpc-devel] Internal error 200310221 with SVN 1885
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
[fpc-devel] Internal error 200310221 with SVN 1885
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] [RFC] fpdoc output comment from the source
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
Re: [fpc-devel] [RFC] fpdoc output comment from the source
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
[fpc-devel] [RFC] fpdoc output comment from the source
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
[fpc-devel] Patch for dateutil.inc how to apply?
Hello, I'm new here and don't know what the way is to include a patch to the system, so I decided to send it here. Recently I needed to convert some Mac dates and wanted to use the Unix conversion routines from the dateutils unit. Unfortunately they weren't implanted yet. I wrote those routines along with the Mac ones I needed. Attached the changes I made so they can be included in the rtl. Regards, Mark de Wever --- dateutil.inc.orig 2005-11-15 19:38:58.923544296 +0100 +++ dateutil.inc2005-11-15 19:36:49.243258696 +0100 @@ -397,6 +397,15 @@ Function DateTimeToUnix(const AValue: TDateTime): Int64; Function UnixToDateTime(const AValue: Int64): TDateTime; +Function UnixTimeStampToMac(const AValue: Int64): Int64; + +{ - +Mac timestamp support. + -} + +Function DateTimeToMac(const AValue: TDateTime): Int64; +Function MacToDateTime(const AValue: Int64): TDateTime; +Function MacTimeStampToUnix(const AValue: Int64): Int64; implementation @@ -2006,15 +2015,58 @@ -} Function DateTimeToUnix(const AValue: TDateTime): Int64; +var + Epoch:TDateTime; begin - NotYetImplemented('DateTimeToUnix'); + Epoch:=EncodeDateTime( 1970, 1, 1, 0, 0, 0, 0 ); + Result:=SecondsBetween( Epoch, AValue ); end; Function UnixToDateTime(const AValue: Int64): TDateTime; +var + Epoch:TDateTime; +begin + Epoch:=EncodeDateTime( 1970, 1, 1, 0, 0, 0, 0 ); + Result:=IncSecond( Epoch, AValue ); +end; + + +Function UnixTimeStampToMac(const AValue: Int64): Int64; +const + Epoch=24107 * 24 * 3600; +begin + Result:=AValue + Epoch; +end; + +{ - +Mac timestamp support. + -} + +Function DateTimeToMac(const AValue: TDateTime): Int64; +var + Epoch:TDateTime; +begin + Epoch:=EncodeDateTime( 1904, 1, 1, 0, 0, 0, 0 ); + Result:=SecondsBetween( Epoch, AValue ); +end; + +Function MacToDateTime(const AValue: Int64): TDateTime; +var + Epoch:TDateTime; begin - NotYetImplemented('UnixToDateTime'); + Epoch:=EncodeDateTime( 1904, 1, 1, 0, 0, 0, 0 ); + Result:=IncSecond( Epoch, AValue ); end; + +Function MacTimeStampToUnix(const AValue: Int64): Int64; +const + Epoch=24107 * 24 * 3600; +begin + Result:=AValue - Epoch; +end; + + end. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel