mirror of
https://github.com/tiffany352/rink-rs
synced 2024-11-10 13:44:15 +00:00
Throw error when inequalities are input
This commit is contained in:
parent
99d277b16b
commit
190ac4b9f1
1 changed files with 9 additions and 1 deletions
10
src/eval.rs
10
src/eval.rs
|
@ -91,7 +91,15 @@ impl Context {
|
|||
(&a * &b).map_err(|e| format!("{}: <{}> * <{}>", e, a.show(self), b.show(self)))
|
||||
})
|
||||
}),
|
||||
Expr::Equals(_, ref right) => self.eval(right),
|
||||
Expr::Equals(ref left, ref right) => {
|
||||
match **left {
|
||||
Expr::Unit(_) => (),
|
||||
ref x => return Err(format!(
|
||||
"= is currently only used for inline unit definitions: \
|
||||
expected unit, got {}", x))
|
||||
};
|
||||
self.eval(right)
|
||||
},
|
||||
Expr::Of(ref field, ref val) => {
|
||||
let val = try!(self.eval(val));
|
||||
let val = match val {
|
||||
|
|
Loading…
Reference in a new issue