Browse Source

* keep track of allow_array_constructor as part of the array constructor node

git-svn-id: trunk@36099 -
svenbarth 8 years ago
parent
commit
82b2d22ed6
4 changed files with 5 additions and 0 deletions
  1. 1 0
      compiler/jvm/njvmcnv.pas
  2. 2 0
      compiler/nld.pas
  3. 1 0
      compiler/nopt.pas
  4. 1 0
      compiler/pexpr.pas

+ 1 - 0
compiler/jvm/njvmcnv.pas

@@ -502,6 +502,7 @@ implementation
           end;
         if not assigned(procdefparas) then
           procdefparas:=carrayconstructornode.create(nil,nil);
+        procdefparas.allow_array_constructor:=true;
         constrparas:=ccallparanode.create(procdefparas,constrparas);
         result:=ccallnode.createinternmethod(cloadvmtaddrnode.create(ctypenode.create(tcpuprocvardef(resultdef).classdef)),'CREATE',constrparas);
         { typecast to the procvar type }

+ 2 - 0
compiler/nld.pas

@@ -108,6 +108,7 @@ interface
        tarrayconstructorrangenodeclass = class of tarrayconstructorrangenode;
 
        tarrayconstructornode = class(tbinarynode)
+          allow_array_constructor : boolean;
          private
           function has_range_node:boolean;
          protected
@@ -984,6 +985,7 @@ implementation
     constructor tarrayconstructornode.create(l,r : tnode);
       begin
          inherited create(arrayconstructorn,l,r);
+         allow_array_constructor:=false;
       end;
 
 

+ 1 - 0
compiler/nopt.pas

@@ -337,6 +337,7 @@ begin
       include(sn.flags,nf_internal);
     end;
   arrp:=carrayconstructornode.create(sn,arrp);
+  arrp.allow_array_constructor:=true;
   if assigned(aktassignmentnode) and
      (aktassignmentnode.right=p) and
      (aktassignmentnode.left.resultdef=p.resultdef) and

+ 1 - 0
compiler/pexpr.pas

@@ -3290,6 +3290,7 @@ implementation
              allow_array_constructor:=old_allow_array_constructor;
            { there could be more elements }
            until not try_to_consume(_COMMA);
+           buildp.allow_array_constructor:=allow_array_constructor;
            factor_read_set:=buildp;
          end;