示例#1
0
        public static TableElement Load(string path)
        {
            var source = File.ReadAllText(path ?? throw new ArgumentNullException(nameof(path))).AsStream();

            var rep = LuaTableParser.RecipeParser(source);

            return(rep.Case((str, _) => throw new ParseException(str.Current), (_, elem) => elem));
        }
        public void ReadAllItemTest()
        {
            var files = Directory.GetFiles("./ItemSample");

            foreach (var path in files)
            {
                var source = File.ReadAllText(path).AsStream();
                LuaTableParser.RecipeParser(source).IsSuccess().IsTrue();
            }
        }