diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-02-15 18:50:28 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-02-15 18:50:28 +0100 |
| commit | 519a9e5360f2cf0438dd09cfa3070bb9c8819f40 (patch) | |
| tree | 3773663638fd1d46767571a1e6420751e6e67cd8 /src/lib.rs | |
| parent | 70e8af6688dec3743b8ffa441f3cb22dfc9d24d6 (diff) | |
| download | sylt-519a9e5360f2cf0438dd09cfa3070bb9c8819f40.tar.gz | |
BlobInstance -> Instance
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -85,14 +85,14 @@ pub enum Type { Tuple(Vec<Type>), Function(Vec<Type>, Box<Type>), Blob(usize), - BlobInstance(usize), + Instance(usize), } impl PartialEq for Type { fn eq(&self, other: &Self) -> bool { match (self, other) { (Type::Void, Type::Void) => true, - (Type::BlobInstance(a), Type::BlobInstance(b)) => a == b, + (Type::Instance(a), Type::Instance(b)) => a == b, (Type::Blob(a), Type::Blob(b)) => a == b, (Type::Int, Type::Int) => true, (Type::Float, Type::Float) => true, @@ -111,7 +111,7 @@ impl PartialEq for Type { impl From<&Value> for Type { fn from(value: &Value) -> Type { match value { - Value::BlobInstance(i, _) => Type::BlobInstance(*i), + Value::Instance(i, _) => Type::Instance(*i), Value::Blob(i) => Type::Blob(*i), Value::Tuple(v) => { Type::Tuple(v.iter().map(|x| Type::from(x)).collect()) @@ -137,7 +137,7 @@ impl From<&Type> for Value { match ty { Type::Void => Value::Nil, Type::Blob(i) => Value::Blob(*i), - Type::BlobInstance(i) => Value::BlobInstance(*i, Rc::new(RefCell::new(Vec::new()))), + Type::Instance(i) => Value::Instance(*i, Rc::new(RefCell::new(Vec::new()))), Type::Tuple(fields) => { Value::Tuple(Rc::new(fields.iter().map(Value::from).collect())) } @@ -164,7 +164,7 @@ impl From<Type> for Value { pub enum Value { Ty(Type), Blob(usize), - BlobInstance(usize, Rc<RefCell<Vec<Value>>>), + Instance(usize, Rc<RefCell<Vec<Value>>>), Tuple(Rc<Vec<Value>>), Float(f64), Int(i64), @@ -181,7 +181,7 @@ impl Debug for Value { match self { Value::Ty(ty) => write!(fmt, "(type {:?})", ty), Value::Blob(i) => write!(fmt, "(blob {})", i), - Value::BlobInstance(i, v) => write!(fmt, "(inst {} {:?})", i, v), + Value::Instance(i, v) => write!(fmt, "(inst {} {:?})", i, v), Value::Float(f) => write!(fmt, "(float {})", f), Value::Int(i) => write!(fmt, "(int {})", i), Value::Bool(b) => write!(fmt, "(bool {})", b), |
