fpc stores parentfp in debug info, which allows an IDE to detect nested procs, and check for variables in the parent frame.

however while good, this solution is not 100% (ok nothing ever is)
haven't tested, but if memory serves....

procedure Outer;
var i: integer;
  procedure Middle;

    procedure Inner;
    begin
      writeln(i); // uses Outer
    end;

  var i: integer; // Middle, but not visible to Inner
  begin
  end;

begin
end;

This scoping isn't coverable by framefp?

The ide/question is (and yes, it is one of the ones: I am not the one to do it, so I can't expect anyone else....)

could  "i" not be somehow encoded as a local variable? like i = framefp.i?

Martin

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to