Expr TableSetValue(Expr table, FieldVisit field, ref double intIndex) { switch (field.Type) { case FieldVisitType.Implicit: return(Expr.Call(table, MemberInfos.LuaTableSetValue, Expr.Constant(intIndex++, typeof(object)), Expr.Convert(field.Value, typeof(object)))); case FieldVisitType.Explicit: return(Expr.Call(table, MemberInfos.LuaTableSetValue, Expr.Convert(field.Member, typeof(object)), Expr.Convert(field.Value, typeof(object)))); default: throw new ArgumentOutOfRangeException(); } }
FieldVisit IFieldVisitor <FieldVisit> .Visit(Field.Normal field) { return(FieldVisit.CreateImplicit(field.Value.Visit(this))); }
FieldVisit IFieldVisitor <FieldVisit> .Visit(Field.MemberId field) { return(FieldVisit.CreateExplicit(Expr.Constant(field.Member), field.Value.Visit(this))); }
FieldVisit IFieldVisitor <FieldVisit> .Visit(Field.MemberExpr field) { return(FieldVisit.CreateExplicit(field.Member.Visit(this), field.Value.Visit(this))); }