Jump to content
Uwe Raabe

MMX V15.1.1 released

Recommended Posts

MMX V15.1.1 fixes some problems encountered with V15.1 and enhances the new directive aware parser.

 

While evaluating IFDEFs was a long requested feature its actual implementation did raise some issues. One consequence of evaluating directives is that parts of the code are hidden from the MMX explorer. Only code that is embraced by conditions evaluating to True are taken into account in the explorer. F.i. a unit with this code:

unit Example;

interface

{$IFDEF MYDEF}
type
  TMyType = class
  public
    procedure MyProc;
  end;
{$ENDIF}

implementation

{$IFDEF MYDEF}
procedure TMyType.MyProc;
begin
end;
{$ENDIF}

end.

will end up in an completely empty explorer.

 

The only workaround in V15.1 was to place a {$DEFINE MYDEF} somewhere before the IFDEF to make MMX explorer see that class TMyType. Unfortunately that will also make the compiler see that class, which is probably not what you want.

 

V15.1.1 offers two solutions to this (which can also be combined):

  1. The parser silently defines MMX. This allows to wrap the {$DEFINE MYDEF} inside an {$IFDEF MMX}/{$ENDIF}, so the compiler doesn't see it.
  2. The Project options page in the MMX Code Explorer properties dialog allows to have a special set of Defines and $IF Expressions used only by the MMX parser.

 

Another unwanted effect in V15.1 was that the content of include files were added to the explorer, which was completely unintended, because they belong to another module (the include file). This has been fixed in V15.1.1 and the include file directives are added to the module section. A double click will open the file.

  • Thanks 5

Share this post


Link to post

Would getting the active projects compiler defines resolve this issue? I do that with my own parsers to get around this issue.

Share this post


Link to post

I thought about that first, but IMHO it would be less flexible. Imaging you have some procedures wrapped in an {$IFDEF Debug}. Wouldn't you expect to see those even when the RELEASE configuration is active?

With the two options described above, you have control over what the MMX parser sees on the unit level (option 1) as well as on the project level (option 2).

  • Thanks 1

Share this post


Link to post

Of the two solutions offered by V15.1.1, the first works fine; but I've no idea what is expected in the Project Options, Conditional Compilation. If I enter $DEFINE MYDEF} (not literally, of course!)  the Conditional defines editor it has no impact; and not sure what should go in the $IF Expressions editor. Help file doesn't seem to be updated to explain. Could you elaborate, please. Thanks

Share this post


Link to post

Actually one need to enter just MYDEF, just like you do for the Defines in the compiler options or the options of the Unit Dependency Analyzer.

 

BUT, there is a refresh problem in the current MMX version: You have to restart the IDE to make the MMX parser reload the defines. Of course that is quite buggy, as even switching the project misses to update the defines for the parser. I will fix that with the next version.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×