48 table.PropertyInfos[key].IsReadOnly = true;
53 BadAnyPrototype.Instance
108 enumerator = enumerator.Dereference();
126 context.Scope.CreateChild(
146 result.SetProperty(key.Value, table.GetProperty(key.Value, context.Scope).Dereference());
156 "Enumerator MoveNext did not return a boolean",
180 BadObject[] others = args.Skip(1).ToArray();
194 foreach (KeyValuePair<string, BadObject> kvp
in other.InnerTable)
196 if (ov.Value || !
self.InnerTable.ContainsKey(kvp.Key))
198 self.GetProperty(kvp.Key, ctx.Scope).Set(kvp.Value);
Describes a specific position inside a source file.
static BadSourcePosition FromSource(string source, int index, int length)
Creates a new Source Position.
Contains Static Data for the BadScript Language.
const string ARRAY_ACCESS_OPERATOR_NAME
Implements Table Extensions.
static BadObject Values(BadTable table)
Returns the Values of the Table.
static BadObject JoinTable(BadExecutionContext ctx, BadTable self, IReadOnlyList< BadObject > args)
Joins two or more tables together.
static BadObject ArrayAccess(BadExecutionContext context, BadTable table, BadObject enumerator)
static BadObject Keys(BadTable table)
Returns the Keys of the Table.
override void AddExtensions(BadInteropExtensionProvider provider)
static BadObject RemoveKey(BadTable table, string key)
Removes a key from the table.
Implements the For Each Expression.
static BadFunction BadFunction getCurrent FindEnumerator(BadObject target, BadExecutionContext context, BadSourcePosition position)
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
Gets thrown by the runtime.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
Public Extension API for the BS2 Runtime.
void RegisterObject(Type t, string propName, BadObject obj)
Registers the specified extension for the specified type.
Non Generic Interop Function.
Interop Function taking an array of arguments.
Implements a Dynamic List/Array for the BadScript Language.
The Base Class for all BadScript Objects.
virtual BadObjectReference GetProperty(string propName, BadScope? caller=null)
Returns a Reference to the Property with the given Name.
virtual bool HasProperty(string propName, BadScope? caller=null)
Returns true if the object contains a given property or there exists an extension for the current Ins...
static readonly BadObject Null
The Null Value for the BadScript Language.
Implements a Table Structure for the BadScript Language.
BadObjectReference GetProperty(string propName, bool useExtensions, BadScope? caller=null)
Returns a Reference to the Property with the given Name.
Dictionary< string, BadObject > InnerTable
The Inner Table for this Object.
bool RemoveKey(string key)
Removes a Property from the Table.
Implements a function that can be called from the script.
Provides function parameter info.
The Any Prototype, Base type for all types.
static readonly BadAnyPrototype Instance
The Instance of the BadAnyPrototype.
Helper Class that Builds a Native Class from a Prototype.
static BadClassPrototype GetNative(string name)
Returns a Native Class Prototype for the given Native Type.
Implements the Interface for Native Boolean.
new bool Value
The Boolean Value.
Implements the Interface for Native Strings.
Contains Shared Data Structures and Functionality.
Contains Common Interop Extensions for the BadScript2 Runtime.
Contains the Loop Expressions for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains the Interop Function Classes for the BadScript2 Language.
Contains the Interop Abstractions and Implementations for the BadScript2 Language.
Contains Runtime Function Objects.
Contains the Native Runtime Objects.
Contains Runtime Type Objects.
Contains the Runtime Objects.
Contains the Runtime Implementation.
BadScopeFlags
Defines Different Behaviours for the Current Scope.