blob: 02e11135af69782045041a7fb9e69c1e8c1aabd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<?php
declare(strict_types=1);
namespace Nsfisis\Waddiwasi\WebAssembly\Structure\Types;
enum ValType
{
case I32;
case I64;
case F32;
case F64;
case V128;
case FuncRef;
case ExternRef;
public function isNum(): bool
{
return match ($this) {
ValType::I32 , ValType::I64 , ValType::F32 , ValType::F64 => true,
default => false,
};
}
public function isVec(): bool
{
return match ($this) {
ValType::V128 => true,
default => false,
};
}
public function isRef(): bool
{
return match ($this) {
ValType::FuncRef , ValType::ExternRef => true,
default => false,
};
}
}
|