Added Peek() and Match() as well as a bugged '!=' detection.
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user