Browse Source

Change print*_err to eprint* in core library

gingerBill 6 years ago
parent
commit
562b518394

+ 3 - 3
core/encoding/cel/cel.odin

@@ -168,9 +168,9 @@ destroy :: proc(p: ^Parser) {
 }
 }
 
 
 error :: proc(p: ^Parser, pos: Pos, msg: string, args: ..any) {
 error :: proc(p: ^Parser, pos: Pos, msg: string, args: ..any) {
-	fmt.printf_err("%s(%d:%d) Error: ", pos.file, pos.line, pos.column);
-	fmt.printf_err(msg, ..args);
-	fmt.println_err();
+	fmt.eprintf("%s(%d:%d) Error: ", pos.file, pos.line, pos.column);
+	fmt.eprintf(msg, ..args);
+	fmt.eprintln();
 
 
 	p.error_count += 1;
 	p.error_count += 1;
 }
 }

+ 3 - 3
core/encoding/cel/token.odin

@@ -183,9 +183,9 @@ tokenizer_init :: proc(t: ^Tokenizer, src: []byte, file := "") {
 }
 }
 
 
 token_error :: proc(t: ^Tokenizer, msg: string, args: ..any) {
 token_error :: proc(t: ^Tokenizer, msg: string, args: ..any) {
-	fmt.printf_err("%s(%d:%d) Error: ", t.file, t.line_count, t.read_offset-t.line_offset+1);
-	fmt.printf_err(msg, ..args);
-	fmt.println_err();
+	fmt.eprintf("%s(%d:%d) Error: ", t.file, t.line_count, t.read_offset-t.line_offset+1);
+	fmt.eprintf(msg, ..args);
+	fmt.eprintln();
 	t.error_count += 1;
 	t.error_count += 1;
 }
 }
 
 

+ 6 - 6
core/odin/parser/parser.odin

@@ -51,14 +51,14 @@ Import_Decl_Kind :: enum {
 
 
 
 
 default_warning_handler :: proc(pos: token.Pos, msg: string, args: ..any) {
 default_warning_handler :: proc(pos: token.Pos, msg: string, args: ..any) {
-	fmt.printf_err("%s(%d:%d): Warning: ", pos.file, pos.line, pos.column);
-	fmt.printf_err(msg, ..args);
-	fmt.printf_err("\n");
+	fmt.eprintf("%s(%d:%d): Warning: ", pos.file, pos.line, pos.column);
+	fmt.eprintf(msg, ..args);
+	fmt.eprintf("\n");
 }
 }
 default_error_handler :: proc(pos: token.Pos, msg: string, args: ..any) {
 default_error_handler :: proc(pos: token.Pos, msg: string, args: ..any) {
-	fmt.printf_err("%s(%d:%d): ", pos.file, pos.line, pos.column);
-	fmt.printf_err(msg, ..args);
-	fmt.printf_err("\n");
+	fmt.eprintf("%s(%d:%d): ", pos.file, pos.line, pos.column);
+	fmt.eprintf(msg, ..args);
+	fmt.eprintf("\n");
 }
 }
 
 
 warn :: proc(p: ^Parser, pos: token.Pos, msg: string, args: ..any) {
 warn :: proc(p: ^Parser, pos: token.Pos, msg: string, args: ..any) {

+ 3 - 3
core/odin/tokenizer/tokenizer.odin

@@ -54,9 +54,9 @@ offset_to_pos :: proc(t: ^Tokenizer, offset: int) -> token.Pos {
 }
 }
 
 
 default_error_handler :: proc(pos: token.Pos, msg: string, args: ..any) {
 default_error_handler :: proc(pos: token.Pos, msg: string, args: ..any) {
-	fmt.printf_err("%s(%d:%d) ", pos.file, pos.line, pos.column);
-	fmt.printf_err(msg, ..args);
-	fmt.printf_err("\n");
+	fmt.eprintf("%s(%d:%d) ", pos.file, pos.line, pos.column);
+	fmt.eprintf(msg, ..args);
+	fmt.eprintf("\n");
 }
 }
 
 
 error :: proc(t: ^Tokenizer, offset: int, msg: string, args: ..any) {
 error :: proc(t: ^Tokenizer, offset: int, msg: string, args: ..any) {