public DeltinScript(TranslateSettings translateSettings)
        {
            FileGetter     = translateSettings.FileGetter;
            Diagnostics    = translateSettings.Diagnostics;
            Language       = translateSettings.OutputLanguage;
            OptimizeOutput = translateSettings.OptimizeOutput;

            GlobalScope  = Scope.GetGlobalScope();
            RulesetScope = GlobalScope.Child();
            RulesetScope.PrivateCatch = true;

            Types.GetDefaults(this);
            Importer = new Importer(this, FileGetter, translateSettings.Root.Uri);
            Importer.CollectScriptFiles(translateSettings.Root);

            Translate();
            if (!Diagnostics.ContainsErrors())
            {
                ToWorkshop(translateSettings.AdditionalRules);
            }

            foreach (IComponent component in Components)
            {
                if (component is IDisposable disposable)
                {
                    disposable.Dispose();
                }
            }
        }
        public DeltinScript(TranslateSettings translateSettings)
        {
            FileGetter     = translateSettings.FileGetter;
            Diagnostics    = translateSettings.Diagnostics;
            Language       = translateSettings.OutputLanguage;
            OptimizeOutput = translateSettings.OptimizeOutput;

            types.AddRange(CodeType.DefaultTypes);
            Importer = new Importer(translateSettings.Root.Uri);

            CollectScriptFiles(translateSettings.Root);

            GlobalScope  = Scope.GetGlobalScope();
            RulesetScope = GlobalScope.Child();
            RulesetScope.PrivateCatch = true;

            Translate();
            if (!Diagnostics.ContainsErrors())
            {
                ToWorkshop(translateSettings.AdditionalRules);
            }
        }
        public DeltinScript(TranslateSettings translateSettings)
        {
            FileGetter     = translateSettings.FileGetter;
            Diagnostics    = translateSettings.Diagnostics;
            Language       = translateSettings.OutputLanguage;
            OptimizeOutput = translateSettings.OptimizeOutput;

            Types = new ScriptTypes(this);
            Types.GetDefaults();

            GlobalScope  = new Scope("global scope");
            RulesetScope = GlobalScope.Child();
            RulesetScope.PrivateCatch = true;
            Types.AddTypesToScope(GlobalScope);

            Importer = new Importer(this, FileGetter, translateSettings.Root.Uri);
            Importer.CollectScriptFiles(this, translateSettings.Root);

            Translate();
            if (!Diagnostics.ContainsErrors())
            {
                try
                {
                    ToWorkshop(translateSettings.AdditionalRules);
                }
                catch (Exception ex)
                {
                    WorkshopCode = "An exception was thrown while translating to workshop.\r\n" + ex.ToString();
                }
            }

            foreach (IComponent component in Components)
            {
                if (component is IDisposable disposable)
                {
                    disposable.Dispose();
                }
            }
        }