BadScript 2
Loading...
Searching...
No Matches
BadTaskExtensions.cs
Go to the documentation of this file.
6
8
13{
15 protected override void AddExtensions(BadInteropExtensionProvider provider)
16 {
18 "AsTask",
19 func => new BadInteropFunction(
20 "AsTask",
21 (ctx, args) => AsTask(ctx, func, args),
22 func.IsStatic,
24 func.Parameters
25 )
26 );
27 }
28
36 private static BadObject AsTask(BadExecutionContext ctx, BadFunction func, BadObject[] args)
37 {
38 return BadTask.Create(func, ctx, func.Name?.Text, args);
39 }
40}
override void AddExtensions(BadInteropExtensionProvider provider)
static BadObject AsTask(BadExecutionContext ctx, BadFunction func, BadObject[] args)
Converts a Function into a task.
Implements a Task Object.
Definition BadTask.cs:17
static BadTask Create(BadFunction f, BadExecutionContext caller, string? name, params BadObject[] args)
Creates a new Task from a Function.
Definition BadTask.cs:290
static readonly BadClassPrototype Prototype
The BadTask Prototype.
Definition BadTask.cs:21
The Execution Context. Every execution of a script needs a context the script is running in....
Public Extension API for the BS2 Runtime.
void RegisterObject(Type t, string propName, BadObject obj)
Registers the specified extension for the specified type.
Interop Function taking an array of arguments.
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
Implements a function that can be called from the script.
BadFunctionParameter[] Parameters
The Function Parameters.
BadWordToken? Name
(optional) Name of the Function
bool IsStatic
Indicates if the Function is static.
Contains task/async Extensions and Integrations for the BadScript2 Runtime.
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 Runtime Objects.
Definition BadArray.cs:10
Contains the Runtime Implementation.