View Issue Details

IDProjectCategoryView StatusLast Update
0016476FPCUtilitiespublic2011-11-30 21:44
ReporterGraeme Geldenhuys Assigned ToMarco van de Voort  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86OSUbuntu Linux 
Product Version2.5.1 
Fixed in Version2.4.4 
Summary0016476: fpdoc can't parse code with 'label' or 'xxx of byte' syntax
Descriptionfpdoc 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.

TagsNo tags attached.
Fixed in Revision16370
FPCOldBugId0
FPCTarget
Attached Files

Activities

Marco van de Voort

2010-05-15 13:46

manager   ~0037619

Just to avoid any misunderstanding: these files are really units, not included .pas files?

Graeme Geldenhuys

2010-05-17 08:28

reporter   ~0037671

Yes, they are from normal units. I only included the the code snippets to show where in each unit the parser failed.

BTW: Could somebody fix the Subject line of this bug report. It should read "fpdoc can't parse..."

Marco van de Voort

2010-10-24 14:50

manager   ~0042052

Afaik Mattias' patch (amongst many other things) simply turned on parsing the implementation.

Meanwhile this has been reversed, but can be reenabled by using --parse-impl parameter of fpdoc.

The "file of" bit seems to work in trunk too.

2010-10-24 14:51

 

bug16476.pp (805 bytes)

Marco van de Voort

2010-10-24 22:13

manager   ~0042070

Example now parses without warnings (copied "goto xx" into a command node), label was already done meanwhile I guess.

Marco van de Voort

2010-10-24 22:13

manager   ~0042071

Example now parses without warnings (copied "goto xx" into a command node), label was already done meanwhile I guess.

Issue History

Date Modified Username Field Change
2010-05-14 14:45 Graeme Geldenhuys New Issue
2010-05-15 13:46 Marco van de Voort Note Added: 0037619
2010-05-17 08:28 Graeme Geldenhuys Note Added: 0037671
2010-05-17 12:53 Joost van der Sluis FPCOldBugId => 0
2010-05-17 12:53 Joost van der Sluis Summary fpdoc can parse code with 'label' or 'xxx of byte' syntax => fpdoc can't parse code with 'label' or 'xxx of byte' syntax
2010-10-24 14:50 Marco van de Voort Note Added: 0042052
2010-10-24 14:51 Marco van de Voort File Added: bug16476.pp
2010-10-24 14:51 Marco van de Voort Status new => assigned
2010-10-24 14:51 Marco van de Voort Assigned To => Marco van de Voort
2010-10-24 22:13 Marco van de Voort Fixed in Revision => 16215
2010-10-24 22:13 Marco van de Voort Status assigned => resolved
2010-10-24 22:13 Marco van de Voort Fixed in Version => 2.5.1
2010-10-24 22:13 Marco van de Voort Resolution open => fixed
2010-10-24 22:13 Marco van de Voort Note Added: 0042070
2010-10-24 22:13 Marco van de Voort Note Added: 0042071
2011-05-01 16:29 Marco van de Voort Fixed in Version 2.5.1 => 2.4.4
2011-05-01 18:23 Marco van de Voort Fixed in Revision 16215 => 16370
2011-05-01 18:23 Marco van de Voort Status resolved => closed
2011-05-02 17:38 Marco van de Voort Status closed => resolved
2011-11-30 21:44 Marco van de Voort Status resolved => closed