Exemplo n.º 1
0
        public static LuaValue loadstring(LuaValue[] values)
        {
            LuaString code       = values[0] as LuaString;
            LuaTable  enviroment = values[1] as LuaTable;
            Chunk     chunk      = LuaInterpreter.Parse(code.Text);

            LuaFunction func = new LuaFunction(
                (LuaValue[] args) =>
            {
                chunk.Enviroment = enviroment;
                return(chunk.Execute());
            }
                );

            return(func);
        }