BadScript 2
Loading...
Searching...
No Matches
BadInteractiveConsoleApi.cs
Go to the documentation of this file.
6
8
13{
18
23 public BadInteractiveConsoleApi(BadInteractiveConsole console) : base("Interactive")
24 {
25 m_Console = console;
26 }
27
29 protected override void LoadApi(BadTable target)
30 {
31 target.SetFunction("Reset", m_Console.Reset);
32 target.SetFunction<string>("Run", m_Console.Run);
33 target.SetFunction<string>("Load", m_Console.Load);
34 target.SetFunction<string>("RunIsolated", m_Console.RunIsolated, BadAnyPrototype.Instance);
35 target.SetFunction<string>("LoadIsolated", m_Console.LoadIsolated, BadAnyPrototype.Instance);
36 target.SetFunction("GetScope", GetScope, BadScope.Prototype);
37 target.SetFunction<bool>("SetCatchError", SetCatchError);
38 target.SetFunction<bool>("SetPreParse", SetPreParse);
39 }
40
45 private void SetCatchError(bool enable)
46 {
47 m_Console.CatchErrors = enable;
48 }
49
54 private void SetPreParse(bool enable)
55 {
56 m_Console.PreParse = enable;
57 }
58
64 {
65 return m_Console.CurrentScope ?? BadObject.Null;
66 }
67}
readonly BadInteractiveConsole m_Console
The Console Instance.
void SetPreParse(bool enable)
Sets the Pre Parse Flag.
void SetCatchError(bool enable)
Sets the Catch Error Flag.
BadInteractiveConsoleApi(BadInteractiveConsole console)
Constructs a new BadInteractiveConsoleApi instance.
Implements an Interactive Console for the BadScript Language.
void Load(string file)
Loads a File into the Interactive Session.
BadObject RunIsolated(string code)
Runs a set of Expressions isolated from the Interactive Session.
void Run(IEnumerable< BadExpression > expressions)
Runs a set of Expressions.
BadObject LoadIsolated(string file)
Loads a File isolated from the Interactive Session.
Implements the Scope for the Script Engine.
Definition BadScope.cs:238
static BadClassPrototype Prototype
A Class Prototype for the Scope.
Definition BadScope.cs:420
Implements an Interop API for the BS2 Language.
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28
Implements a Table Structure for the BadScript Language.
Definition BadTable.cs:14
The Any Prototype, Base type for all types.
static readonly BadAnyPrototype Instance
The Instance of the BadAnyPrototype.
Contains the interactive console Implementation.
Contains the Extension Classes for Functions.
Contains the Interop Abstractions and Implementations for the BadScript2 Language.
Contains the Runtime Objects.
Definition BadArray.cs:10
Contains the Runtime Implementation.