From e79241c1988e7c0b3d422cdb99c9a105d0cfa903 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 7 Jul 2024 14:44:45 +0900 Subject: refactor: add Store::registerFunc() --- src/Execution/Store.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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); + } } -- cgit v1.2.3-70-g09d2