From 92c75d7322dd86ef136e602f74fbca9c70aff3b1 Mon Sep 17 00:00:00 2001 From: LunaAmora Date: Mon, 10 Jun 2024 16:16:17 -0300 Subject: [PATCH] Fix backticks in imports error messages --- src/imports.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/imports.rs b/src/imports.rs index fc9141a4..c8942eef 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -82,7 +82,7 @@ impl Imports { for (sub, alias) in names { if !book.top_level_names().contains(sub) { - let err = format!("Package `{src}` does not contain the top level name `{sub}`"); + let err = format!("Package '{src}' does not contain the top level name '{sub}'"); diag.add_book_error(err); continue; } @@ -111,7 +111,7 @@ fn add_bind(map: &mut ImportsMap, name: Name, alias: Option, src: &str, di if let Some(old) = map.binds.get(&aliased) { let old = &map.sources[*old]; - let warn = format!("The import `{src}` shadows the imported name `{old}`"); + let warn = format!("The import '{src}' shadows the imported name '{old}'"); diag.add_book_warning(warn, WarningType::ImportShadow); } @@ -188,19 +188,19 @@ impl ParseBook { // Collect local imports binds, surrounded by `__` if not imported by the main book. for (bind, src) in self.imports.map.iter().rev() { if self.contains_def(bind) { - let warn = format!("The local definition `{bind}` shadows the imported name `{src}`"); + let warn = format!("The local definition '{bind}' shadows the imported name '{src}'"); diag.add_book_warning(warn, WarningType::ImportShadow); continue; } if self.ctrs.contains_key(bind) { - let warn = format!("The local constructor `{bind}` shadows the imported name `{src}`"); + let warn = format!("The local constructor '{bind}' shadows the imported name '{src}'"); diag.add_book_warning(warn, WarningType::ImportShadow); continue; } if self.adts.contains_key(bind) { - let warn = format!("The local type `{bind}` shadows the imported name `{src}`"); + let warn = format!("The local type '{bind}' shadows the imported name '{src}'"); diag.add_book_warning(warn, WarningType::ImportShadow); continue; } @@ -351,10 +351,10 @@ impl ParseBook { fn add_imported_def(&mut self, def: Definition, diag: &mut Diagnostics) { let name = &def.name; if self.contains_def(name) { - let err = format!("The imported definition `{name}` conflicts with the definition '{name}'."); + let err = format!("The imported definition '{name}' conflicts with the definition '{name}'."); diag.add_book_error(err); } else if self.ctrs.contains_key(name) { - let err = format!("The imported definition `{name}` conflicts with the constructor '{name}'."); + let err = format!("The imported definition '{name}' conflicts with the constructor '{name}'."); diag.add_book_error(err); }