anchor.diff:         call reentrant parser            if {}
          inject new text                  if <> or {}
     *)
  +
  +  AssignFile(f, path);
  +
  +  r_angular:= TRegExpr.Create;
  +  r_square := TRegExpr.Create;
  +  r_curly  := TRegExpr.Create;
  +  r_any    := TRegExpr.Create;
  +  r_Square.Expression := '\[([^\]]*)\]';
  +  r_angular.Expression := '<([^>]*)>';
  +  r_curly.Expression := '{([^}]*)}';
  +  r_any.Expression := '([\[{<])';
  +
  +  try
  +    Reset(f);
  +    repeat
  +      readln(f, line);
  +      while r_any.Exec(line) do begin
  +        case r_any.Match[1][1] of
  +        '[': begin
  +               r_square.Exec(line);
  +               captured := r_square.Match[1];
  +               if pos('=', captured) <= 0 then begin
  +                 writeln('Error: invalid assignation');
  +                 halt(1);
  +               end;
  +               if pos(':=', captured) > 0 then begin
  +                 sleft := copy(captured, 1, pos(':=', captured));
  +                 sexpr := copy(captured, pos(':=', captured) + 2, length(captured));
  +
  +                 exprParser := TFPExpressionParser.Create(nil);
  +                 try
  +                   exprParser.Expression := sexpr;
  +                   exprResult := exprParser.Evaluate;
  +                   m_env.Definition[sleft] := exprResult.ResString;
  +                 finally
  +                   exprParser.Free;
  +                 end;
  +               end else begin
  +                 sleft := copy(captured, 1, pos('=', captured));
  +                 sexpr := copy(captured, pos('=', captured) + 1, length(captured));
  +
  +                 m_env.Definition[sleft] := sexpr;
  +               end;
  +               ReplaceRegExpr(r_square.Expression,
  +                              line,
  +                              '',
  +                              False);
  +             end;
  +        '<': begin
  +               r_angular.Exec(line);
  +               ReplaceRegExpr(r_angular.Expression,
  +                              line,
  +                              m_Env.Definition[r_angular.Match[1]],
  +                              False);
  +             end;
  +        '{': begin
  +               (* TODO *)
  +             end;
  +        end;
  +      end;
  +    until(EOF(f));
  +  finally
  +    CloseFile(f);
  +  end;
   end;
   
   (* mytest *)
  
positive.code: 
  interface
  
  uses contnrs;
  
  type
    TParserDefinitions = class
  
negative.code:   Result := m_table.Items[Id];
  end;
  
  procedure TParserDefinitions.SetItem(Id: string; Val: string);
  begin
    if m_table.Find(Id) <> Nil then
      m_table.Items[Id] := Val
    else
      m_table.Add(Id, Val);
  end;
  
  (* TParser *)
  
  constructor TParser.New(env : TParserDefinitions);
  