102 value = value.Dereference();
105 if (context.Scope.FunctionObject !=
null &&
108 if (!context.Scope.FunctionObject.IsSingleLine)
116 context.Scope.SetReturnValue(value);
124 return "return " + (
Right?.ToString() ??
"");
Describes a specific position inside a source file.
Implements a simple constant folding optimization.
static BadExpression Optimize(BadExpression expr)
Optimizes the given expression.
Base Implementation for all Expressions used inside the Script.
IEnumerable< BadExpression > GetDescendantsAndSelf()
Returns all Descendants of the Expression and the Expression itself.
BadSourcePosition Position
The source Position of the Expression.
IEnumerable< BadObject > Execute(BadExecutionContext context)
Evaluates the Expression within the current Execution Context.
Implements the Return expression that is used to exit the current function with an Optional Return Va...
override void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
BadReturnExpression(BadExpression? right, BadSourcePosition position, bool isRefReturn)
Constructor of the Return Expression.
override IEnumerable< BadExpression > GetDescendants()
BadExpression? Right
The (optional) return value.
override string ToString()
bool IsRefReturn
Indicates if the return value is meant to be a reference.
void SetRight(BadExpression? expr)
Sets the return value.
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
void SetReturnValue(BadObject? value)
Sets the Return value of this scope.
BadFunction? FunctionObject
The Function Object of the Scope.
Gets thrown by the runtime.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
The Base Class for all BadScript Objects.
static readonly BadObject Null
The Null Value for the BadScript Language.
The Void Prototype, can be assigned to nothing, can not be inherited from, can not be instantiated....
static BadVoidPrototype Instance
The Instance of the BadVoidPrototype.
Contains Shared Data Structures and Functionality.
Contains the BadScript2 Constant Folding Optimizations.
Contains the Controlflow Expressions for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains Runtime Type Objects.
Contains the Runtime Objects.
Contains the Runtime Implementation.