X-Git-Url: https://git.piment-noir.org/?p=TP_AL_C.git;a=blobdiff_plain;f=lexer%2Fprint_helper.c;fp=lexer%2Fprint_helper.c;h=630985be4a8331b5f5147b21e084b03d10aab720;hp=f7ab04ffb9887b2e2fbdf5d96ea06b6016ca509c;hb=f196dae589431452a3eb37a2aa985d882f695407;hpb=7cfc17fb01df603682946e58acc973f7d9e5f0bc diff --git a/lexer/print_helper.c b/lexer/print_helper.c index f7ab04f..630985b 100644 --- a/lexer/print_helper.c +++ b/lexer/print_helper.c @@ -1,7 +1,7 @@ -#include #include #include +#include "print_helper.h" #include "global_vars.h" void pr_warning(const char* format, ...) { @@ -53,19 +53,11 @@ void wpr_error(const wchar_t *format, ...) { fflush(stderr); } -void wprint_token_stdout() { +void wprint_token(FILE* out_file) { if (tokenType == MOT || tokenType == MOTCLE) { - fwprintf(stdout, L"%20s: %ls\n", tokenTypestr[tokenType], token[tokenFound].value); + fwprintf(out_file, L"%20s: %ls\n", tokenTypestr[tokenType], token[tokenFound].value); } else { - fwprintf(stdout, L"%20s\n", tokenTypestr[tokenType]); - } - fflush(stdout); -} - -void wprint_token_target() { - if (tokenType == MOT || tokenType == MOTCLE) { - fwprintf(target, L"%20s: %ls\n", tokenTypestr[tokenType], token[tokenFound].value); - } else { - fwprintf(target, L"%20s\n", tokenTypestr[tokenType]); + fwprintf(out_file, L"%20s\n", tokenTypestr[tokenType]); } + fflush(out_file); }