aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-11 04:20:25 +0900
committernsfisis <nsfisis@gmail.com>2024-07-11 04:20:25 +0900
commit5be97eadbb1065f842aad4341cd4732498e0553b (patch)
tree827560953ea0abf494b3bb7aae9a987d105a8da3 /examples
parent8a083ed74e9f4472441175e187208012927ed357 (diff)
downloadphp-waddiwasi-5be97eadbb1065f842aad4341cd4732498e0553b.tar.gz
php-waddiwasi-5be97eadbb1065f842aad4341cd4732498e0553b.tar.zst
php-waddiwasi-5be97eadbb1065f842aad4341cd4732498e0553b.zip
feat: simplify FuncType structure
Diffstat (limited to 'examples')
-rw-r--r--examples/php-on-wasm/php-wasm.php3
-rw-r--r--examples/rubyvm-on-php-on-wasm/php-wasm.php3
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/php-on-wasm/php-wasm.php b/examples/php-on-wasm/php-wasm.php
index cdec328..fe1d327 100644
--- a/examples/php-on-wasm/php-wasm.php
+++ b/examples/php-on-wasm/php-wasm.php
@@ -13,7 +13,6 @@ use Nsfisis\Waddiwasi\WebAssembly\Execution\Refs;
use Nsfisis\Waddiwasi\WebAssembly\Execution\Runtime;
use Nsfisis\Waddiwasi\WebAssembly\Execution\Store;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\FuncType;
-use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ResultType;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ValType;
const PHP_HELLO_WORLD = <<<'EOS'
@@ -186,7 +185,7 @@ function makeHostFunc(string $typeDef, callable $fn): Externs\Func
$resultsDef = $matches[2];
$params = array_map($stringToType, $paramsDef === '' ? [] : explode(', ', $paramsDef));
$results = array_map($stringToType, $resultsDef === '' ? [] : explode(', ', $resultsDef));
- $type = new FuncType(new ResultType($params), new ResultType($results));
+ $type = new FuncType($params, $results);
return Extern::Func(FuncInst::Host($type, $fn));
}
diff --git a/examples/rubyvm-on-php-on-wasm/php-wasm.php b/examples/rubyvm-on-php-on-wasm/php-wasm.php
index b9f9cfa..726f6d1 100644
--- a/examples/rubyvm-on-php-on-wasm/php-wasm.php
+++ b/examples/rubyvm-on-php-on-wasm/php-wasm.php
@@ -13,7 +13,6 @@ use Nsfisis\Waddiwasi\WebAssembly\Execution\Refs;
use Nsfisis\Waddiwasi\WebAssembly\Execution\Runtime;
use Nsfisis\Waddiwasi\WebAssembly\Execution\Store;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\FuncType;
-use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ResultType;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ValType;
const PHP_HELLO_WORLD = <<<'EOS'
@@ -186,7 +185,7 @@ function makeHostFunc(string $typeDef, callable $fn): Externs\Func
$resultsDef = $matches[2];
$params = array_map($stringToType, $paramsDef === '' ? [] : explode(', ', $paramsDef));
$results = array_map($stringToType, $resultsDef === '' ? [] : explode(', ', $resultsDef));
- $type = new FuncType(new ResultType($params), new ResultType($results));
+ $type = new FuncType($params, $results);
return Extern::Func(FuncInst::Host($type, $fn));
}