BadScript 2
Loading...
Searching...
No Matches
BadInteractiveExtensions.cs
Go to the documentation of this file.
3
5
9public static class BadInteractiveExtensions
10{
16 public static void RunInteractive(this BadRuntime runtime, IEnumerable<string> files)
17 {
19
20 while (true)
21 {
22 BadConsole.Write(">");
23 string cmd = BadConsole.ReadLine();
24
25 if (cmd == "exit")
26 {
27 return;
28 }
29
30 console.Run(cmd);
31 }
32 }
33
34 public static async Task RunInteractiveAsync(this BadRuntime runtime, IEnumerable<string> files)
35 {
37
38 while (true)
39 {
40 BadConsole.Write(">");
41 string cmd = await BadConsole.ReadLineAsync();
42
43 if (cmd == "exit")
44 {
45 return;
46 }
47
48 console.Run(cmd);
49 }
50 }
51}
Exposes the BadScript Runtime Functionality to Consumers.
Definition BadRuntime.cs:28
Wrapper class for the console abstraction.
Definition BadConsole.cs:12
static Task< string > ReadLineAsync()
Reads a line from the console asynchronously.
Definition BadConsole.cs:94
static string ReadLine()
Reads a line from the console.
Definition BadConsole.cs:85
static void Write(string str)
Writes a string to the console.
Definition BadConsole.cs:67
Implements an Interactive Console for the BadScript Language.
void Run(IEnumerable< BadExpression > expressions)
Runs a set of Expressions.
Interactive Console Extensions for the BadScript Runtime.
static async Task RunInteractiveAsync(this BadRuntime runtime, IEnumerable< string > files)
static void RunInteractive(this BadRuntime runtime, IEnumerable< string > files)
Runs the Interactive Console.
static readonly BadTaskRunner Instance
The Task Runner Instance.
Contains a Console Abstraction Layer to be able to Simulate Console Input/Output over the Network.
Definition BadConsole.cs:6
Contains the interactive console Implementation.
Contains task/async Extensions and Integrations for the BadScript2 Runtime.