]> git.lizzy.rs Git - nothing.git/blobdiff - src/ebisp/expr.h
(#458) Fix trailing spaces problem
[nothing.git] / src / ebisp / expr.h
index 25e03a5fc1d6f14b74d83ab1125b9969e2045072..b6b4fa7364d21cd72dce99e722c4ad9f3b697ad0 100644 (file)
@@ -37,6 +37,16 @@ struct Expr
     };
 };
 
+inline const char *expr_type_as_string(enum ExprType expr_type) {
+    switch (expr_type) {
+    case EXPR_ATOM: return "EXPR_ATOM";
+    case EXPR_CONS: return "EXPR_CONS";
+    case EXPR_VOID: return "EXPR_VOID";
+    }
+
+    return "";
+}
+
 struct Expr atom_as_expr(struct Atom *atom);
 struct Expr cons_as_expr(struct Cons *cons);
 struct Expr void_expr(void);
@@ -69,6 +79,18 @@ enum AtomType
     ATOM_NATIVE
 };
 
+inline const char *atom_type_as_string(enum AtomType atom_type)
+{
+    switch (atom_type) {
+    case ATOM_SYMBOL: return "ATOM_SYMBOL";
+    case ATOM_NUMBER: return "ATOM_NUMBER";
+    case ATOM_STRING: return "ATOM_STRING";
+    case ATOM_NATIVE: return "ATOM_NATIVE";
+    }
+
+    return "";
+}
+
 struct Atom
 {
     enum AtomType type;