Esempio n. 1
0
File: LuaEx.cs Progetto: s72785/des
        public void TestToXml()
        {
            using (var lua = new Lua())
            {
                var f = lua.CreateLambda <Func <LuaTable> >("test.lua", "return { ['test  a'] = 12, hallo = 'Welt', 1, 4, sub = { sub = 'test', guid = clr.System.Guid.NewGuid() }, subarray = { 1, 2, 3, 4, 5 } }");
                var t = f();

                var x = t.ToXml();
                Console.WriteLine(x.ToString());

                var t2 = Procs.CreateLuaTable(x);
                Assert.AreEqual(12, t2["test  a"]);
                Assert.AreEqual("Welt", t2["hallo"]);
                Assert.AreEqual(4, t2[2]);
                // todo:
            }
        }
Esempio n. 2
0
        }         // func CheckForExceptionResult

        public async Task <LuaTable> GetTableAsync(string path, XName rootName = null)
        => Procs.CreateLuaTable(CheckForExceptionResult(await GetXmlAsync(path, rootName: (rootName ?? "return"))));