Fix runtime error msg
This commit is contained in:
parent
1ade6cae50
commit
748bd10dd9
@ -12,7 +12,7 @@ use crate::{
|
|||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
pub enum RuntimeError {
|
pub enum RuntimeError {
|
||||||
#[error("Invalid array Index: {}", 0.to_string())]
|
#[error("Invalid array Index: {0:?}")]
|
||||||
InvalidArrayIndex(Value),
|
InvalidArrayIndex(Value),
|
||||||
|
|
||||||
#[error("Variable used but not declared: {0}")]
|
#[error("Variable used but not declared: {0}")]
|
||||||
@ -21,10 +21,10 @@ pub enum RuntimeError {
|
|||||||
#[error("Can't index into non-array variable: {0}")]
|
#[error("Can't index into non-array variable: {0}")]
|
||||||
TryingToIndexNonArray(String),
|
TryingToIndexNonArray(String),
|
||||||
|
|
||||||
#[error("Invalid value type for unary operation: {}", 0.to_string())]
|
#[error("Invalid value type for unary operation: {0:?}")]
|
||||||
UnOpInvalidType(Value),
|
UnOpInvalidType(Value),
|
||||||
|
|
||||||
#[error("Incompatible binary operations. Operands don't match: {} {}", 0.to_string(), 1.to_string())]
|
#[error("Incompatible binary operations. Operands don't match: {0:?} and {1:?}")]
|
||||||
BinOpIncompatibleTypes(Value, Value),
|
BinOpIncompatibleTypes(Value, Value),
|
||||||
|
|
||||||
#[error("Array access out of bounds: Accessed {0}, size is {1}")]
|
#[error("Array access out of bounds: Accessed {0}, size is {1}")]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user