From 3f1b9c6096432435349aa3915e1f12709dbdae3a Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Wed, 13 May 2020 01:46:37 +0900 Subject: [PATCH] Fix SyntaxError visualize order: message first location later --- src/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index 38e5430..86635bc 100644 --- a/src/error.rs +++ b/src/error.rs @@ -125,7 +125,7 @@ impl fmt::Display for CompileError { if self.location.column() > 0 { if let Some(line) = statement.lines().nth(self.location.row() - 1) { // visualize the error, when location and statement are provided - return write!(f, "\n{}\n{}", line, self.location.visualize(&error_desc)); + return write!(f, "{}", self.location.visualize(line, &error_desc)); } } }