diff options
Diffstat (limited to 'boot/catboot.c')
| -rw-r--r-- | boot/catboot.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/boot/catboot.c b/boot/catboot.c index 56aaeb6..e47d4b9 100644 --- a/boot/catboot.c +++ b/boot/catboot.c @@ -21,6 +21,7 @@ #include <sys/stat.h> #include "common.c" +#include "lex.c" const ascii* read_file(const ascii* path) @@ -47,9 +48,18 @@ main(const int32 argc, const ascii* argv[]) return EXIT_FAILURE; } const ascii* file_path = argv[1]; - const ascii* source = read_file(file_path); - printf("%s", source); + const ascii* source_buffer = read_file(file_path); + struct String source = string_from_static_c_string(source_buffer); + + struct Lexer lexer; + lexer_new(&lexer, source); + + struct Token token; + do { + token = lexer_next(&lexer); + printf("%s ", token_kind_to_string(token.kind)); + } while (token.kind != TOKEN_END_OF_FILE); return EXIT_SUCCESS; } |
