From 3b3d248637bdeffb5211e9a50db6f0d239cc1fd1 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 6 Apr 2020 19:58:21 +0300 Subject: [PATCH] scanner: use formatted errors for s.error too --- vlib/v/scanner/scanner.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vlib/v/scanner/scanner.v b/vlib/v/scanner/scanner.v index ced523ccf4..9969caeb86 100644 --- a/vlib/v/scanner/scanner.v +++ b/vlib/v/scanner/scanner.v @@ -1016,7 +1016,11 @@ fn good_type_name(s string) bool { } pub fn (s &Scanner) error(msg string) { - println('$s.line_nr : $msg') + pos := token.Position{ + line_nr: s.line_nr + pos: s.pos + } + eprintln(util.formated_error('error', msg, s.file_path, pos)) exit(1) }