mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 07:34:28 +02: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;
|
||||
|
||||
tarrayconstructornode = class(tbinarynode)
|
||||
private
|
||||
function has_range_node:boolean;
|
||||
protected
|
||||
procedure wrapmanagedvarrec(var n: tnode);virtual;abstract;
|
||||
public
|
||||
@ -987,6 +989,24 @@ implementation
|
||||
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;
|
||||
var
|
||||
hdef : tdef;
|
||||
|
Loading…
Reference in New Issue
Block a user