diff --git a/cl-interpret/src/interpret.rs b/cl-interpret/src/interpret.rs index c059596..1afb039 100644 --- a/cl-interpret/src/interpret.rs +++ b/cl-interpret/src/interpret.rs @@ -141,7 +141,7 @@ impl Interpret for Assign { let head = match &head.kind { ExprKind::Path(Path { parts, .. }) if parts.len() == 1 => { match parts.last().expect("parts should not be empty") { - PathPart::SuperKw => Err(Error::NotAssignable(head.extents.head))?, + PathPart::SuperKw => Err(Error::NotAssignable)?, PathPart::SelfKw => todo!("Assignment to `self`"), PathPart::Ident(Identifier(s)) => s, } @@ -153,7 +153,7 @@ impl Interpret for Assign { ExprKind::Empty | ExprKind::Group(_) | ExprKind::Tuple(_) => { todo!("Pattern Destructuring?") } - _ => Err(Error::NotAssignable(head.extents.head))?, + _ => Err(Error::NotAssignable)?, }; // Get the initializer and the tail let init = tail.interpret(env)?; diff --git a/cl-interpret/src/lib.rs b/cl-interpret/src/lib.rs index b5e9b41..70d6901 100644 --- a/cl-interpret/src/lib.rs +++ b/cl-interpret/src/lib.rs @@ -522,7 +522,6 @@ pub mod error { //! The [Error] type represents any error thrown by the [Environment](super::Environment) use super::temp_type_impl::ConValue; - use cl_structures::span::Loc; pub type IResult = Result; @@ -546,12 +545,12 @@ pub mod error { TypeError, /// In clause of For loop didn't yield a Range NotIterable, - /// A value at this [location](struct@Loc) can't be indexed - NotIndexable(Loc), + /// A value could not be indexed + NotIndexable, /// An array index went out of bounds OobIndex(usize, usize), - /// An expression at this [location](struct@Loc)ation is not assignable - NotAssignable(Loc), + /// An expression is not assignable + NotAssignable, /// A name was not defined in scope before being used NotDefined(String), /// A name was defined but not initialized @@ -578,14 +577,14 @@ pub mod error { Error::ScopeExit => "Exited the last scope. This is a logic bug.".fmt(f), Error::TypeError => "Incompatible types".fmt(f), Error::NotIterable => "`in` clause of `for` loop did not yield an iterable".fmt(f), - Error::NotIndexable(location) => { - write!(f, "{location} expression cannot be indexed") + Error::NotIndexable => { + write!(f, "expression cannot be indexed") } Error::OobIndex(idx, len) => { write!(f, "Index out of bounds: index was {idx}. but len is {len}") } - Error::NotAssignable(location) => { - write!(f, "{location} expression is not assignable") + Error::NotAssignable => { + write!(f, "expression is not assignable") } Error::NotDefined(value) => { write!(f, "{value} not bound. Did you mean `let {value};`?")