Пример #1
0
        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();
            }
        }
Пример #2
0
 FieldVisit IFieldVisitor <FieldVisit> .Visit(Field.Normal field)
 {
     return(FieldVisit.CreateImplicit(field.Value.Visit(this)));
 }
Пример #3
0
 FieldVisit IFieldVisitor <FieldVisit> .Visit(Field.MemberId field)
 {
     return(FieldVisit.CreateExplicit(Expr.Constant(field.Member), field.Value.Visit(this)));
 }
Пример #4
0
 FieldVisit IFieldVisitor <FieldVisit> .Visit(Field.MemberExpr field)
 {
     return(FieldVisit.CreateExplicit(field.Member.Visit(this), field.Value.Visit(this)));
 }