Code cleanup. Converting a number lexeme to a proper integer setup but not done yet. So number tokens don't have a valid value.

This commit is contained in:
2022-05-05 16:12:33 +00:00
parent 9fa48520c7
commit 8ec0b9b216
11 changed files with 59 additions and 283 deletions
+3 -2
View File
@@ -3,7 +3,6 @@
#include <string.h>
#include <sysexits.h>
#include "../includes/list.h"
#include "../includes/lexer.h"
#include "../includes/parser.h"
#include "../includes/futil.h"
#include "../includes/scanner.h"
@@ -26,7 +25,9 @@ int main(int argc, char* args[]) {
for(int i = 0; i < list->size; i++) {
Token* t = (Token*) list->content[i];
printf("[%i] '%s'\n", t->type, t->value);
printf("[%i] '%s'", t->type, t->lexeme);
if (t->type == NUMBER || t->type == HEX) printf(" NUM: %ld", (long) t->value);
printf("\n");
}
free(source_code);