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:
+3
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user