aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-07 14:44:45 +0900
committernsfisis <nsfisis@gmail.com>2024-07-07 14:44:45 +0900
commite79241c1988e7c0b3d422cdb99c9a105d0cfa903 (patch)
tree6d341707f561a13c36bc376c623b034c2d9b551a /src
parent378a315f15a26158885d4e1b14cb97cf04676ba9 (diff)
downloadphp-waddiwasi-e79241c1988e7c0b3d422cdb99c9a105d0cfa903.tar.gz
php-waddiwasi-e79241c1988e7c0b3d422cdb99c9a105d0cfa903.tar.zst
php-waddiwasi-e79241c1988e7c0b3d422cdb99c9a105d0cfa903.zip
refactor: add Store::registerFunc()
Diffstat (limited to 'src')
-rw-r--r--src/Execution/Store.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Execution/Store.php b/src/Execution/Store.php
index b7b0dfc..2b1a26d 100644
--- a/src/Execution/Store.php
+++ b/src/Execution/Store.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Nsfisis\Waddiwasi\Execution;
+use function count;
+
final class Store
{
/**
@@ -28,4 +30,10 @@ final class Store
{
return new self([], [], [], [], [], []);
}
+
+ public function registerFunc(FuncInst $func): ExternVals\Func
+ {
+ $this->funcs[] = $func;
+ return ExternVal::Func(count($this->funcs) - 1);
+ }
}