34 public string?
Name {
get; }
45 if (
string.IsNullOrEmpty(
Name))
58 result = result.Dereference();
60 context.Scope.AddExport(
Name!, result);
74 return $
"export {Expression}";
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.
Exports a Named Value from the current execution.
BadExpression Expression
The Expression to export.
override string ToString()
BadNamedExportExpression(string? name, BadExpression expression, BadSourcePosition position)
Creates a new Named Export Expression.
override void Optimize()
Uses the Constant Folding Optimizer to optimize the expression.
string? Name
The Name of the Export.
override IEnumerable< BadExpression > GetDescendants()
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
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.
The Base Class for all BadScript Objects.
static readonly BadObject Null
The Null Value for the BadScript Language.
Contains Shared Data Structures and Functionality.
Contains the BadScript2 Constant Folding Optimizations.
Contains the Error Objects for the BadScript2 Language.
Contains the Runtime Objects.
Contains the Runtime Implementation.