private void InitializeContext() { Alchemist.Log($"Alchemist starting in directory \"{_currentWorkingDirectory}\""); var workingDirectoryFiles = new DirectoryInfo(_currentWorkingDirectory).GetFiles("*.ele"); var packageFiles = Packages.SelectMany(GetPackageFiles); _sourceContext.AddSourceFiles(workingDirectoryFiles.Concat(packageFiles)); _sourceContext.Recompile(_compilationContext); }
protected override int ExecuteImplementation() { var function = _sourceContext.GlobalScope.GetFunction(Function, _compilationContext); if (function == null) { Alchemist.LogError($"Could not find function \"{Function}\"."); return(1); } var output = function.EvaluateAndSerialize(Arguments.ToArray(), _compilationContext); var asString = string.Join(", ", output).Replace("∞", "Infinity"); Alchemist.Log(asString); return(0); }