Got literal types represented correctly

This commit is contained in:
2022-08-12 11:10:52 +01:00
parent 2f18989f25
commit 998b913fc9
3 changed files with 126 additions and 42 deletions

View File

@@ -109,13 +109,13 @@ void freeLiteral(Literal literal);
#define STRLEN(lit) ((lit).as.string.length)
#define STRLEN_I(lit) ((lit).as.identifier.length)
#define HASH_I(lit) ((lit).as.identifier.hash)
#define TYPE_PUSH_SUBTYPE(lit, submask) _typePushSubtype(&(lit), submask)
#define TYPE_PUSH_SUBTYPE(lit, submask) _typePushSubtype(lit, submask)
//BUGFIX: macros are not functions
bool _isTruthy(Literal x);
Literal _toStringLiteral(char* str);
Literal _toIdentifierLiteral(char* str);
void _typePushSubtype(Literal* lit, unsigned char submask);
Literal* _typePushSubtype(Literal* lit, unsigned char submask);
//utils
char* copyString(char* original, int length);