Browse Source

- remove no longer needed global variable allow_array_constructor

git-svn-id: trunk@36103 -
svenbarth 8 years ago
parent
commit
1aa80f77cb
4 changed files with 1 additions and 17 deletions
  1. 0 3
      compiler/htypechk.pas
  2. 0 3
      compiler/ncal.pas
  3. 0 1
      compiler/parser.pas
  4. 1 10
      compiler/pexpr.pas

+ 0 - 3
compiler/htypechk.pas

@@ -146,9 +146,6 @@ interface
         (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 token2managementoperator(optoken:ttoken):tmanagementoperator;
 

+ 0 - 3
compiler/ncal.pas

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

+ 0 - 1
compiler/parser.pas

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

+ 1 - 10
compiler/pexpr.pas

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