From a9c73a4915fe990123e1e6b29bf8425926ce3017 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 28 Feb 2022 11:10:33 +0800 Subject: [PATCH] fix some error strings --- nac3artiq/src/lib.rs | 4 ++-- nac3artiq/src/symbol_resolver.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nac3artiq/src/lib.rs b/nac3artiq/src/lib.rs index 11aa56db6..9ce429695 100644 --- a/nac3artiq/src/lib.rs +++ b/nac3artiq/src/lib.rs @@ -500,7 +500,7 @@ impl Nac3 { .register_top_level(stmt.clone(), Some(resolver.clone()), path.clone()) .map_err(|e| { CompileError::new_err(format!( - "nac3 compilation failure\n----------\n{}", + "compilation failed\n----------\n{}", e )) })?; @@ -586,7 +586,7 @@ impl Nac3 { // report error of __modinit__ separately if !e.contains("__nac3_synthesized_modinit__") { return Err(CompileError::new_err(format!( - "nac3 compilation failure: \n----------\n{}", + "compilation failed\n----------\n{}", e ))); } else { diff --git a/nac3artiq/src/symbol_resolver.rs b/nac3artiq/src/symbol_resolver.rs index ad3241397..baf122c7d 100644 --- a/nac3artiq/src/symbol_resolver.rs +++ b/nac3artiq/src/symbol_resolver.rs @@ -454,7 +454,7 @@ impl InnerResolver { pyo3::types::PyModule::import(py, "builtins").unwrap().getattr("repr").unwrap(); let str_repr: String = str_fn.call1((pyty,)).unwrap().extract().unwrap(); Ok(Err(format!( - "{} is not supported in nac3 (did you forgot to put @nac3 annotation?)", + "{} is not registered with NAC3 (@nac3 decorator missing?)", str_repr ))) } @@ -931,7 +931,7 @@ impl SymbolResolver for Resolver { let py_id = self.0.name_to_pyid.get(&id).ok_or(format!("Undefined identifier `{}`", id))?; let result = self.0.pyid_to_def.read().get(py_id).copied().ok_or(format!( - "`{}` is not registered in nac3, did you forgot to add @nac3?", + "`{}` is not registered with NAC3 (@nac3 decorator missing?)", id ))?; self.0.id_to_def.write().insert(id, result);