aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Structure/Instructions/Instrs/Control/If_.php
blob: f7583959f3f4bf7f5779df6438dcade323b12748 (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
<?php

declare(strict_types=1);

namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;

use Nsfisis\Waddiwasi\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";
    }
}