summaryrefslogtreecommitdiff
path: root/src/honeysuckle/hs_type_to_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/honeysuckle/hs_type_to_string.c')
-rw-r--r--src/honeysuckle/hs_type_to_string.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/honeysuckle/hs_type_to_string.c b/src/honeysuckle/hs_type_to_string.c
new file mode 100644
index 0000000..d0a580c
--- /dev/null
+++ b/src/honeysuckle/hs_type_to_string.c
@@ -0,0 +1,31 @@
+#include "honeysuckle.h"
+
+const char * hs_type_to_string(hs_type type)
+{
+ switch(type) {
+ case HS_BOOL:
+ return "boolean";
+ case HS_INT:
+ return "integer";
+ case HS_NUM:
+ return "number";
+ case HS_STR:
+ return "string";
+ case HS_TBL:
+ return "table";
+ case HS_FUNC:
+ return "function";
+ case HS_CFUNC:
+ return "C function";
+ case HS_USER:
+ return "userdata";
+ case HS_LIGHT:
+ return "light userdata";
+ case HS_NIL:
+ return "nil";
+ case HS_ANY:
+ return "any";
+ default:
+ return "(unknown)";
+ }
+}