Upsilon/Upsilon/ScriptOptions.cs

28 lines
1.2 KiB
C#

using System;
using Upsilon.Binder;
using Upsilon.Evaluator;
namespace Upsilon
{
public class ScriptOptions
{
/// <summary>
/// Whether to persist comments on functions and variables as data or not. This is generally helpful for tools
/// or IDEs, but not for actual runtime.
/// </summary>
public bool SaveDataComments { get; set; } = false;
/// <summary>
/// Whether or not to throw an exception when errors are encountered. Throwing exceptions is useful for general
/// execution, as it will quickly tell you something is wrong, however this will only show the first error in a
/// script, which may not be helpful. IDEs and other tools should use false for this to show all errors in a script.
/// </summary>
public bool ThrowExceptionOnError { get; set; } = true;
public BoundScope OverrideStaticBoundScope { get; set; } = null;
public EvaluationScope OverrideStaticScope { get; set; } = null;
public ScriptLoader ScriptLoader { get; set; } = new ScriptLoader();
public ModuleHandler ModuleHandler { get; set; } = new ModuleHandler();
public Action<string> PrintResult { get; set; } = Console.WriteLine;
}
}