mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Types are first-class citizens
This commit is contained in:
@@ -206,6 +206,10 @@ void printLiteralCustom(Literal literal, void (printFn)(const char*)) {
|
||||
printToBuffer("<");
|
||||
|
||||
switch(AS_TYPE(literal).typeOf) {
|
||||
case LITERAL_NULL:
|
||||
printToBuffer("null");
|
||||
break;
|
||||
|
||||
case LITERAL_BOOLEAN:
|
||||
printToBuffer("bool");
|
||||
break;
|
||||
@@ -261,7 +265,7 @@ void printLiteralCustom(Literal literal, void (printFn)(const char*)) {
|
||||
|
||||
default:
|
||||
//should never be seen
|
||||
fprintf(stderr, "[Internal] Unrecognized literal type in print type: %d\n", literal.type);
|
||||
fprintf(stderr, "[Internal] Unrecognized literal type in print type: %d\n", AS_TYPE(literal).typeOf);
|
||||
}
|
||||
|
||||
//const (printed last)
|
||||
|
||||
Reference in New Issue
Block a user