aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authors-over-42023-06-21 17:17:11 -0400
committers-over-42023-06-21 17:17:11 -0400
commite7d1e397730c271ccb11ce547cd941d740f5a2fc (patch)
tree8b82021d1d958d350cebe98b57d6783a2c2b71ba /src/main.c
parent46f4397bf0718fbaf2cee5b4ffd56d4a36f2c4d8 (diff)
NO MORE OTHER BORKED SHIAT :D
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);