tag but there was
no closing
tag. }
procedure RecursiveTwoAt;
(* Note that inside @@longcode below I should be able to write
singe @@ char to get it in the output, no need to double it
(like @@@@). No tags are expanded inside longcode.
Also note that paragraphs are not expanded inside longcode
(no inside
...in html output). Of course html characters are still correctly escaped (< changes to < etc.). @longcode(# procedure Foo; begin if A < B then Bar; { @link(No, this is not really pasdoc tag) } end; procedure Bar(X: Integer); begin CompareMem(@X, @Y); end; #) *) procedure TestLongCode; (* @html( This is some dummy html code, just to show that inside @html tag of pasdoc (note that I used single @ char in this sentence) nothing is expanded by pasdoc. No paragraphs are created by pasdoc. (This text is still in the 1st, not in the 2nd, paragraph in html output)
You must explicitly write <p> to get paragraph. No tags work, e.g. @link(TestLongCode). ) @latex( This is some {\bf dummy} \LaTeX code, just to show that inside @latex tag of pasdoc (note that I used single @ char in this sentence) nothing is expanded by pasdoc. No paragraphs are created by pasdoc. Although, in case of LaTeX output, LaTeX rules for making paragraphs are the same as the pasdoc's rules (one empty lines marks paragraph), so you will not notice. This is brutal line-break: \\ I'm still in the same paragraph, after line-break. I'm 2nd paragraph. No tags work, e.g. @link(TestLongCode). ) Note that text inside @@html / @@latex tags is absolutely not touched by pasdoc. Characters are not escaped (< is *not* changed to < in the html case), @@tags are not expanded, @@ needs not to be doubled, paragraphs (
in the html case) are not inserted.
*)
procedure TestHtmlAndLatexTags;
type
EFoo = class(Exception) end;
EBar = class(Exception) end;
EXyz = class(Exception) end;
{ @@code and @@returns (and some others) tags are recursive,
you can freely put other tags inside.
@code(This is link to @link(TestHtmlAndLatexTags).)
@raises(EFoo in case @link(TestHtmlAndLatexTags)
returns value >= 4 (actually, this is just a test text).)
}
procedure TestRecursiveTag;
{ This is a test of tags expanded by TPasMethod handlers.
Note that all three tags are expanded recursively.
@param(A means sthg about @link(TestRecursiveTag))
@param(B also means sthg. @code(Code inside.))
@returns(You can make tags recursion any level deep :
@code(This is a code with a link to @link(TestRecursiveTag)))
@raises(EFoo when you do sthg nasty, like call @link(TestRecursiveTag)
when you're not supposed to)
@raises(EBar when code @code(if 1 = 0 then DoSomething;) will work as expected.)
}
function TestPasMethodTags(A, B: Integer): string;
type
TMyClassAncestor = class
private
MyField: boolean;
public
//@abstract(This comment should be inherited.)
property inheritable: boolean read MyField;
end;
{ These are some tags that are not allowed to have parameters:
name @name, inherited @inherited, nil @nil, true @true, false @false,
classname @classname. Some of them are valid only within a class,
but this is not important for this test.
@cvs($Date: 2010-04-26 04:04:35 +0200 (pon) $) }
TMyClass = class(TMyClassAncestor)
published
//This is the detailed description.
property inheritable;
end;
{ And a test of @exclude.
This should not be seen in final output! }
procedure TestExclude;
implementation
end.
pasdoc/tests/ok_bom.pas 0000600 0001750 0001750 00000000127 11464174617 015613 0 ustar michalis michalis { UTF-8 file with BOM ($EF, $BB, $BF). }
unit ok_bom;
interface
implementation
end.
pasdoc/tests/ok_table.pas 0000600 0001750 0001750 00000003403 10305576640 016120 0 ustar michalis michalis (* @abstract(Test of @@table-related features.)
Example from @@table doc page in wiki:
@table(
@rowHead( @cell(Value1) @cell(Value2) @cell(Result) )
@row( @cell(@false) @cell(@false) @cell(@false) )
@row( @cell(@false) @cell(@true) @cell(@true) )
@row( @cell(@true) @cell(@false) @cell(@true) )
@row( @cell(@true) @cell(@true) @cell(@false) )
)
Small tables tests:
@table( @row( @cell(One-cell table is OK) ) )
@table( @rowHead( @cell(One-cell head table is OK) ) )
@table( @rowHead( @cell(A) @cell( @bold(Foo) ) ) )
Test that everything within @@cell tag is OK.
Actually, test below is a stripped down (to be accepted
by LaTeX) version of a more advanced test in
ok_table_nonlatex.pas file.
@table(
@rowHead(
@cell(Dashes: ---, --, -, @--)
@cell(URLs: http://pasdoc.sourceforge.net/)
)
@row( @cell(C) @cell(D) )
)
Now nested table and other nicies are within a normal row,
instead of heading row.
@table(
@rowHead( @cell(C) @cell(D) )
@row(
@cell(Within a cell many things are are accepted)
@cell(including paragraphs:
This is new paragraph.)
)
@row(
@cell(Dashes: ---, --, -, @--.)
@cell(URLs: http://pasdoc.sourceforge.net/)
)
@row(
@cell(And, last but not least, nested table:
@table(
@rowHead( @cell(1) @cell(2) )
@rowHead( @cell(3) @cell(4) )
))
@cell(B)
)
)
Some 2-row table tests:
@table(
@rowHead( @cell(A) @cell(B) )
@rowHead( @cell(C) @cell(D) )
)
@table(
@row( @cell(A) @cell(B) )
@row( @cell(C) @cell(D) )
)
@table(
@row( @cell(A) @cell(B) )
@rowHead( @cell(C) @cell(D) )
)
*)
unit ok_table;
interface
implementation
end.
pasdoc/tests/warning_value_member_tags.pas 0000600 0001750 0001750 00000001736 10237304274 021551 0 ustar michalis michalis unit warning_value_member_tags;
interface
type
{ @member MyField1 First description of MyField1.
@member MyField2 First description of MyField2.
@member MyField2 Second description of MyField2.
@member NotExistsingMember Description of NotExistsingMember.
This should cause 3 warnings:
MyField1 has two descriptions,
MyField2 has two descriptions,
and NotExistsingMember does not exist. }
TMyClass = class
{ @abstract(Second description of MyField1.) }
MyField1: Integer;
MyField2: Integer;
end;
{ @value meOne First description of meOne.
@value meOne Second description of meOne.
@value meTwo First description of meTwo.
@value meNotExisting Description of meNotExisting.
This should cause 3 warnings:
meOne has two descriptions,
meTwo has two descriptions,
and meNotExisting does not exist. }
TMyEnum = (
meOne,
{ Second description of meTwo. }
meTwo);
implementation
end. pasdoc/tests/ok_include_quoted.pas 0000600 0001750 0001750 00000000126 10447532327 020035 0 ustar michalis michalis unit ok_include_quoted;
{$I 'ok_include_quoted.inc'}
interface
implementation
end. pasdoc/tests/ok_cdecl_external.pas 0000600 0001750 0001750 00000001035 10236141175 017776 0 ustar michalis michalis { Bug:
Parsing of this unit fails with
Warning[2]: Error EPasDoc: todo/ok_cdecl_external.pas(5): Unexpected keyword external. parsing unit ok_cdecl_external.pas, continuing...
Bar and Xyz added as additional tests.
Update: it's fixed now, pasdoc parses it correctly.
}
unit ok_cdecl_external;
interface
procedure Foo; cdecl; external 'whatever';
procedure Bar; cdecl; external 'bar_library_name' name 'bar_name_in_library';
procedure Xyz; external 'xyz_library_name' name 'xyz_name_in_library'; cdecl;
implementation
end. pasdoc/tests/ok_auto_link.pas 0000600 0001750 0001750 00000003024 10331733542 017010 0 ustar michalis michalis { @abstract(Auto-link tests.)
Self name: ok_auto_link, simple identifiers Var1,
qualified ident: ok_auto_link.Var1.
Ident that can't be auto-linked: no_auto_link_to_me.
Explicit link to ident that can't be auto-linked: @link(no_auto_link_to_me). }
unit ok_auto_link;
interface
const
{ @noAutoLinkHere }
no_auto_link_to_me = 1;
type
TMyClass = class
Field: Integer;
end;
var
{ @definitionList(
@itemLabel Test of auto-linking:
@item(
Self name is Var1, simple ident is TMyClass, qualified ident is
TMyClass.Field.
Ident that can't be auto-linked: no_auto_link_to_me.
Explicit link to ident that can't be auto-linked: @link(no_auto_link_to_me).
Note that auto-linking works also inside @@code:
@code(
Self name is Var1, simple ident is TMyClass, qualified ident is
TMyClass.Field. )
)
@itemLabel Test of @@noAutoLink:
@item(
Things below should @italic(not) be converted to links:
@noAutoLink(
Self name is Var1, simple ident is TMyClass, qualified ident is
TMyClass.Field.
Ident that can't be auto-linked: no_auto_link_to_me.
Explicit link to ident that can't be auto-linked: @link(no_auto_link_to_me).
@noAutoLink(Simple ident once again TMyClass.)
Inside @@code:
@code(
Self name is Var1, simple ident is TMyClass, qualified ident is
TMyClass.Field.)
)
)
)
}
Var1: Integer;
implementation
end. pasdoc/tests/ok_attributes.pas 0000600 0001750 0001750 00000001137 11773743214 017224 0 ustar michalis michalis { Simple Delphi attributes test, from http://www.malcolmgroves.com/blog/?p=530 }
unit ok_attributes;
interface
type
TPerson = class
private
FName: String;
FAge: Integer;
public
[NonEmptyString('Must provide a Name')]
property Name : String read FName write FName;
[MinimumInteger(18, 'Must be at least 18 years old')]
[MaximumInteger(65, 'Must be no older than 65 years')]
property Age : Integer read FAge write FAge;
end;
// Test that GUIDs are handled gracefully
IUIContainer = interface
['{0F0BA87D-95C3-4520-B9F9-CDF30015FDB3}']
end;
implementation
end.
pasdoc/tests/ok_generic.pas 0000600 0001750 0001750 00000004016 11617731461 016447 0 ustar michalis michalis { Tests of generics, both FPC and Delphi style. }
unit ok_generic;
interface
{ Units to include for Generics }
uses Generics.Collections, FGL;
type
{ FPC generics tests ------------------------------------------------------- }
generic TMyList