Skip to content

Commit

Permalink
Update CLI program with new API
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Sep 15, 2024
1 parent b42ead3 commit 46f7d57
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Brainf_ckSharp.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,15 +52,15 @@
: new CancellationTokenSource(TimeSpan.FromSeconds(options.Timeout));

// Execute the code
Option<InterpreterResult> interpreterResult = Brainf_ckInterpreter
.CreateReleaseConfiguration()
.WithSource(source)
.WithStdin(stdin)
.WithMemorySize(options.MemorySize)
.WithDataType(options.DataType)
.WithExecutionOptions(options.ExecutionOptions)
.WithExecutionToken(cts.Token)
.TryRun();
Option<InterpreterResult> 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 { })
Expand Down

0 comments on commit 46f7d57

Please sign in to comment.