Exemple #1
0
        internal override void Walk(EmitContext ec)
        {
            if (ec.Emitting)
            {
                ec.EmitRArray(alen);
            }

            int i = 0;

            for (RNode n = this; n != null;)
            {
                if (n is RNArray)
                {
                    if (n.head != null)
                    {
                        if (ec.Emitting)
                        {
                            ec.EmitDup();
                            ec.EmitInt(i);
                        }
                        n.head.Walk(ec);
                        if (ec.Emitting)
                        {
                            ec.EmitRArraySet();
                        }
                    }
                    n = n.next;
                    i++;
                }
                else
                {
                    // n.Walk(ec);
                    // break;
                    throw new NotSupportedException("bug: array has tail of type " + n.GetType().Name);
                }
            }
        }
Exemple #2
0
 internal override void Walk(EmitContext ec)
 {
     if(ec.Emitting) {
         ec.EmitRArray(alen);
     }
     
     int i = 0;
     for(RNode n = this; n != null; ) {
         if(n is RNArray) {
             if(n.head != null) {
                 if(ec.Emitting) {
                     ec.EmitDup();
                     ec.EmitInt(i);
                 }
                 n.head.Walk(ec);
                 if(ec.Emitting) {
                     ec.EmitRArraySet();
                 }
             }
             n = n.next;
             i++;
         } else {
             // n.Walk(ec);
             // break;
             throw new NotSupportedException("bug: array has tail of type " + n.GetType().Name);
         }
     }
 }