1
0
forked from bonsai/harakit

rpn(1): changes to error message

This commit is contained in:
Emma Tebibyte 2024-02-02 13:04:57 -07:00
parent 258881dbb2
commit 885f167afc
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270

View File

@ -129,18 +129,18 @@ fn eval(
};
match x {
Val(x_) => stack.push_back(x_),
Val(v) => stack.push_back(v),
_ => ops.push_back(x),
}
}
for op in &ops {
match op {
Val(_) => {
return Err(EvaluationError {
message: "Unexpected value in the operator stack."
.to_string()
})
Val(v) => {
return Err(EvaluationError { message: format!(
"{}: Unexpected value in the operator stack.",
v
)});
},
_ => {
let (x, y) = (