1
0
Fork 0
forked from fun/fun

Added tons of AI generated docs and a lot of cleanups. No code changes. (0.41.5)

This commit is contained in:
Johannes Findeisen 2026-05-01 02:20:25 +02:00
commit 4e69a3ce63
151 changed files with 3897 additions and 427 deletions

View file

@ -7,6 +7,20 @@
* https://opensource.org/license/apache-2-0
*/
/**
* @file typeof.c
* @brief Implements the OP_TYPEOF opcode for obtaining a human-readable type name.
*
* This snippet is included by the VM's opcode dispatch. It pops a single value
* from the stack, determines its runtime type, pushes a new string with a
* human-readable type name (e.g., "Number", "String", "Array"), and frees the
* original value.
*
* Stack contract:
* - Pops: value (any)
* - Pushes: string (type name)
*/
case OP_TYPEOF: {
Value v = pop_value(vm);
const char *tname = "Unknown";