Added a LineEnd token type.

This commit is contained in:
2022-08-25 18:37:25 +00:00
parent 89ab951c6a
commit 64326937b1
3 changed files with 16 additions and 7 deletions
+13 -7
View File
@@ -20,15 +20,21 @@ int main(int argc, char* args[]) {
List* list = GenerateTokenList(source_code);
// for(int i = 0; i < list->size; i++) {
// Token* t = (Token*) list->content[i];
for(int i = 0; i < list->size; i++) {
Token* t = (Token*) list->content[i];
// printf("[%i] '%s' [%i]", t->type, t->lexeme, t->token_class);
// if (t->type == LABEL) printf("*");
// printf("\n");
// }
if (t->type == LineEnd) {
if (i - 1 >= 0 && ((Token*) list->content[i - 1])->type != LineEnd)
printf("\n");
continue;
}
ParseTokens(list);
printf("[%i] '%s' [%i] ", t->type, t->lexeme, t->token_class);
if (t->type == LABEL) printf("* ");
}
//ParseTokens(list);
free(source_code);
}