mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 11:18:21 +02:00
Codetools: Prevent node caching for results in generics.
This commit is contained in:
parent
b693b70363
commit
19d12f194d
@ -4302,6 +4302,8 @@ var
|
||||
{$ENDIF}
|
||||
// identifier found
|
||||
Params.SetResult(Self,Node);
|
||||
Include(Params.Flags, fdfDoNotCache);
|
||||
Include(Params.NewFlags, fodDoNotCache);
|
||||
Result:=CheckResult(true,true);
|
||||
if not (fdfCollect in Flags) then
|
||||
exit;
|
||||
@ -4872,6 +4874,12 @@ var
|
||||
end;
|
||||
end;
|
||||
|
||||
ctnGenericType:
|
||||
begin
|
||||
Include(Params.Flags, fdfDoNotCache);
|
||||
Include(Params.NewFlags, fodDoNotCache);
|
||||
end;
|
||||
|
||||
else
|
||||
break;
|
||||
end;
|
||||
@ -5098,7 +5106,9 @@ begin
|
||||
end;}
|
||||
// if we are here, the identifier was not found and there was no error
|
||||
if (FirstSearchedNode<>nil) and (Params.FoundProc=nil)
|
||||
and ([fdfCollect,fdfExtractOperand]*Flags=[]) then begin
|
||||
and ([fdfCollect,fdfExtractOperand,fdfDoNotCache]*Flags=[])
|
||||
and ([fdfDoNotCache]*Params.Flags=[])
|
||||
and ([fodDoNotCache]*Params.NewFlags=[]) then begin
|
||||
// add result to cache
|
||||
Params.NewNode:=nil;
|
||||
Params.NewCodeTool:=nil;
|
||||
@ -12514,6 +12524,13 @@ var Node: TCodeTreeNode;
|
||||
begin
|
||||
{$IFDEF CheckNodeTool}CheckNodeTool(StartNode);{$ENDIF}
|
||||
if StartNode=nil then exit;
|
||||
//Node:=StartNode;
|
||||
//while Node<>nil do begin
|
||||
// if Node.Desc=ctnGenericType then
|
||||
// exit;
|
||||
// Node:=Node.Parent;
|
||||
//end;
|
||||
|
||||
if EndNode=nil then EndNode:=StartNode;
|
||||
|
||||
if Params.NewNode<>nil then begin
|
||||
@ -14083,6 +14100,7 @@ var
|
||||
OldGenParam: TGenericParams;
|
||||
begin
|
||||
Include(Flags, fdfDoNotCache);
|
||||
Include(NewFlags, fodDoNotCache);
|
||||
// NewCodeTool, NewNode=GenericParamType
|
||||
if not Assigned(NewCodeTool) or not Assigned(NewNode) then exit(false);
|
||||
if not Assigned(GenParams.ParamValuesTool)
|
||||
|
@ -335,12 +335,12 @@ var
|
||||
a1: TFld1 {declaration:GEN_1.TFld1};
|
||||
a2: TFld2 {declaration:GEN_1.TFld2};
|
||||
begin
|
||||
fv{declaration:GEN_1.fv} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
fv{declaration:GEN_1.fv} := default(_REC {declaration:GEN_1._REC} );
|
||||
|
||||
fy{declaration:GEN_1.TFld0.fy} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
fy{declaration:GEN_1.TFld0.fy} := default(_REC {declaration:GEN_1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GEN_1._REC} );
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GEN_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1} := default(TRec1 {declaration:TRec1} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
@ -350,17 +350,17 @@ end;
|
||||
|
||||
procedure GEN_1.TFld1.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG: declaration:GEN_1._REC}; // TODO: the test finds it and yet we can not jump there
|
||||
a: _REC {declaration:GEN_1._REC}; //the test finds it and yet we can not jump there
|
||||
a0: TFld0 {declaration:GEN_1.TFld0};
|
||||
a1: TFld1 {declaration:GEN_1.TFld1};
|
||||
a2: TFld2 {declaration:GEN_1.TFld2};
|
||||
begin
|
||||
fv{declaration:GEN_1.fv} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
fv{declaration:GEN_1.fv} := default(_REC {declaration:GEN_1._REC} );
|
||||
|
||||
fy{declaration:GEN_1.TFld1.fy}.r1a{ TODO: declaration:TRec1.r1a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GEN_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -369,17 +369,17 @@ end;
|
||||
|
||||
procedure GEN_1.TFld2.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GEN_1._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GEN_1._REC};
|
||||
a0: TFld0 {declaration:GEN_1.TFld0};
|
||||
a1: TFld1 {declaration:GEN_1.TFld1};
|
||||
a2: TFld2 {declaration:GEN_1.TFld2};
|
||||
begin
|
||||
fv{declaration:GEN_1.fv} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
fv{declaration:GEN_1.fv} := default(_REC {declaration:GEN_1._REC} );
|
||||
|
||||
fy{declaration:GEN_1.TFld2.fy}.r2a{ TODO: declaration:TRec2.r2a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GEN_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -388,15 +388,15 @@ end;
|
||||
|
||||
procedure GEN_1.Bar;
|
||||
var
|
||||
a: _REC { TODO: declaration:GEN_1._REC}; // TODO: cache??
|
||||
a: _REC {declaration:GEN_1._REC};
|
||||
a0: TFld0 {declaration:GEN_1.TFld0};
|
||||
a1: TFld1 {declaration:GEN_1.TFld1};
|
||||
a2: TFld2 {declaration:GEN_1.TFld2};
|
||||
begin
|
||||
fv{declaration:GEN_1.fv} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
fx{declaration:GEN_1.fx} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
fv{declaration:GEN_1.fv} := default(_REC {declaration:GEN_1._REC} );
|
||||
fx{declaration:GEN_1.fx} := default(_REC {declaration:GEN_1._REC} );
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GEN_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GEN_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -405,17 +405,17 @@ end;
|
||||
|
||||
procedure GENB_1.TFldB0.Foo;
|
||||
var
|
||||
a: _REC { TODO declaration:GENB_1._REC};
|
||||
a: _REC {declaration:GENB_1._REC};
|
||||
a0: TFldB0 {declaration:GENB_1.TFldB0};
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENB_1._REC} );
|
||||
|
||||
fy{declaration:GENB_1.TFldB0.fy} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
fy{declaration:GENB_1.TFldB0.fy} := default(_REC {declaration:GENB_1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_1._REC} );
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -424,17 +424,17 @@ end;
|
||||
|
||||
procedure GENB_1.TFldB1.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG: declaration:GENB_1._REC}; // TODO: the test finds it and yet we can not jump there
|
||||
a: _REC {declaration:GENB_1._REC};
|
||||
a0: TFldB0 {declaration:GENB_1.TFldB0};
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENB_1._REC} );
|
||||
|
||||
fy{declaration:GENB_1.TFldB1.fy}.r1a{ TODO: declaration:TRec1.r1a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -443,17 +443,17 @@ end;
|
||||
|
||||
procedure GENB_1.TFldB2.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GENB_1._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GENB_1._REC};
|
||||
a0: TFldB0 {declaration:GENB_1.TFldB0};
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENB_1._REC} );
|
||||
|
||||
fy{declaration:GENB_1.TFldB2.fy}.r2a{ TODO: declaration:TRec2.r2a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -467,10 +467,10 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
fx{declaration:GENB_1.fx} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENB_1._REC} );
|
||||
fx{declaration:GENB_1.fx} := default(_REC {declaration:GENB_1._REC} );
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -479,17 +479,17 @@ end;
|
||||
|
||||
procedure GENB_2.TFldB0.Foo;
|
||||
var
|
||||
a: _REC { TODO declaration:GENB_2._REC};
|
||||
a: _REC {declaration:GENB_2._REC};
|
||||
a0: TFldB0 {declaration:GENB_2.TFldB0};
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENB_2._REC} );
|
||||
|
||||
fy{declaration:GENB_2.TFldB0.fy} := default(_REC { TODO: declaration:GENB_1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
fy{declaration:GENB_2.TFldB0.fy} := default(_REC {declaration:GENB_2._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_2._REC} );
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -498,17 +498,17 @@ end;
|
||||
|
||||
procedure GENB_2.TFldB1.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG: declaration:GENB_2._REC}; // TODO: the test finds it and yet we can not jump there
|
||||
a: _REC {declaration:GENB_2._REC};
|
||||
a0: TFldB0 {declaration:GENB_2.TFldB0};
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENB_2._REC} );
|
||||
|
||||
fy{declaration:GENB_2.TFldB1.fy}.r1a{ TODO: declaration:TRec1.r1a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -517,17 +517,17 @@ end;
|
||||
|
||||
procedure GENB_2.TFldB2.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GENB_2._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GENB_2._REC};
|
||||
a0: TFldB0 {declaration:GENB_2.TFldB0};
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENB_2._REC} );
|
||||
|
||||
fy{declaration:GENB_2.TFldB2.fy}.r2a{ TODO: declaration:TClass1.TRec2.r2a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -536,17 +536,17 @@ end;
|
||||
|
||||
procedure GENB_2.TFldB3.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GENB_2._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GENB_2._REC};
|
||||
a0: TFldB0 {declaration:GENB_2.TFldB0};
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENB_2._REC} );
|
||||
|
||||
fy{declaration:GENB_2.TFldB3.fy}.r3a{ TODO: declaration:TClass1.TRec3.r3a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r3a{declaration:TClass1.TRec3.r3a} := 1;
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -560,10 +560,10 @@ var
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
fx{declaration:GENB_2.fx} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENB_2._REC} );
|
||||
fx{declaration:GENB_2.fx} := default(_REC {declaration:GENB_2._REC} );
|
||||
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENB_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENB_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -572,7 +572,7 @@ end;
|
||||
|
||||
procedure GENI_1.TFldI0.Foo;
|
||||
var
|
||||
a: _REC { TODO declaration:GENI_1._REC};
|
||||
a: _REC {declaration:GENI_1._REC};
|
||||
b0: TFldI0 {declaration:GENI_1.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_1.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_1.TFldI2};
|
||||
@ -580,16 +580,16 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fIv{declaration:GENI_1.fIv} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_1._REC} );
|
||||
fIv{declaration:GENI_1.fIv} := default(_REC {declaration:GENI_1._REC} );
|
||||
|
||||
fy{declaration:GENI_1.TFldI0.fy} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fy{declaration:GENI_1.TFldI0.fy} := default(_REC {declaration:GENI_1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -598,7 +598,7 @@ end;
|
||||
|
||||
procedure GENI_1.TFldI1.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG: declaration:GENI_1._REC}; // TODO: the test finds it and yet we can not jump there
|
||||
a: _REC {declaration:GENI_1._REC};
|
||||
b0: TFldI0 {declaration:GENI_1.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_1.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_1.TFldI2};
|
||||
@ -606,16 +606,16 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fIv{declaration:GENI_1.fIv} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_1._REC} );
|
||||
fIv{declaration:GENI_1.fIv} := default(_REC {declaration:GENI_1._REC} );
|
||||
|
||||
fy{declaration:GENI_1.TFldI1.fy}.r1a{ TODO: declaration:TRec1.r1a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -624,7 +624,7 @@ end;
|
||||
|
||||
procedure GENI_1.TFldI2.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GENI_1._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GENI_1._REC};
|
||||
b0: TFldI0 {declaration:GENI_1.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_1.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_1.TFldI2};
|
||||
@ -632,16 +632,16 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fIv{declaration:GENI_1.fIv} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_1._REC} );
|
||||
fIv{declaration:GENI_1.fIv} := default(_REC {declaration:GENI_1._REC} );
|
||||
|
||||
fy{declaration:GENI_1.TFldI2.fy}.r2a{ TODO: declaration:TRec2.r2a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -658,15 +658,15 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fIv{declaration:GENI_1.fIv} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fx{declaration:GENB_1.fx} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fIx{declaration:GENI_1.fIx} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_1._REC} );
|
||||
fIv{declaration:GENI_1.fIv} := default(_REC {declaration:GENI_1._REC} );
|
||||
fx{declaration:GENB_1.fx} := default(_REC {declaration:GENI_1._REC} );
|
||||
fIx{declaration:GENI_1.fIx} := default(_REC {declaration:GENI_1._REC} );
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_1._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -675,7 +675,7 @@ end;
|
||||
|
||||
procedure GENI_2B1.TFldI0.Foo;
|
||||
var
|
||||
a: _REC { TODO declaration:GENI_2B1._REC};
|
||||
a: _REC {declaration:GENI_2B1._REC};
|
||||
b0: TFldI0 {declaration:GENI_2B1.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_2B1.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_2B1.TFldI2};
|
||||
@ -683,15 +683,15 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
|
||||
fy{declaration:GENI_2B1.TFldI0.fy} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fy{declaration:GENI_2B1.TFldI0.fy} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO: declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO: declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -700,7 +700,7 @@ end;
|
||||
|
||||
procedure GENI_2B1.TFldI1.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG: declaration:GENI_2B1._REC}; // TODO: the test finds it and yet we can not jump there
|
||||
a: _REC {declaration:GENI_2B1._REC};
|
||||
b0: TFldI0 {declaration:GENI_2B1.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_2B1.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_2B1.TFldI2};
|
||||
@ -708,16 +708,16 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fIv{declaration:GENI_2B1.fIv} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
fIv{declaration:GENI_2B1.fIv} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
|
||||
fy{declaration:GENI_2B1.TFldI1.fy}.r1a{ TODO: declaration:TRec1.r1a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO: declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO: declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -726,7 +726,7 @@ end;
|
||||
|
||||
procedure GENI_2B1.TFldI2.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GENI_2B1._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GENI_2B1._REC};
|
||||
b0: TFldI0 {declaration:GENI_2B1.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_2B1.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_2B1.TFldI2};
|
||||
@ -734,15 +734,15 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
|
||||
fy{declaration:GENI_2B1.TFldI2.fy}.r2a{ TODO: declaration:TClass1.TRec2.r2a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r2a{ TODO declaration:TClass1.TRec2.r2a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -751,7 +751,7 @@ end;
|
||||
|
||||
procedure GENI_2B1.TFldI3.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GENI_2B1._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GENI_2B1._REC};
|
||||
b0: TFldI0 {declaration:GENI_2B1.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_2B1.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_2B1.TFldI2};
|
||||
@ -759,15 +759,15 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
|
||||
fy{declaration:GENI_2B1.TFldI3.fy}.r3a{ TODO: declaration:TClass1.TRec3.r3a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r3a{declaration:TClass1.TRec3.r3a} := 1;
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -784,15 +784,15 @@ var
|
||||
a1: TFldB1 {declaration:GENB_1.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_1.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_1.fv} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fIv{declaration:GENI_2B1.fIv} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fx{declaration:GENB_1.fx} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fIx{declaration:GENI_2B1.fIx} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
fv{declaration:GENB_1.fv} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
fIv{declaration:GENI_2B1.fIv} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
fx{declaration:GENB_1.fx} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
fIx{declaration:GENI_2B1.fIx} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2B1._REC} );
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2B1._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{ TODO declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -801,7 +801,7 @@ end;
|
||||
|
||||
procedure GENI_2.TFldI0.Foo;
|
||||
var
|
||||
a: _REC { TODO declaration:GENI_2._REC};
|
||||
a: _REC {declaration:GENI_2._REC};
|
||||
b0: TFldI0 {declaration:GENI_2.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_2.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_2.TFldI2};
|
||||
@ -809,16 +809,16 @@ var
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fIv{declaration:GENI_2.fIv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENI_2._REC} );
|
||||
fIv{declaration:GENI_2.fIv} := default(_REC {declaration:GENI_2._REC} );
|
||||
|
||||
fy{declaration:GENI_2.TFldI0.fy} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
FField1{ TODO declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fy{declaration:GENI_2.TFldI0.fy} := default(_REC {declaration:GENI_2._REC} );
|
||||
FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -827,7 +827,7 @@ end;
|
||||
|
||||
procedure GENI_2.TFldI1.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG: declaration:GENI_2._REC}; // TODO: the test finds it and yet we can not jump there
|
||||
a: _REC {declaration:GENI_2._REC};
|
||||
b0: TFldI0 {declaration:GENI_2.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_2.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_2.TFldI2};
|
||||
@ -835,16 +835,16 @@ var
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fIv{declaration:GENI_2.fIv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENI_2._REC} );
|
||||
fIv{declaration:GENI_2.fIv} := default(_REC {declaration:GENI_2._REC} );
|
||||
|
||||
fy{declaration:GENI_2.TFldI1.fy}.r1a{ TODO: declaration:TRec1.r1a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -853,7 +853,7 @@ end;
|
||||
|
||||
procedure GENI_2.TFldI2.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GENI_2._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GENI_2._REC};
|
||||
b0: TFldI0 {declaration:GENI_2.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_2.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_2.TFldI2};
|
||||
@ -861,16 +861,16 @@ var
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fIv{declaration:GENI_2.fIv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENI_2._REC} );
|
||||
fIv{declaration:GENI_2.fIv} := default(_REC {declaration:GENI_2._REC} );
|
||||
|
||||
fy{declaration:GENI_2.TFldI2.fy}.r2a{ TODO: declaration:TClass1.TRec2.r2a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -879,7 +879,7 @@ end;
|
||||
|
||||
procedure GENI_2.TFldI3.Foo;
|
||||
var
|
||||
a: _REC { TODO,WRONG declaration:GENI_2._REC}; // TODO: the test finds something and yet we can not jump there
|
||||
a: _REC {declaration:GENI_2._REC};
|
||||
b0: TFldI0 {declaration:GENI_2.TFldI0};
|
||||
b1: TFldI1 {declaration:GENI_2.TFldI1};
|
||||
b2: TFldI2 {declaration:GENI_2.TFldI2};
|
||||
@ -887,15 +887,15 @@ var
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENI_2._REC} );
|
||||
|
||||
fy{declaration:GENI_2.TFldI3.fy}.r3a{ TODO: declaration:TClass1.TRec3.r3a} := 1;
|
||||
FField1{declaration:GEN_Field.FField1}.r3a{declaration:TClass1.TRec3.r3a} := 1;
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
@ -912,15 +912,15 @@ var
|
||||
a1: TFldB1 {declaration:GENB_2.TFldB1};
|
||||
a2: TFldB2 {declaration:GENB_2.TFldB2};
|
||||
begin
|
||||
fv{declaration:GENB_2.fv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fIv{declaration:GENI_2.fIv} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fx{declaration:GENB_2.fx} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fIx{declaration:GENI_2.fIx} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
fv{declaration:GENB_2.fv} := default(_REC {declaration:GENI_2._REC} );
|
||||
fIv{declaration:GENI_2.fIv} := default(_REC {declaration:GENI_2._REC} );
|
||||
fx{declaration:GENB_2.fx} := default(_REC {declaration:GENI_2._REC} );
|
||||
fIx{declaration:GENI_2.fIx} := default(_REC {declaration:GENI_2._REC} );
|
||||
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
b0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
b1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
b2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC { TODO: declaration:GENI_2._REC} );
|
||||
a0.FField1{declaration:GEN_Field.FField1} := default(_REC {declaration:GENI_2._REC} );
|
||||
a1.FField1{declaration:GEN_Field.FField1}.r1a{declaration:TRec1.r1a} := 1;
|
||||
a2.FField1{declaration:GEN_Field.FField1}.r2a{declaration:TClass1.TRec2.r2a} := 1;
|
||||
end;
|
||||
|
@ -209,6 +209,15 @@ begin
|
||||
FindDeclarations(aCode);
|
||||
end;
|
||||
|
||||
type
|
||||
TFindDeclarationToolHelper = class helper for TFindDeclarationTool
|
||||
procedure ClearNodeCaches;
|
||||
end;
|
||||
procedure TFindDeclarationToolHelper.ClearNodeCaches;
|
||||
begin
|
||||
inherited ClearNodeCaches;
|
||||
end;
|
||||
|
||||
procedure TCustomTestFindDeclaration.FindDeclarations(aCode: TCodeBuffer);
|
||||
|
||||
procedure PrependPath(Prefix: string; var Path: string);
|
||||
@ -270,7 +279,7 @@ var
|
||||
FoundPath: String;
|
||||
Src: String;
|
||||
NameStartPos, i, l, IdentifierStartPos, IdentifierEndPos,
|
||||
BlockTopLine, BlockBottomLine, CommentEnd, StartOffs: Integer;
|
||||
BlockTopLine, BlockBottomLine, CommentEnd, StartOffs, TestLoop: Integer;
|
||||
Marker, ExpectedType, NewType, ExpexctedCompletion, ExpexctedTerm,
|
||||
ExpexctedCompletionPart, ExpexctedTermPart: String;
|
||||
IdentItem: TIdentifierListItem;
|
||||
@ -281,205 +290,214 @@ var
|
||||
begin
|
||||
FMainCode:=aCode;
|
||||
DoParseModule(MainCode,FMainTool);
|
||||
CommentP:=1;
|
||||
Src:=MainTool.Src;
|
||||
|
||||
CodeToolBoss.IdentComplIncludeKeywords := False;
|
||||
if pos('{%identcomplincludekeywords:on}', LowerCase(Src)) > 0 then
|
||||
CodeToolBoss.IdentComplIncludeKeywords := True;
|
||||
|
||||
while CommentP<length(Src) do begin
|
||||
CommentP:=FindNextComment(Src,CommentP);
|
||||
if CommentP>length(Src) then break;
|
||||
p:=CommentP;
|
||||
CommentP:=FindCommentEnd(Src,CommentP,MainTool.Scanner.NestedComments);
|
||||
if Src[p]<>'{' then continue;
|
||||
if Src[p+1] in ['$','%',' ',#0..#31] then continue;
|
||||
|
||||
// allow spaces before the comment
|
||||
IdentifierEndPos:=p;
|
||||
while (IdentifierEndPos>1) and (IsSpaceChar[Src[IdentifierEndPos-1]]) do
|
||||
dec(IdentifierEndPos);
|
||||
IdentifierStartPos:=IdentifierEndPos;
|
||||
while (IdentifierStartPos>1) and (IsIdentChar[Src[IdentifierStartPos-1]]) do
|
||||
dec(IdentifierStartPos);
|
||||
if IdentifierStartPos=p then begin
|
||||
WriteSource(p,MainTool);
|
||||
Fail('missing identifier in front of marker at '+MainTool.CleanPosToStr(p));
|
||||
end;
|
||||
inc(p);
|
||||
NameStartPos:=p;
|
||||
if Src[p] in ['#','@'] then begin
|
||||
{#name} {@name}
|
||||
inc(p);
|
||||
if not IsIdentStartChar[Src[p]] then begin
|
||||
WriteSource(p,MainTool);
|
||||
Fail('Expected identifier at '+MainTool.CleanPosToStr(p,true));
|
||||
for TestLoop := 0 to 2 do begin
|
||||
// Pass 1: Eval with cache from previous run
|
||||
CommentP:=1;
|
||||
while CommentP<length(Src) do begin
|
||||
if TestLoop = 2 then begin // Pass 2: Eval each test, with an empty cache
|
||||
CodeToolBoss.CurCodeTool.ClearNodeCaches;
|
||||
MainTool.ClearNodeCaches;
|
||||
end;
|
||||
NameStartPos:=p;
|
||||
while IsIdentChar[Src[p]] do inc(p);
|
||||
Marker:=copy(Src,NameStartPos,p-NameStartPos);
|
||||
AddMarker(Marker,Src[NameStartPos],CommentP,IdentifierStartPos,IdentifierEndPos);
|
||||
continue;
|
||||
end;
|
||||
|
||||
CommentEnd := CommentP;
|
||||
CommentP := p-1;
|
||||
repeat
|
||||
NameStartPos:=CommentP+1;
|
||||
p := NameStartPos;
|
||||
CommentP := PosEx('|', Src, NameStartPos);
|
||||
if (CommentP < 1) or (CommentP > CommentEnd) then
|
||||
CommentP := CommentEnd;
|
||||
CommentP:=FindNextComment(Src,CommentP);
|
||||
if CommentP>length(Src) then break;
|
||||
p:=CommentP;
|
||||
CommentP:=FindCommentEnd(Src,CommentP,MainTool.Scanner.NestedComments);
|
||||
if Src[p]<>'{' then continue;
|
||||
if Src[p+1] in ['$','%',' ',#0..#31] then continue;
|
||||
|
||||
// check for specials:
|
||||
{declaration:path}
|
||||
{guesstype:type}
|
||||
if not IsIdentStartChar[Src[p]] then continue;
|
||||
while (p<=length(Src)) and (IsIdentChar[Src[p]]) do inc(p);
|
||||
Marker:=copy(Src,NameStartPos,p-NameStartPos);
|
||||
if (p>length(Src)) or (Src[p]<>':') then begin
|
||||
// allow spaces before the comment
|
||||
IdentifierEndPos:=p;
|
||||
while (IdentifierEndPos>1) and (IsSpaceChar[Src[IdentifierEndPos-1]]) do
|
||||
dec(IdentifierEndPos);
|
||||
IdentifierStartPos:=IdentifierEndPos;
|
||||
while (IdentifierStartPos>1) and (IsIdentChar[Src[IdentifierStartPos-1]]) do
|
||||
dec(IdentifierStartPos);
|
||||
if IdentifierStartPos=p then begin
|
||||
WriteSource(p,MainTool);
|
||||
AssertEquals('Expected : at '+MainTool.CleanPosToStr(p,true),'declaration',Marker);
|
||||
Fail('missing identifier in front of marker at '+MainTool.CleanPosToStr(p));
|
||||
end;
|
||||
inc(p);
|
||||
NameStartPos:=p;
|
||||
if Src[p] in ['#','@'] then begin
|
||||
{#name} {@name}
|
||||
inc(p);
|
||||
if not IsIdentStartChar[Src[p]] then begin
|
||||
WriteSource(p,MainTool);
|
||||
Fail('Expected identifier at '+MainTool.CleanPosToStr(p,true));
|
||||
end;
|
||||
NameStartPos:=p;
|
||||
while IsIdentChar[Src[p]] do inc(p);
|
||||
Marker:=copy(Src,NameStartPos,p-NameStartPos);
|
||||
if TestLoop=0 then
|
||||
AddMarker(Marker,Src[NameStartPos],CommentP,IdentifierStartPos,IdentifierEndPos);
|
||||
continue;
|
||||
end;
|
||||
inc(p);
|
||||
PathPos:=p;
|
||||
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations Marker="',Marker,'" params: ',dbgstr(MainTool.Src,p,CommentP-p)]);
|
||||
if (Marker='declaration') or (Marker='completion') then begin
|
||||
ExpectedPath:=copy(Src,PathPos,CommentP-1-PathPos);
|
||||
{$IFDEF VerboseFindDeclarationTests}
|
||||
debugln(['TTestFindDeclaration.FindDeclarations searching "',Marker,'" at ',MainTool.CleanPosToStr(NameStartPos-1),' ExpectedPath=',ExpectedPath]);
|
||||
{$ENDIF}
|
||||
CommentEnd := CommentP;
|
||||
CommentP := p-1;
|
||||
repeat
|
||||
NameStartPos:=CommentP+1;
|
||||
p := NameStartPos;
|
||||
CommentP := PosEx('|', Src, NameStartPos);
|
||||
if (CommentP < 1) or (CommentP > CommentEnd) then
|
||||
CommentP := CommentEnd;
|
||||
|
||||
if (Marker='declaration') then begin
|
||||
MainTool.CleanPosToCaret(IdentifierStartPos,CursorPos);
|
||||
|
||||
// test FindDeclaration
|
||||
if not CodeToolBoss.FindDeclaration(CursorPos.Code,CursorPos.X,CursorPos.Y,
|
||||
FoundCursorPos.Code,FoundCursorPos.X,FoundCursorPos.Y,FoundTopLine,
|
||||
BlockTopLine,BlockBottomLine)
|
||||
then begin
|
||||
if ExpectedPath<>'' then begin
|
||||
//if (CodeToolBoss.ErrorCode<>nil) then begin
|
||||
//ErrorTool:=CodeToolBoss.GetCodeToolForSource(CodeToolBoss.ErrorCode);
|
||||
//if ErrorTool<>MainTool then
|
||||
// WriteSource(,ErrorTool);
|
||||
WriteSource(IdentifierStartPos,MainTool);
|
||||
Fail('find declaration failed at '+MainTool.CleanPosToStr(IdentifierStartPos,true)+': '+CodeToolBoss.ErrorMessage);
|
||||
end;
|
||||
continue;
|
||||
end else begin
|
||||
FoundTool:=CodeToolBoss.GetCodeToolForSource(FoundCursorPos.Code,true,true) as TFindDeclarationTool;
|
||||
FoundPath:='';
|
||||
FoundNode:=nil;
|
||||
if (FoundCursorPos.Y=1) and (FoundCursorPos.X=1) then begin
|
||||
// unit
|
||||
FoundPath:=ExtractFileNameOnly(FoundCursorPos.Code.Filename);
|
||||
end else begin
|
||||
FoundTool.CaretToCleanPos(FoundCursorPos,FoundCleanPos);
|
||||
if (FoundCleanPos>1) and (IsIdentChar[FoundTool.Src[FoundCleanPos-1]]) then
|
||||
dec(FoundCleanPos);
|
||||
FoundNode:=FoundTool.FindDeepestNodeAtPos(FoundCleanPos,true);
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations Found: ',FoundTool.CleanPosToStr(FoundNode.StartPos,true),' FoundNode=',FoundNode.DescAsString]);
|
||||
FoundPath:=NodeAsPath(FoundTool,FoundNode);
|
||||
end;
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations FoundPath=',FoundPath]);
|
||||
if LowerCase(ExpectedPath)<>LowerCase(FoundPath) then begin
|
||||
WriteSource(IdentifierStartPos,MainTool);
|
||||
AssertEquals('find declaration wrong at '+MainTool.CleanPosToStr(IdentifierStartPos,true),LowerCase(ExpectedPath),LowerCase(FoundPath));
|
||||
end;
|
||||
end;
|
||||
// check for specials:
|
||||
{declaration:path}
|
||||
{guesstype:type}
|
||||
if not IsIdentStartChar[Src[p]] then continue;
|
||||
while (p<=length(Src)) and (IsIdentChar[Src[p]]) do inc(p);
|
||||
Marker:=copy(Src,NameStartPos,p-NameStartPos);
|
||||
if (p>length(Src)) or (Src[p]<>':') then begin
|
||||
WriteSource(p,MainTool);
|
||||
AssertEquals('Expected : at '+MainTool.CleanPosToStr(p,true),'declaration',Marker);
|
||||
continue;
|
||||
end;
|
||||
inc(p);
|
||||
PathPos:=p;
|
||||
|
||||
// test identifier completion
|
||||
if (ExpectedPath<>'') then begin
|
||||
for ExpexctedCompletionPart in ExpectedPath.Split(';') do begin
|
||||
ExpexctedCompletion := ExpexctedCompletionPart;
|
||||
StartOffs := 0;
|
||||
if (ExpexctedCompletion <> '') and (ExpexctedCompletion[1] in ['+','-']) then begin
|
||||
i := Pos('=', ExpexctedCompletion);
|
||||
if i > 1 then begin
|
||||
StartOffs := StrToIntDef(copy(ExpexctedCompletion, 1, i-1), 0);
|
||||
Delete(ExpexctedCompletion, 1, i);
|
||||
end
|
||||
else
|
||||
StartOffs := 0;
|
||||
end;
|
||||
StartOffs := StartOffs + IdentifierStartPos;
|
||||
MainTool.CleanPosToCaret(StartOffs,CursorPos);
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations Marker="',Marker,'" params: ',dbgstr(MainTool.Src,p,CommentP-p)]);
|
||||
if (Marker='declaration') or (Marker='completion') then begin
|
||||
ExpectedPath:=copy(Src,PathPos,CommentP-1-PathPos);
|
||||
{$IFDEF VerboseFindDeclarationTests}
|
||||
debugln(['TTestFindDeclaration.FindDeclarations searching "',Marker,'" at ',MainTool.CleanPosToStr(NameStartPos-1),' ExpectedPath=',ExpectedPath]);
|
||||
{$ENDIF}
|
||||
|
||||
if not CodeToolBoss.GatherIdentifiers(CursorPos.Code,CursorPos.X,CursorPos.Y)
|
||||
if (Marker='declaration') then begin
|
||||
MainTool.CleanPosToCaret(IdentifierStartPos,CursorPos);
|
||||
|
||||
// test FindDeclaration
|
||||
if not CodeToolBoss.FindDeclaration(CursorPos.Code,CursorPos.X,CursorPos.Y,
|
||||
FoundCursorPos.Code,FoundCursorPos.X,FoundCursorPos.Y,FoundTopLine,
|
||||
BlockTopLine,BlockBottomLine)
|
||||
then begin
|
||||
if ExpexctedCompletion<>'' then begin
|
||||
WriteSource(StartOffs,MainTool);
|
||||
AssertEquals('GatherIdentifiers failed at '+MainTool.CleanPosToStr(StartOffs,true)+': '+CodeToolBoss.ErrorMessage,false,true);
|
||||
if ExpectedPath<>'' then begin
|
||||
//if (CodeToolBoss.ErrorCode<>nil) then begin
|
||||
//ErrorTool:=CodeToolBoss.GetCodeToolForSource(CodeToolBoss.ErrorCode);
|
||||
//if ErrorTool<>MainTool then
|
||||
// WriteSource(,ErrorTool);
|
||||
WriteSource(IdentifierStartPos,MainTool);
|
||||
Fail('find declaration (Loop: '+IntToStr(TestLoop)+') failed at '+MainTool.CleanPosToStr(IdentifierStartPos,true)+': '+CodeToolBoss.ErrorMessage);
|
||||
end;
|
||||
continue;
|
||||
end else begin
|
||||
for ExpexctedTermPart in ExpexctedCompletion.Split(',') do begin
|
||||
ExpexctedTerm := ExpexctedTermPart;
|
||||
ExpInvert := (ExpexctedTerm <> '') and (ExpexctedTerm[1] = '!');
|
||||
if ExpInvert then
|
||||
Delete(ExpexctedTerm, 1, 1);
|
||||
i:=CodeToolBoss.IdentifierList.GetFilteredCount-1;
|
||||
while i>=0 do begin
|
||||
IdentItem:=CodeToolBoss.IdentifierList.FilteredItems[i];
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations ',IdentItem.Identifier]);
|
||||
l:=length(IdentItem.Identifier);
|
||||
if ((l=length(ExpexctedTerm)) or (ExpexctedTerm[length(ExpexctedTerm)-l]='.'))
|
||||
and (CompareText(IdentItem.Identifier,RightStr(ExpexctedTerm,l))=0)
|
||||
then break;
|
||||
dec(i);
|
||||
end;
|
||||
if (i<0) and not ExpInvert then begin
|
||||
WriteSource(StartOffs,MainTool);
|
||||
AssertEquals('GatherIdentifiers misses "'+ExpexctedTerm+'" at '+MainTool.CleanPosToStr(StartOffs,true),true,i>=0);
|
||||
end
|
||||
else
|
||||
if ExpInvert and (i>=0) then begin
|
||||
WriteSource(StartOffs,MainTool);
|
||||
AssertEquals('GatherIdentifiers should not have "'+ExpexctedTerm+'" at '+MainTool.CleanPosToStr(StartOffs,true),true,i>=0);
|
||||
end;
|
||||
FoundTool:=CodeToolBoss.GetCodeToolForSource(FoundCursorPos.Code,true,true) as TFindDeclarationTool;
|
||||
FoundPath:='';
|
||||
FoundNode:=nil;
|
||||
if (FoundCursorPos.Y=1) and (FoundCursorPos.X=1) then begin
|
||||
// unit
|
||||
FoundPath:=ExtractFileNameOnly(FoundCursorPos.Code.Filename);
|
||||
end else begin
|
||||
FoundTool.CaretToCleanPos(FoundCursorPos,FoundCleanPos);
|
||||
if (FoundCleanPos>1) and (IsIdentChar[FoundTool.Src[FoundCleanPos-1]]) then
|
||||
dec(FoundCleanPos);
|
||||
FoundNode:=FoundTool.FindDeepestNodeAtPos(FoundCleanPos,true);
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations Found: ',FoundTool.CleanPosToStr(FoundNode.StartPos,true),' FoundNode=',FoundNode.DescAsString]);
|
||||
FoundPath:=NodeAsPath(FoundTool,FoundNode);
|
||||
end;
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations FoundPath=',FoundPath]);
|
||||
if LowerCase(ExpectedPath)<>LowerCase(FoundPath) then begin
|
||||
WriteSource(IdentifierStartPos,MainTool);
|
||||
AssertEquals('find declaration (Loop: '+IntToStr(TestLoop)+') wrong at '+MainTool.CleanPosToStr(IdentifierStartPos,true),LowerCase(ExpectedPath),LowerCase(FoundPath));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
end else if Marker='guesstype' then begin
|
||||
ExpectedType:=copy(Src,PathPos,CommentP-1-PathPos);
|
||||
{$IFDEF VerboseFindDeclarationTests}
|
||||
debugln(['TTestFindDeclaration.FindDeclarations "',Marker,'" at ',Tool.CleanPosToStr(NameStartPos-1),' ExpectedType=',ExpectedType]);
|
||||
{$ENDIF}
|
||||
MainTool.CleanPosToCaret(IdentifierStartPos,CursorPos);
|
||||
|
||||
// test GuessTypeOfIdentifier
|
||||
ListOfPFindContext:=nil;
|
||||
try
|
||||
if not CodeToolBoss.GuessTypeOfIdentifier(CursorPos.Code,CursorPos.X,CursorPos.Y,
|
||||
ItsAKeyword, IsSubIdentifier, ExistingDefinition, ListOfPFindContext,
|
||||
NewExprType, NewType)
|
||||
then begin
|
||||
if ExpectedType<>'' then
|
||||
AssertEquals('GuessTypeOfIdentifier failed at '+MainTool.CleanPosToStr(IdentifierStartPos,true)+': '+CodeToolBoss.ErrorMessage,false,true);
|
||||
continue;
|
||||
end else begin
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations FoundPath=',FoundPath]);
|
||||
if LowerCase(ExpectedType)<>LowerCase(NewType) then begin
|
||||
WriteSource(IdentifierStartPos,MainTool);
|
||||
AssertEquals('GuessTypeOfIdentifier wrong at '+MainTool.CleanPosToStr(IdentifierStartPos,true),LowerCase(ExpectedType),LowerCase(NewType));
|
||||
// test identifier completion
|
||||
if (ExpectedPath<>'') then begin
|
||||
for ExpexctedCompletionPart in ExpectedPath.Split(';') do begin
|
||||
ExpexctedCompletion := ExpexctedCompletionPart;
|
||||
StartOffs := 0;
|
||||
if (ExpexctedCompletion <> '') and (ExpexctedCompletion[1] in ['+','-']) then begin
|
||||
i := Pos('=', ExpexctedCompletion);
|
||||
if i > 1 then begin
|
||||
StartOffs := StrToIntDef(copy(ExpexctedCompletion, 1, i-1), 0);
|
||||
Delete(ExpexctedCompletion, 1, i);
|
||||
end
|
||||
else
|
||||
StartOffs := 0;
|
||||
end;
|
||||
StartOffs := StartOffs + IdentifierStartPos;
|
||||
MainTool.CleanPosToCaret(StartOffs,CursorPos);
|
||||
|
||||
if not CodeToolBoss.GatherIdentifiers(CursorPos.Code,CursorPos.X,CursorPos.Y)
|
||||
then begin
|
||||
if ExpexctedCompletion<>'' then begin
|
||||
WriteSource(StartOffs,MainTool);
|
||||
AssertEquals('GatherIdentifiers (Loop: '+IntToStr(TestLoop)+') failed at '+MainTool.CleanPosToStr(StartOffs,true)+': '+CodeToolBoss.ErrorMessage,false,true);
|
||||
end;
|
||||
continue;
|
||||
end else begin
|
||||
for ExpexctedTermPart in ExpexctedCompletion.Split(',') do begin
|
||||
ExpexctedTerm := ExpexctedTermPart;
|
||||
ExpInvert := (ExpexctedTerm <> '') and (ExpexctedTerm[1] = '!');
|
||||
if ExpInvert then
|
||||
Delete(ExpexctedTerm, 1, 1);
|
||||
i:=CodeToolBoss.IdentifierList.GetFilteredCount-1;
|
||||
while i>=0 do begin
|
||||
IdentItem:=CodeToolBoss.IdentifierList.FilteredItems[i];
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations ',IdentItem.Identifier]);
|
||||
l:=length(IdentItem.Identifier);
|
||||
if ((l=length(ExpexctedTerm)) or (ExpexctedTerm[length(ExpexctedTerm)-l]='.'))
|
||||
and (CompareText(IdentItem.Identifier,RightStr(ExpexctedTerm,l))=0)
|
||||
then break;
|
||||
dec(i);
|
||||
end;
|
||||
if (i<0) and not ExpInvert then begin
|
||||
WriteSource(StartOffs,MainTool);
|
||||
AssertEquals('GatherIdentifiers misses "'+ExpexctedTerm+'" at '+MainTool.CleanPosToStr(StartOffs,true),true,i>=0);
|
||||
end
|
||||
else
|
||||
if ExpInvert and (i>=0) then begin
|
||||
WriteSource(StartOffs,MainTool);
|
||||
AssertEquals('GatherIdentifiers should not have "'+ExpexctedTerm+'" at '+MainTool.CleanPosToStr(StartOffs,true),true,i>=0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
FreeListOfPFindContext(ListOfPFindContext);
|
||||
end;
|
||||
end
|
||||
end else if Marker='guesstype' then begin
|
||||
ExpectedType:=copy(Src,PathPos,CommentP-1-PathPos);
|
||||
{$IFDEF VerboseFindDeclarationTests}
|
||||
debugln(['TTestFindDeclaration.FindDeclarations "',Marker,'" at ',Tool.CleanPosToStr(NameStartPos-1),' ExpectedType=',ExpectedType]);
|
||||
{$ENDIF}
|
||||
MainTool.CleanPosToCaret(IdentifierStartPos,CursorPos);
|
||||
|
||||
end else begin
|
||||
WriteSource(IdentifierStartPos,MainTool);
|
||||
AssertEquals('Unknown marker at '+MainTool.CleanPosToStr(IdentifierStartPos,true),'declaration',Marker);
|
||||
continue;
|
||||
end;
|
||||
until CommentP >= CommentEnd;
|
||||
// test GuessTypeOfIdentifier
|
||||
ListOfPFindContext:=nil;
|
||||
try
|
||||
if not CodeToolBoss.GuessTypeOfIdentifier(CursorPos.Code,CursorPos.X,CursorPos.Y,
|
||||
ItsAKeyword, IsSubIdentifier, ExistingDefinition, ListOfPFindContext,
|
||||
NewExprType, NewType)
|
||||
then begin
|
||||
if ExpectedType<>'' then
|
||||
AssertEquals('GuessTypeOfIdentifier (Loop: '+IntToStr(TestLoop)+') failed at '+MainTool.CleanPosToStr(IdentifierStartPos,true)+': '+CodeToolBoss.ErrorMessage,false,true);
|
||||
continue;
|
||||
end else begin
|
||||
//debugln(['TTestFindDeclaration.FindDeclarations FoundPath=',FoundPath]);
|
||||
if LowerCase(ExpectedType)<>LowerCase(NewType) then begin
|
||||
WriteSource(IdentifierStartPos,MainTool);
|
||||
AssertEquals('GuessTypeOfIdentifier (Loop: '+IntToStr(TestLoop)+') wrong at '+MainTool.CleanPosToStr(IdentifierStartPos,true),LowerCase(ExpectedType),LowerCase(NewType));
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
FreeListOfPFindContext(ListOfPFindContext);
|
||||
end;
|
||||
|
||||
end else begin
|
||||
WriteSource(IdentifierStartPos,MainTool);
|
||||
AssertEquals('Unknown marker at '+MainTool.CleanPosToStr(IdentifierStartPos,true),'declaration',Marker);
|
||||
continue;
|
||||
end;
|
||||
until CommentP >= CommentEnd;
|
||||
end;
|
||||
end;
|
||||
CheckReferenceMarkers;
|
||||
CodeToolBoss.IdentComplIncludeKeywords := False;
|
||||
|
Loading…
Reference in New Issue
Block a user