aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index a054b16..4a6a370 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,7 +5,6 @@
#include "include/token.h"
#include "include/lexer.h"
-
int main(int argc, char* argv[]) {
FILE* fsource;
long fsource_size;
@@ -13,6 +12,7 @@ int main(int argc, char* argv[]) {
lexer_t* lexer;
int in_file;
+
fsource = fopen(argv[1], "rb");
if (!fsource) { free(fsource); die("source file not found"); };
fseek(fsource, 0L, SEEK_END);
@@ -34,9 +34,12 @@ int main(int argc, char* argv[]) {
while (in_file) {
token_t* token;
+ char* type;
token = lexer_get_next_token(lexer);
- log_inf("token type: [%02d]\t\ttoken value: [%s]", token->type, token->value);
+ type = token_get_type(token->type);
+
+ log_inf("token type: [%s]\t\ttoken value: [%s]", type, token->value);
(token->type == TOKEN_EOF) && (in_file = 0);
token_destroy(token);