コード例 #1
0
        private void TranspileCharsFile(string sphereCharsFileName, TranspileSaveOptions options)
        {
            Console.WriteLine($"Parsing {sphereCharsFileName}");
            string src = File.ReadAllText(sphereCharsFileName);

            compilation.AddCharSaveFile(sphereCharsFileName, src);
            CheckCompilationErrors();

            var outputFileName = GetOutputFileName(Path.GetFileName(sphereCharsFileName), options);

            Console.WriteLine($"Transpiling to {outputFileName}");
            var transpiler = new CharsTranspiler(compilation.DefinitionRepository);

            string result = transpiler.Transpile(compilation.CompiledCharSaveFile.ParsedTree);

            File.WriteAllText(outputFileName, result);
        }
コード例 #2
0
 private void ParseCharSave(string savePath)
 => ParseSaveFile(savePath, "spherechars.scp", (name, src) => compilation.AddCharSaveFile(name, src));