RuntimeScope

loreline.RuntimeScope (Class)

Represents a scope in the execution stack of a Loreline script. Every time we enter a new block node, we enter a new scope identified with a unique integer value. When exiting that scope, the related temporary states associated with it are destroyed.

Instance Members

id: Int

The scope id, a unique integer value in the stack.


The parent beat where this scope is located. Can be either a top level beat or a nested beat.


node: AstNode

The node where this scope is attached.


The nested beat declarations, if any, found in this scope.


The temporary state associated with this scope, if any.


If applicable, the node this scope's "reading head" is at. This is used to track the current execution position within the scope.


If this scope was created from an insertion, this is the insertion runtime data.


beatByName(name: String): Null<NBeatDecl>

Finds a nested beat declaration with the given name in this scope, if any.

Name Type Description
name String The name of the beat to find
Returns Description
Null<NBeatDecl> The beat declaration if found, null otherwise

new(?id: Null<Int>, beat: NBeatDecl, node: AstNode, ?beats: Null<Array<NBeatDecl>>, ?state: Null<RuntimeState>, ?head: Null<AstNode>, ?insertion: Null<RuntimeInsertion>): Void
Name Type Default Description
id Null<Int> (optional) * The scope id, a unique integer value in the stack.
beat NBeatDecl * The parent beat where this scope is located. Can be either a top level beat or a nested beat.
node AstNode * The node where this scope is attached.
beats Null<Array<NBeatDecl>> (optional) * The nested beat declarations, if any, found in this scope.
state Null<RuntimeState> (optional) * The temporary state associated with this scope, if any.
head Null<AstNode> (optional) * If applicable, the node this scope's "reading head" is at. This is used to track the current execution position within the scope.
insertion Null<RuntimeInsertion> (optional) * If this scope was created from an insertion, this is the insertion runtime data.

Metadata

Name Parameters
:structInit -