Added Peek() and Match() as well as a bugged '!=' detection.

This commit is contained in:
2022-02-14 17:06:30 +00:00
parent 7bdbb9f53a
commit db54e8f888
2 changed files with 50 additions and 6 deletions
+5
View File
@@ -24,6 +24,11 @@ void Print(TokenList* list) {
char lexeme[100];
for(int i = 0; i < list->size; i++) {
if (list->tokens[i]->type == EndOF) {
printf("EOF\n");\
return;
}
printf("[Line %d] ", list->tokens[i]->line);
for(int j = 0; j < list->tokens[i]->length; j++) {
printf("%c", list->tokens[i]->lexeme[j]);