diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/php-on-wasm/php-wasm.php | 9 | ||||
| -rw-r--r-- | examples/rubyvm-on-php-on-wasm/php-wasm.php | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/examples/php-on-wasm/php-wasm.php b/examples/php-on-wasm/php-wasm.php index f7aca1f..cdec328 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\NumType; use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ResultType; use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ValType; @@ -176,10 +175,10 @@ function copyStringToWasmMemory(Runtime $runtime, int $dst, string $src): void function makeHostFunc(string $typeDef, callable $fn): Externs\Func { $stringToType = fn (string $s) => match ($s) { - 'i32' => ValType::NumType(NumType::I32), - 'i64' => ValType::NumType(NumType::I64), - 'f32' => ValType::NumType(NumType::F32), - 'f64' => ValType::NumType(NumType::F64), + 'i32' => ValType::I32, + 'i64' => ValType::I64, + 'f32' => ValType::F32, + 'f64' => ValType::F64, default => throw new \RuntimeException('Invalid type: ' . $s), }; preg_match('/^\(([^)]*)\) -> \(([^)]*)\)$/', $typeDef, $matches); diff --git a/examples/rubyvm-on-php-on-wasm/php-wasm.php b/examples/rubyvm-on-php-on-wasm/php-wasm.php index 789e6ac..b9f9cfa 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\NumType; use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ResultType; use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ValType; @@ -176,10 +175,10 @@ function copyStringToWasmMemory(Runtime $runtime, int $dst, string $src): void function makeHostFunc(string $typeDef, callable $fn): Externs\Func { $stringToType = fn (string $s) => match ($s) { - 'i32' => ValType::NumType(NumType::I32), - 'i64' => ValType::NumType(NumType::I64), - 'f32' => ValType::NumType(NumType::F32), - 'f64' => ValType::NumType(NumType::F64), + 'i32' => ValType::I32, + 'i64' => ValType::I64, + 'f32' => ValType::F32, + 'f64' => ValType::F64, default => throw new \RuntimeException('Invalid type: ' . $s), }; preg_match('/^\(([^)]*)\) -> \(([^)]*)\)$/', $typeDef, $matches); |
