20 private readonly List<BadExpression>
m_Body;
53 List<BadExpression> expressions,
60 bool isSingleLine) : base(name, isConstant, isStatic, returnType, isSingleLine, parameters)
107 ctx.Scope.FunctionObject =
this;
123 if (ctx.Scope.ReturnValue !=
null)
125 yield
return ctx.Scope.ReturnValue;
Describes a specific position inside a source file.
string GetPositionInfo()
Returns position info. Format: file://[FileName] : Line [Line].
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
Implements the Scope for the Script Engine.
BadScope CreateChild(string name, BadScope? caller, bool? useVisibility, BadScopeFlags flags=BadScopeFlags.RootScope)
Creates a subscope of the current scope.
The Base Class for all BadScript Objects.
override string ToString()
Returns a String Representation of this Object.
static readonly BadObject Null
The Null Value for the BadScript Language.
The Expression Function Implementation used if a function gets defined in the Source Code.
readonly BadSourcePosition Position
The Source Position of the Function.
BadExpressionFunction(BadScope parentScope, BadWordToken? name, List< BadExpression > expressions, BadFunctionParameter[] parameters, BadSourcePosition position, bool isConstant, bool isStatic, BadMetaData? metaData, BadClassPrototype returnType, bool isSingleLine)
Creates a new Expression Function.
readonly string m_FuncString
The Function String.
override BadMetaData MetaData
readonly List< BadExpression > m_Body
The Function Body.
override BadFunction BindParentScope(BadScope scope)
Returns an instance that is bound to the given scope.Function Instance
readonly BadScope ParentScope
The Scope the function is defined in.
override IEnumerable< BadObject > InvokeBlock(BadObject[] args, BadExecutionContext caller)
IEnumerable< BadExpression > Body
Enumeration of all expressions in the function body.
override string ToString()
Implements a function that can be called from the script.
BadFunctionParameter[] Parameters
The Function Parameters.
bool IsSingleLine
Indicates if the function is a single line function(without block) Is used to determine the behaviour...
BadWordToken? Name
(optional) Name of the Function
static void ApplyParameters(string funcStr, BadFunctionParameter[] parameters, BadExecutionContext context, BadObject[] args, BadSourcePosition? position=null)
Applies the function arguments to the context of the function.
bool IsConstant
Indicates if the function has no side effects and the result can be cached.
bool IsStatic
Indicates if the Function is static.
BadClassPrototype ReturnType
The Return Type of the Function.
Provides function parameter info.
Implements a Class Prototype for the BadScript Language.
Contains Shared Data Structures and Functionality.
Contains the Expressions for the BadScript2 Language.
Contains the Parser for the BadScript2 Language.
Contains the Reader Tokens for the BadScript2 Language.
Contains Runtime Function Objects.
Contains Runtime Type Objects.
BadScopeFlags
Defines Different Behaviours for the Current Scope.