fpdoc can't parse code with 'label' or 'xxx of byte' syntax
Original Reporter info from Mantis: ggeldenhuys
-
Reporter name: Graeme Geldenhuys
Original Reporter info from Mantis: ggeldenhuys
- Reporter name: Graeme Geldenhuys
Description:
fpdoc in 2.4.1 and 2.5.1 generates the following errors which it did not do in 2.2.0 release.
---------[ fpdoc errors ]------------------
../Source/Core/tiUtils.pas(1371,14): Expected ";" at token "of"
../Source/Core/tiStreams.pas(384,5): Syntax error at token "label"
----------------------------
Here are the actual code snippets. I marked the lines fpdoc reports the
errors on.
------------[ tiUtils.pas ]-------------
function tiGetFileSize(AValue : string): longInt;
var f: file of Byte; // <<-- error reported here
begin
AssignFile(f, AValue);
Reset(f);
result := FileSize(f);
closeFile(f);
end;
--------------------------------------------
------------[ tiStreams.pas ]-------------
function MimeEncodeString (const s: AnsiString): AnsiString;
label // <<-- error reported here
NothingToDo;
var
l: Cardinal;
begin
if Pointer(s) = nil then
goto NothingToDo;
l := Cardinal (Pointer (Cardinal (Pointer (s)) - 4)^);
SetLength (Result, (l + 2) div 3 * 4);
if Pointer (Result) = nil then
goto NothingToDo;
MimeEncode (Pointer (s)^, l, Pointer (Result)^);
Exit; //==>
NothingToDo:
Result := '';
end;
--------------------------------------------
The errors for 'label' and 'xxx of byte' syntax was introduced
in r14938. That is the BIG patch from Mattias.
Mantis conversion info:
- Mantis ID: 16476
- OS: Ubuntu Linux
- OS Build: 8.04.2
- Platform: x86
- Version: 2.5.1
- Fixed in version: 2.4.4
- Fixed in revision: 16370 (#ecb59a09)