+ arrayvar[l..h] now valid parameter for open array.

git-svn-id: trunk@5064 -
This commit is contained in:
daniel 2006-10-29 17:45:09 +00:00
parent 71af18855e
commit 67851f6aba
2 changed files with 19 additions and 10 deletions

View File

@ -718,7 +718,10 @@ implementation
{ check type of the index value }
if (compare_defs(right.resulttype.def,tarraydef(left.resulttype.def).rangetype.def,right.nodetype)=te_incompatible) then
IncompatibleTypes(right.resulttype.def,tarraydef(left.resulttype.def).rangetype.def);
resulttype:=tarraydef(left.resulttype.def).elementtype;
if right.nodetype=rangen then
resulttype:=left.resulttype
else
resulttype:=Tarraydef(left.resulttype.def).elementtype;
end;
pointerdef :
begin

View File

@ -1922,20 +1922,31 @@ implementation
p3:=caddnode.create(muln,cordconstnode.create($10,s32inttype,false),p2);
p2:=comp_expr(true);
p2:=caddnode.create(addn,p2,p3);
if try_to_consume(_POINTPOINT) then
{ Support mem[$a000:$0000..$07ff] which returns array [0..$7ff] of memtype.}
p2:=crangenode.create(p2,caddnode.create(addn,comp_expr(true),p3.getcopy));
p1:=cvecnode.create(p1,p2);
include(tvecnode(p1).flags,nf_memseg);
include(tvecnode(p1).flags,nf_memindex);
end
else
begin
if try_to_consume(_POINTPOINT) then
{ Support mem[$80000000..$80000002] which returns array [0..2] of memtype.}
p2:=crangenode.create(p2,comp_expr(true));
p1:=cvecnode.create(p1,p2);
include(tvecnode(p1).flags,nf_memindex);
end;
end
else
begin
if try_to_consume(_POINTPOINT) then
{ Support arrayvar[0..9] which returns array [0..9] of arraytype.}
p2:=crangenode.create(p2,comp_expr(true));
p1:=cvecnode.create(p1,p2);
end;
end;
end;
else
ok := false;
end;
@ -1986,13 +1997,8 @@ implementation
consume(_ID);
end;
variantdef:
begin
{ dispatch call }
if token=_ID then
begin
consume(_ID);
end;
end;
try_to_consume(_ID);
classrefdef:
begin
if token=_ID then