Rename "frame object" to "capturer".
Copy captured parameters to capturer.

Capturede function parameters can't be removed since they are part of function signature. Copy values of parameters into corresponding capturer's fields.
Tests for parameters capturing.
Capture with nesting level >= 1.

Access:
Nesting level=0: simple access to variables, possibly using parentfp.
Nesting level=1: we are inside closure(or it's nesting functions); required variable located in capturer which is "self" variable of current method, so load field from self.
Nesting level>1: we are inside closure and required field not inside "self". Load required capturer using "parent" link of capturer.

Parent link:
Each capturer have parent link. For simplicity we create capturer for each function which is on path from closure to captured variable. For example:
procedure have_captured;
  var
    i_am_captured:integer;
  procedure have_not_captured;
    procedure have_closure;
      begin
        p:=procedure
           begin
             writeln(i_am_captured);
           end;
...
have_closure - have capturer because have closure;
have_captured - have capturer because have captured variables;
have_not_captured - also have capturer because is's on path from have_closure to have_captured.

Access to capturer:
1. Normal function(not closure not nested): not require parent link.
2. Nested function(not inside closure): can access parent capturer using parentfp.
3. Closure: "self" variable.
3. Nested inside closure: "self" variable.

Each of described functions can create closure. During new capturer creation parent capturer is accessible as described above.
Make name of capturer defenition unique.

Problem: Commit "Dont produce local classes." makes possible situation when different capturer definitions have same names.
Fix: Add line and pos to name of capturer definition.
Place capturer's parent link in capturer not in procedure's symtable.

Accidental mistake.
Tests for deep capturing. Some test fail.

Problem: closure can capture variable with nesting deeper than 1. But second access to this variable will be incorrect(walk through parent link is missed). There should be optimization which saves last access node, or smth like this. In any case deep access should be moved somewhere from parsing phase. Probably into pass1.