-#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
+#include <stdarg.h>
+#include "print_helper.h"
#include "global_vars.h"
void pr_warning(const char* 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);
}