mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-06 05:47:14 +01:00
* nested open array constructors are not allowed, resolves #17213
git-svn-id: trunk@15876 -
This commit is contained in:
parent
14247ef2db
commit
700f687692
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10629,6 +10629,7 @@ tests/webtbs/tw17164.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw17180.pp svneol=native#text/plain
|
tests/webtbs/tw17180.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw17181.pp svneol=native#text/plain
|
tests/webtbs/tw17181.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1720.pp svneol=native#text/plain
|
tests/webtbs/tw1720.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw17213.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw1735.pp svneol=native#text/plain
|
tests/webtbs/tw1735.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1737.pp svneol=native#text/plain
|
tests/webtbs/tw1737.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1744.pp svneol=native#text/plain
|
tests/webtbs/tw1744.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -1712,6 +1712,7 @@ implementation
|
|||||||
p1,p2 : tnode;
|
p1,p2 : tnode;
|
||||||
lastp,
|
lastp,
|
||||||
buildp : tarrayconstructornode;
|
buildp : tarrayconstructornode;
|
||||||
|
old_allow_array_constructor : boolean;
|
||||||
begin
|
begin
|
||||||
buildp:=nil;
|
buildp:=nil;
|
||||||
{ be sure that a least one arrayconstructn is used, also for an
|
{ be sure that a least one arrayconstructn is used, also for an
|
||||||
@ -1720,6 +1721,9 @@ implementation
|
|||||||
buildp:=carrayconstructornode.create(nil,buildp)
|
buildp:=carrayconstructornode.create(nil,buildp)
|
||||||
else
|
else
|
||||||
repeat
|
repeat
|
||||||
|
{ nested array constructors are not allowed, see also tests/webtbs/tw17213.pp }
|
||||||
|
old_allow_array_constructor:=allow_array_constructor;
|
||||||
|
allow_array_constructor:=false;
|
||||||
p1:=comp_expr(true);
|
p1:=comp_expr(true);
|
||||||
if try_to_consume(_POINTPOINT) then
|
if try_to_consume(_POINTPOINT) then
|
||||||
begin
|
begin
|
||||||
@ -1737,6 +1741,7 @@ implementation
|
|||||||
lastp.right:=carrayconstructornode.create(p1,nil);
|
lastp.right:=carrayconstructornode.create(p1,nil);
|
||||||
lastp:=tarrayconstructornode(lastp.right);
|
lastp:=tarrayconstructornode(lastp.right);
|
||||||
end;
|
end;
|
||||||
|
allow_array_constructor:=old_allow_array_constructor;
|
||||||
{ there could be more elements }
|
{ there could be more elements }
|
||||||
until not try_to_consume(_COMMA);
|
until not try_to_consume(_COMMA);
|
||||||
factor_read_set:=buildp;
|
factor_read_set:=buildp;
|
||||||
|
|||||||
16
tests/webtbs/tw17213.pp
Normal file
16
tests/webtbs/tw17213.pp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
program openarrayparam;
|
||||||
|
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
|
||||||
|
{$ifdef mswindows}{$apptype console}{$endif}
|
||||||
|
uses
|
||||||
|
sysutils;
|
||||||
|
type
|
||||||
|
testflagty = (tf_1,tf2);
|
||||||
|
testflagsty = set of testflagty;
|
||||||
|
|
||||||
|
procedure testproc(const testpar: array of testflagsty);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
testproc([[],[],[]]);
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user