aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WebAssembly/Structure/Instructions/Instrs/Control/If_.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/WebAssembly/Structure/Instructions/Instrs/Control/If_.php')
-rw-r--r--src/WebAssembly/Structure/Instructions/Instrs/Control/If_.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/WebAssembly/Structure/Instructions/Instrs/Control/If_.php b/src/WebAssembly/Structure/Instructions/Instrs/Control/If_.php
new file mode 100644
index 0000000..8afdc8b
--- /dev/null
+++ b/src/WebAssembly/Structure/Instructions/Instrs/Control/If_.php
@@ -0,0 +1,26 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instr;
+
+final readonly class If_ extends Instr
+{
+ /**
+ * @param list<Instr> $thenBody
+ * @param list<Instr> $elseBody
+ */
+ protected function __construct(
+ public BlockType $type,
+ public array $thenBody,
+ public array $elseBody,
+ ) {
+ }
+
+ public static function opName(): string
+ {
+ return "if";
+ }
+}