1
0
Fork 0
forked from fun/fun

Bastic value type casting. (0.12.0)

This commit is contained in:
Johannes Findeisen 2025-09-29 03:26:35 +02:00
commit c56a130896
8 changed files with 161 additions and 115 deletions

View file

@ -73,6 +73,7 @@ typedef enum {
// conversions
OP_TO_NUMBER, // pops any; pushes int (parse strings)
OP_TO_STRING, // pops any; pushes string
OP_CAST, // pops typeName, value; pushes casted value (see vm/cast.c)
OP_TYPEOF, // pops any; pushes string name of type
OP_UCLAMP, // pops number; pushes number masked to N bits (operand = bits)
OP_SCLAMP, // pops number; pushes number clamped to signed N-bit range (operand = bits)