From 46f7d5783666f4e8fe90ca2b61850a858c9e495b Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 15 Sep 2024 12:13:19 +0200 Subject: [PATCH] Update CLI program with new API --- src/Brainf_ckSharp.Cli/Program.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Brainf_ckSharp.Cli/Program.cs b/src/Brainf_ckSharp.Cli/Program.cs index 6feba7c6..80c4b615 100644 --- a/src/Brainf_ckSharp.Cli/Program.cs +++ b/src/Brainf_ckSharp.Cli/Program.cs @@ -4,6 +4,7 @@ using Brainf_ckSharp.Cli; using Brainf_ckSharp; using Brainf_ckSharp.Cli.Helpers; +using Brainf_ckSharp.Configurations; using Brainf_ckSharp.Enums; using Brainf_ckSharp.Models; using Brainf_ckSharp.Models.Base; @@ -51,15 +52,15 @@ : new CancellationTokenSource(TimeSpan.FromSeconds(options.Timeout)); // Execute the code - Option interpreterResult = Brainf_ckInterpreter - .CreateReleaseConfiguration() - .WithSource(source) - .WithStdin(stdin) - .WithMemorySize(options.MemorySize) - .WithDataType(options.DataType) - .WithExecutionOptions(options.ExecutionOptions) - .WithExecutionToken(cts.Token) - .TryRun(); + Option interpreterResult = Brainf_ckInterpreter.TryRun(new ReleaseConfiguration + { + Source = source.AsMemory(), + Stdin = stdin.AsMemory(), + MemorySize = options.MemorySize, + DataType = options.DataType, + ExecutionOptions = options.ExecutionOptions, + ExecutionToken = cts.Token + }); // Display the execution result if (interpreterResult.Value is { })