aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Execution/Num.php
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-01-27 13:22:56 +0900
committernsfisis <nsfisis@gmail.com>2024-02-26 11:07:06 +0900
commit900377463a8264871ee42e488112b076b7973b6a (patch)
treebf727d3484ca7c8d35f18ef29ea8d9305d4b57da /src/Execution/Num.php
parente2495878b872b341e6e04eed31dd255b1a6e256f (diff)
downloadphp-waddiwasi-900377463a8264871ee42e488112b076b7973b6a.tar.gz
php-waddiwasi-900377463a8264871ee42e488112b076b7973b6a.tar.zst
php-waddiwasi-900377463a8264871ee42e488112b076b7973b6a.zip
feat: partially implement execution
Diffstat (limited to 'src/Execution/Num.php')
-rw-r--r--src/Execution/Num.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Execution/Num.php b/src/Execution/Num.php
new file mode 100644
index 0000000..03fec4f
--- /dev/null
+++ b/src/Execution/Num.php
@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Execution;
+
+abstract readonly class Num
+{
+ /**
+ * @param S32 $value
+ */
+ final public static function I32(int $value): Nums\I32
+ {
+ return new Nums\I32($value);
+ }
+
+ /**
+ * @param S64 $value
+ */
+ final public static function I64(int $value): Nums\I64
+ {
+ return new Nums\I64($value);
+ }
+
+ /**
+ * @param F32 $value
+ */
+ final public static function F32(float $value): Nums\F32_
+ {
+ return new Nums\F32_($value);
+ }
+
+ /**
+ * @param F64 $value
+ */
+ final public static function F64(float $value): Nums\F64_
+ {
+ return new Nums\F64_($value);
+ }
+}