Known bugs
~~~~~~~~~~
* Mangler is not rock solid. Your file should at least pass the Borland
  compiler, before you have a chance that mangler doesn't choke on it.

  There are files which I know which broke mangler although I have not
  got that files in hand so I could not fix mangler. You have a 0.8
  probability that mangler mangles your file. Please report errors or
  send me files that mangler does not handle.


* When using externals like
    {$L InitCrt.obj}
    {$F+}
    Procedure ReInitCrt;external;
  and InitCrt.obj references variables in a unit, you can mangle but
  not compile this unit because Mangler does not know that the .obj
  references variables or procedures in the unit and that it therefore
  should leave them untouched.
  The chance that mangler ever will be modified for this circumstances
  is nil.
  Fix: if possible turn the .obj to assembler and instead of making
  an external routine, make a basm routine.


* A real Turbo Pascal parser suffers from the fact that it has to
  understand/read compiler directives. Mangler does not do this,
  obviously, else you would have to specify the directives to use
  for every combination of directives. But simply skipping directives
  introduces sometimes strange behaviour. Here a few examples:

  The following code will not compile:

    procedure dv_TObject.Int15_p0_r0(axValue : word);
    {$IFNDEF DPMI} assembler; {$ENDIF}
    {$IFDEF DPMI}
    begin
      {* do some stuff *}
    end;
    {$ELSE}
    asm
      {* do some asm stuff *}
    end;
    {$ENDIF}

  Rewriting this to:

    {$IFDEF DPMI}
    procedure dv_TObject.Int15_p0_r0(axValue : word);
    begin
      {* do some stuff *}
    end;
    {$ELSE}
    procedure dv_TObject.Int15_p0_r0(axValue : word);  assembler;
    asm
      {* do some asm stuff *}
    end;
    {$ENDIF}

  will make it compile correctly.

  The following code cannot be mangled too:
    {$IFDEF VER60}
    procedure Demo(s : string);
    {$ENDIF}
    {$IFDEF VER70}
    procedure Demo(w : word);
    {$ENDIF}

  Again the same variant as the previous two cannot be mangled:

    {$IFOPT N+}
    Function FormatF(const Mask : TbxMaskStr;
                           Flt  : Double;
                           DP   : Integer): String;
    {$ELSE}
    Function FormatF(const Mask : TbxMaskStr;
                           Flt  : Real;
                           DP   : Integer): String;
    {$ENDIF}

  Fix as the first variant.


* $I directives are currently ignored. All directives are still included
  in the mangled file but include files are not mangled yet. I want to
  add this feature when mangler is starting to stabelize.


* not all source code can be mangled correctly. Take the following code
  as an example:

    implementation
    uses A;

    type
      b = object(parent)     {* object parent is defined in unit A *}
        procedure Demo;
      end;
    var
      a : integer;


    procedure b.demo;
    begin
      a := 10;
    end;

  If object parent contains an attribute a, this file will be mangled
  incorrectly because Mangler does not know that a was defined in
  parent. Such pitfalls only applies to objects.
  A 100% stable mangler therefore has to be able to read .TPU files. Maybe
  I add this to some later version.



Unknown bugs
~~~~~~~~~~~~
Lots of bugs sit undetected in Mangler. Excuse me for that, but writing
a Mangler is an awful lot like writing a compiler. A real mangler has to
do an entire scanning/parsing/semantic analysis pass to be robust. This
mangler is just a plain hack, to make it work. Therefore this source code
should not be taken as a learning example, or be taken for my ordinary
style of programming :-)


Would anybody be so kind to report any error to me? If you send a bug report
include the source that failed to be mangled correctly with the message
mangler gave.

Send bugs to "Berend de Boer" at:

  CompuServe: 100120,3121
  email: 100120.3121@compuserve.com 
  Fidonet: 2:281/527.23
  fax: +31 (0)418-562593
