summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-03-10 16:31:06 +1300
committerBen Bridle <ben@derelict.engineering>2025-03-10 16:31:06 +1300
commit6fb6f2836232fe78dce507fa899629bbefb7b449 (patch)
tree6d5dac71eb5e06bddacce63d6ad11b117513af35 /src
parent5e332adb606074da1976c8ce6e32b94ba222bc82 (diff)
downloadassembler-6fb6f2836232fe78dce507fa899629bbefb7b449.zip
Make output of report_source_issue more concise
Instead of displaying two locations for the same error, only show the in_merged source location if there is no in_source location.
Diffstat (limited to 'src')
-rw-r--r--src/reports/mod.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/reports/mod.rs b/src/reports/mod.rs
index eb7a52f..01635b4 100644
--- a/src/reports/mod.rs
+++ b/src/reports/mod.rs
@@ -29,10 +29,8 @@ pub fn report_source_issue(level: LogLevel, context: &Context, message: &str) {
// Format message and locations.
push!("{NORMAL}\n");
- push!("{BLUE}{arrow:>w$}{NORMAL} {in_merged}\n", w=w);
- if let Some(in_source) = &context.source.in_source {
- push!("{BLUE}{arrow:>w$}{NORMAL} {in_source}\n", w=w);
- }
+ let location = context.source.location();
+ push!("{BLUE}{arrow:>w$}{NORMAL} {location}\n", w=w);
// Format source context.
let left = in_merged.start.column;