diff --git a/frontend/cmd/compile.c b/frontend/cmd/compile.c index 85e10c6..fcdf5fe 100644 --- a/frontend/cmd/compile.c +++ b/frontend/cmd/compile.c @@ -44,7 +44,24 @@ static int compile_file(const char *path) break; } - printf("read token!\n"); + printf("%s", ivy_lex_token_type_to_string(tok->t_type)); + + switch (tok->t_type) { + case IVY_TOK_IDENT: + case IVY_TOK_LABEL: + printf("(%s)", tok->t_str); + break; + case IVY_TOK_SYMBOL: + printf("(%s)", ivy_symbol_to_string(tok->t_symbol)); + break; + case IVY_TOK_KEYWORD: + printf("(%s)", ivy_keyword_to_string(tok->t_keyword)); + break; + default: + break; + } + + printf("\n"); } int r = (lex.lex_status == IVY_OK || lex.lex_status == IVY_ERR_EOF) ? 0