X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lexer%2Fprint_helper.c;h=40d05232bb7004cc6e43f5624627440be7ebf6bd;hb=15ad4b5ab7b62ce2e966730ccd1932877d658b66;hp=9f97a8fffe6f6acecd827d9382b5e8313ede6404;hpb=6c47be3237ab266b1cba4e3051afaaaa55e07e52;p=TP_AL_C.git diff --git a/lexer/print_helper.c b/lexer/print_helper.c index 9f97a8f..40d0523 100644 --- a/lexer/print_helper.c +++ b/lexer/print_helper.c @@ -1,7 +1,8 @@ -#include #include #include +#include +#include "print_helper.h" #include "global_vars.h" void pr_warning(const char* format, ...) { @@ -53,11 +54,20 @@ void wpr_error(const wchar_t *format, ...) { fflush(stderr); } -void wprint_token() { +void wprint_token(FILE* out_file) { + if (tokenType == MOT || tokenType == MOTCLE) { + fwprintf(out_file, L"%20s: %ls\n", tokenTypestr[tokenType], token[tokenFound].value); + } else { + fwprintf(out_file, L"%20s\n", tokenTypestr[tokenType]); + } + fflush(out_file); +} + +void wprint_ctoken(FILE* out_file) { if (tokenType == MOT || tokenType == MOTCLE) { - fwprintf(target, L"%20s: %ls\n", tokenTypestr[tokenType], token[tokenFound].value); + fwprintf(out_file, L"%20s: %ls\n", tokenTypestr[tokenType], tokenValue); } else { - fwprintf(target, L"%20s\n", tokenTypestr[tokenType]); + fwprintf(out_file, L"%20s\n", tokenTypestr[tokenType]); } - fflush(target); + fflush(out_file); }