示例#1
0
 public void Run(Context cx)
 {
     cx.SetReg(A, new Table(Context.TblFbp(B), Context.TblSz(C)));
     if (cx.IsLocal(A))
     {
         cx.SetSReg(A, cx.LocalName(A) + "[]");
     }
     else
     {
         cx.SetSReg(A, "{}");
     }
 }
示例#2
0
        public override string ToString(Context cx)
        {
            string content  = cx.SR(A) + "(" + cx.ListSR(A + 1, A + B - 1, "") + ")";
            bool   haslocal = false;

            for (ushort i = A; i <= A + C - 2; i++)
            {
                if (!cx.IsLocal(i))
                {
                    cx.DefineLocal(i);                                     //this fails, if this Register is used otherwise later
                }
                if (cx.IsLocal(i))
                {
                    haslocal = true;
                }
            }

            if (A <= A + C - 2)
            {
                if (!haslocal)
                {
                    if (!ObjLuaFunction.DEBUG)
                    {
                        return("");
                    }
                    return("// " + ListR(A, A + C - 2, " = ", ", ... ,") + content);
                }
                else
                {
                    string ret = "";
                    for (ushort i = A; i <= A + C - 2; i++)
                    {
                        if (i > A)
                        {
                            ret += ",";
                        }
                        if (cx.IsLocal(i))
                        {
                            ret += cx.LocalName(i);
                        }
                        else
                        {
                            ret += R(i);
                        }
                    }

                    return(ret + " = " + content);
                }
            }

            return(content);
        }
示例#3
0
 public override string ToString(Context cx)
 {
     if (cx.IsLocal(A))
     {
         return(cx.LocalName(A) + " = !" + cx.SR(B));
     }
     else
     {
         if (!ObjLuaFunction.DEBUG)
         {
             return("");
         }
         return("// " + R(A) + " = !" + cx.SR(B));
     }
 }
示例#4
0
 protected string Assign(ushort reg, Context cx, object val)
 {
     if (cx.IsLocal(reg))
     {
         return(cx.LocalName(reg) + " = " + val);
     }
     else if (R(reg).ToString().StartsWith("{R"))
     {
         if (!ObjLuaFunction.DEBUG)
         {
             return("");
         }
         return("// " + R(reg) + " = " + val);
     }
     else
     {
         return(R(reg) + " = " + val);
     }
 }