public PersistentHost(CompilationInput input) { if (!SourceContext.TryCreate(input, out _context)) { throw new ArgumentException("Failed to initialize context with given compiler arguments"); } }
public bool ApplyExtraInput(CompilationInput input) { if (CompilationInput == input) { return(true); } lock (_syncRoot) { CompilationInput.Packages = CompilationInput.Packages.Union(input.Packages, _directoryComparer).ToArray(); CompilationInput.ExtraSourceFiles = CompilationInput.ExtraSourceFiles.Union(input.ExtraSourceFiles, _fileComparer).ToArray(); return(LoadPackagesAndExtraSourceFiles()); } }
private SourceContext(CompilationInput compilationInput) : base(new GlobalScope(), compilationInput) { }
public static bool TryCreate(CompilationInput compilationInput, out SourceContext sourceContext) { sourceContext = new SourceContext(compilationInput); return(sourceContext.LoadPackagesAndExtraSourceFiles()); }
protected Context(GlobalScope globalScope, CompilationInput compilationInput) { GlobalScope = globalScope; CompilationInput = compilationInput; }
public CompilationContext(GlobalScope globalScope, CompilationInput compilationInput) : base(globalScope, compilationInput) { }
public (bool Success, float[] Result) Evaluate(CompilationInput input, string expression) =>
public bool Parse(CompilationInput input) => _context.ApplyExtraInput(input);