From 4253c1c20013ab16564aa3ec34585dd1a358d182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Sat, 30 Jan 2021 22:34:19 +0100 Subject: add in tuples --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 248a589..9a9aaa7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -408,6 +408,7 @@ pub enum Op { Constant(Value), Tuple(usize), + Index, Get(String), Set(String), @@ -590,6 +591,9 @@ impl PartialEq for Type { (Type::Float, Type::Float) => true, (Type::Bool, Type::Bool) => true, (Type::String, Type::String) => true, + (Type::Tuple(a), Type::Tuple(b)) => { + a.iter().zip(b.iter()).all(|(a, b)| a == b) + } (Type::Function(a_args, a_ret), Type::Function(b_args, b_ret)) => a_args == b_args && a_ret == b_ret, _ => false, -- cgit v1.2.1