public override void Visit(RppArray node) { node.Initializers.ForEach(arg => arg.Accept(this)); }
public override void Visit(RppArray node) { var arrayType = node.Type.Value.NativeType; Type elementType = arrayType.GetElementType(); LocalBuilder arrVar = _body.DeclareLocal(arrayType); ClrCodegenUtils.LoadInt(node.Size, _body); _body.Emit(OpCodes.Newarr, elementType); ClrCodegenUtils.StoreLocal(arrVar, _body); int index = 0; foreach (var initializer in node.Initializers) { ClrCodegenUtils.LoadLocal(arrVar, _body); ClrCodegenUtils.LoadInt(index, _body); initializer.Accept(this); _body.Emit(OpCodes.Stelem, elementType); index++; } ClrCodegenUtils.LoadLocal(arrVar, _body); }
public virtual void Visit(RppArray node) { }