- remove no longer needed global variable allow_array_constructor

git-svn-id: trunk@36103 -
This commit is contained in:
svenbarth 2017-05-04 21:58:14 +00:00
parent 6d512ddac7
commit 1aa80f77cb
4 changed files with 1 additions and 17 deletions

View File

@ -146,9 +146,6 @@ interface
(tok:_OP_COPY ; managementoperator: mop_copy) (tok:_OP_COPY ; managementoperator: mop_copy)
); );
{ true, if we are parsing stuff which allows array constructors }
allow_array_constructor : boolean = false;
function node2opstr(nt:tnodetype):string; function node2opstr(nt:tnodetype):string;
function token2managementoperator(optoken:ttoken):tmanagementoperator; function token2managementoperator(optoken:ttoken):tmanagementoperator;

View File

@ -1037,8 +1037,6 @@ implementation
begin begin
if assigned(right) then if assigned(right) then
tcallparanode(right).get_paratype; tcallparanode(right).get_paratype;
old_array_constructor:=allow_array_constructor;
allow_array_constructor:=true;
if assigned(fparainit) then if assigned(fparainit) then
typecheckpass(fparainit); typecheckpass(fparainit);
typecheckpass(left); typecheckpass(left);
@ -1046,7 +1044,6 @@ implementation
typecheckpass(third); typecheckpass(third);
if assigned(fparacopyback) then if assigned(fparacopyback) then
typecheckpass(fparacopyback); typecheckpass(fparacopyback);
allow_array_constructor:=old_array_constructor;
if codegenerror then if codegenerror then
resultdef:=generrordef resultdef:=generrordef
else else

View File

@ -324,7 +324,6 @@ implementation
named_args_allowed:=false; named_args_allowed:=false;
got_addrn:=false; got_addrn:=false;
getprocvardef:=nil; getprocvardef:=nil;
allow_array_constructor:=false;
{ show info } { show info }
Message1(parser_i_compiling,filename); Message1(parser_i_compiling,filename);

View File

@ -152,8 +152,7 @@ implementation
var var
p1,p2,argname : tnode; p1,p2,argname : tnode;
prev_in_args, prev_in_args,
old_named_args_allowed, old_named_args_allowed : boolean;
old_allow_array_constructor : boolean;
begin begin
if token=end_of_paras then if token=end_of_paras then
begin begin
@ -162,12 +161,10 @@ implementation
end; end;
{ save old values } { save old values }
prev_in_args:=in_args; prev_in_args:=in_args;
old_allow_array_constructor:=allow_array_constructor;
old_named_args_allowed:=named_args_allowed; old_named_args_allowed:=named_args_allowed;
{ set para parsing values } { set para parsing values }
in_args:=true; in_args:=true;
named_args_allowed:=false; named_args_allowed:=false;
allow_array_constructor:=true;
p2:=nil; p2:=nil;
repeat repeat
if __namedpara then if __namedpara then
@ -214,7 +211,6 @@ implementation
end end
end; end;
until not try_to_consume(_COMMA); until not try_to_consume(_COMMA);
allow_array_constructor:=old_allow_array_constructor;
in_args:=prev_in_args; in_args:=prev_in_args;
named_args_allowed:=old_named_args_allowed; named_args_allowed:=old_named_args_allowed;
parse_paras:=p2; parse_paras:=p2;
@ -3257,7 +3253,6 @@ implementation
p1,p2 : tnode; p1,p2 : tnode;
lastp, lastp,
buildp : tarrayconstructornode; buildp : tarrayconstructornode;
old_allow_array_constructor : boolean;
begin begin
buildp:=nil; buildp:=nil;
lastp:=nil; lastp:=nil;
@ -3267,9 +3262,6 @@ 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([ef_accept_equal]); p1:=comp_expr([ef_accept_equal]);
if try_to_consume(_POINTPOINT) then if try_to_consume(_POINTPOINT) then
begin begin
@ -3287,7 +3279,6 @@ 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);
buildp.allow_array_constructor:=block_type in [bt_body,bt_except]; buildp.allow_array_constructor:=block_type in [bt_body,bt_except];