mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Added scopes using '{}' symbols, read more
I've also added a new literal type called 'identifier'. This will be used for variable names, and has a type mask embedded in it.
This commit is contained in:
@@ -194,23 +194,8 @@ void debug() {
|
||||
|
||||
initLiteralDictionary(&dictionary);
|
||||
|
||||
for (int i = 0; i < 100; i++) {
|
||||
setLiteralDictionary(&dictionary, TO_INTEGER_LITERAL(i), TO_INTEGER_LITERAL(i * 2));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 100; i++) {
|
||||
printf("%d: ", i);
|
||||
printLiteral( getLiteralDictionary(&dictionary, TO_INTEGER_LITERAL(i)) );
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
printf("-------------");
|
||||
|
||||
for (int i = 0; i < dictionary.capacity; i++) {
|
||||
printf("%d: ", i);
|
||||
printLiteral(dictionary.entries[i].key);
|
||||
printf("\n");
|
||||
}
|
||||
setLiteralDictionary(&dictionary, TO_IDENTIFIER_LITERAL("variable", MASK_INTEGER), TO_INTEGER_LITERAL(2));
|
||||
printLiteral( getLiteralDictionary(&dictionary, TO_IDENTIFIER_LITERAL("variable", MASK_INTEGER)) );
|
||||
|
||||
freeLiteralDictionary(&dictionary);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user