Ejemplo n.º 1
0
        public static void LoadString()
        {
            StackState s = RunEnvironment.Instance.LocalStack;

            ScriptObject arg1 = s.GetStackVar(0);

            if (arg1.Type == ScriptInterpreter.RunTime.ValueType.STRING)
            {
                Expression e = RunEnvironment.Instance.CompilationUnit(arg1.Value.RefPartHandle.StringValue);

                Func <ScriptObject> a = Expression.Lambda <Func <ScriptObject> >(e).Compile();

                ScriptObject resoult = a();

                if (resoult == null)
                {
                    s.SetReturnVoid();
                }

                else
                {
                    s.SetReturn(resoult);
                }

                return;
            }
            s.SetReturnVoid();
        }
Ejemplo n.º 2
0
        public static void GetTypeOf()
        {
            StackState s = RunEnvironment.Instance.LocalStack;

            ScriptObject arg1 = s.GetStackVar(0);

            ScriptObject resoult = ScriptObject.CreateString(arg1.GetTypeof());

            s.SetReturn(resoult);
        }
Ejemplo n.º 3
0
        public static void GetMetatable()
        {
            StackState s = RunEnvironment.Instance.LocalStack;

            ScriptObject arg1 = s.GetStackVar(0);

            if (arg1.Type == ScriptInterpreter.RunTime.ValueType.TABLE)
            {
                ScriptObject metaTable = arg1.Value.RefPartHandle.ConverToTablePart().MetaTable;

                if (metaTable != null)
                {
                    s.SetReturn(metaTable);
                }
            }
            s.SetReturnVoid();
        }