aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-01-30 22:34:19 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-01-30 22:34:19 +0100
commit4253c1c20013ab16564aa3ec34585dd1a358d182 (patch)
treef1d96d0aa8c4af949b1284129d6366d697139bb0 /src/lib.rs
parent1a82b85817646aded501051f4e9d651f7c0d4970 (diff)
downloadsylt-4253c1c20013ab16564aa3ec34585dd1a358d182.tar.gz
add in tuples
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 4 insertions, 0 deletions
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,