Exemplo n.º 1
0
        private Demo ParseDemo(string demoFolder)
        {
            var demoJson     = _jsonImporter.GetMetadata(demoFolder);
            var codeFilePath = Path.Join(demoFolder, demoJson.SourceFileName);
            var demo         = demoJson.ToDemo();
            var language     = _settings.Language;

            var codeOutput = DemoCodeBuilder.Initialize(codeFilePath, language)
                             .SetUsings()
                             .SetDemoBody()
                             .SetFileHash()
                             .Build();

            var merger = new DemoMerger(codeOutput);

            try
            {
                merger.MergeTo(demo);
            }
            catch (Exception e)
            {
                throw new ParsingException(
                          $"An exception occurred when parsing {codeFilePath}. Check inner exception for details.", e);
            }
            return(demo);
        }
Exemplo n.º 2
0
 protected DemoCodeBuilder GetBuilder(string filePath, DemoLanguage language)
 => DemoCodeBuilder.Initialize(filePath, language);