#57 procedure/function type blocks not ended correctly

v1.0 (example)
open
nobody
5
2006-12-05
2006-12-05
David Dombrowsky
No

Consider this block of pascal code:

--------------------
procedure TfrmDictate.SaveMedia;
type
PMCI_Save_Parms = ^TMCI_Save_Parms;

TMCI_Save_Parms = record
dwCallback: DWord;
lpstrFileName: PAnsiChar; // name of file to save
end;
var
MySaveParms: TMCI_Save_Parms;
begin
[...]
-----------------------

pas2dox has no idea how to handle this construct. It inserts a '#ifdef INCLUDE_TYPE_SECTION', but since it is ended by 'end;', it never ends the ifdef.

I had to hack the code to get it to work:

--- pas2dox.l 2006-12-05 12:48:56.283462300 -0500
+++ pas2dox.l.orig 2006-12-05 12:49:07.951154100 -0500
@@ -996,7 +996,7 @@
{
OutputLog("// Ignore type Section");

- //fprintf(OUTPUT, "#ifdef INCLUDE_TYPE_SECTION\n");
+ fprintf(OUTPUT, "#ifdef INCLUDE_TYPE_SECTION\n");
g_bIgnoreTypeSection = true;

g_bType = true;

Discussion

  • Darren Bowles
    Darren Bowles
    2006-12-28

    Logged In: YES
    user_id=73730
    Originator: NO

    Thanks for the patch, i'll add it into the source.