From ac191716d9114f0c0aab977f0af821af87a557b7 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Thu, 4 Jan 2024 19:39:31 +0100 Subject: [PATCH] Add column number --- src/errors.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/errors.cpp b/src/errors.cpp index 53308b9..ca5fc82 100644 --- a/src/errors.cpp +++ b/src/errors.cpp @@ -76,10 +76,11 @@ void print_error_position(vector history, CodePosition pos) { void print_error_stack_trace(vector history, const RuntimeError& error) { cout << "\n" BOLD "Traceback" RESET " (most recent call last)" << endl; for (StackTraceEntry e : error.trace) { - cout << BOLD << setw(4) << setfill(' ') - << get<1>(e).line+1 << RESET BLUE + cout << BOLD << setw(8) << setfill(' ') + << to_string(get<1>(e).line+1) + ":" + to_string(get<1>(e).column+1) + << RESET BLUE << setw(16) << setfill(' ') - << get<0>(e) << RESET << "\t" + << get<0>(e) << RESET << " \t" << trim(history[get<1>(e).line]) << endl; }