RuntimeScope
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: IntThe scope id, a unique integer value in the stack.
beat: NBeatDeclThe parent beat where this scope is located. Can be either a top level beat or a nested beat.
node: AstNodeThe node where this scope is attached.
The nested beat declarations, if any, found in this scope.
state: RuntimeStateThe temporary state associated with this scope, if any.
head: AstNodeIf applicable, the node this scope's "reading head" is at. This is used to track the current execution position within the scope.
insertion: RuntimeInsertionIf this scope was created from an insertion, this is the insertion runtime data.
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 | Description |
|---|---|---|
id |
Null<Int> | * 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>> | * The nested beat declarations, if any, found in this scope. |
state |
Null<RuntimeState> | * The temporary state associated with this scope, if any. |
head |
Null<AstNode> | * 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> | * If this scope was created from an insertion, this is the insertion runtime data. |
Metadata
| Name | Parameters |
|---|---|
:hxGen |
- |
:structInit |
- |