mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 15:17:32 +01:00
+ tarrayconstructornode: add utility method has_range_node to check whether the array constructor node tree contains any range node
git-svn-id: trunk@36091 -
This commit is contained in:
parent
4a2266ac44
commit
b1c66dee9b
@ -108,6 +108,8 @@ interface
|
|||||||
tarrayconstructorrangenodeclass = class of tarrayconstructorrangenode;
|
tarrayconstructorrangenodeclass = class of tarrayconstructorrangenode;
|
||||||
|
|
||||||
tarrayconstructornode = class(tbinarynode)
|
tarrayconstructornode = class(tbinarynode)
|
||||||
|
private
|
||||||
|
function has_range_node:boolean;
|
||||||
protected
|
protected
|
||||||
procedure wrapmanagedvarrec(var n: tnode);virtual;abstract;
|
procedure wrapmanagedvarrec(var n: tnode);virtual;abstract;
|
||||||
public
|
public
|
||||||
@ -987,6 +989,24 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tarrayconstructornode.has_range_node:boolean;
|
||||||
|
var
|
||||||
|
n : tarrayconstructornode;
|
||||||
|
begin
|
||||||
|
result:=false;
|
||||||
|
n:=self;
|
||||||
|
while assigned(n) do
|
||||||
|
begin
|
||||||
|
if assigned(n.left) and (n.left.nodetype=arrayconstructorrangen) then
|
||||||
|
begin
|
||||||
|
result:=true;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
n:=tarrayconstructornode(n.right);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tarrayconstructornode.pass_typecheck:tnode;
|
function tarrayconstructornode.pass_typecheck:tnode;
|
||||||
var
|
var
|
||||||
hdef : tdef;
|
hdef : tdef;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user