summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crates/rebel-lang/src/typing.rs4
-rw-r--r--crates/rebel-lang/src/value.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/crates/rebel-lang/src/typing.rs b/crates/rebel-lang/src/typing.rs
index 7472968..ebb3116 100644
--- a/crates/rebel-lang/src/typing.rs
+++ b/crates/rebel-lang/src/typing.rs
@@ -153,6 +153,10 @@ impl Type {
(Int, Le, Int) => Bool,
(Int, Ge, Int) => Bool,
(Int, Gt, Int) => Bool,
+ (Str, Lt, Str) => Bool,
+ (Str, Le, Str) => Bool,
+ (Str, Ge, Str) => Bool,
+ (Str, Gt, Str) => Bool,
_ => return Err(TypeError),
})
}
diff --git a/crates/rebel-lang/src/value.rs b/crates/rebel-lang/src/value.rs
index 1eafc97..112f689 100644
--- a/crates/rebel-lang/src/value.rs
+++ b/crates/rebel-lang/src/value.rs
@@ -116,6 +116,10 @@ impl Value {
(Int(i1), Le, Int(i2)) => Bool(i1 <= i2),
(Int(i1), Ge, Int(i2)) => Bool(i1 >= i2),
(Int(i1), Gt, Int(i2)) => Bool(i1 > i2),
+ (Str(i1), Lt, Str(i2)) => Bool(i1 < i2),
+ (Str(i1), Le, Str(i2)) => Bool(i1 <= i2),
+ (Str(i1), Ge, Str(i2)) => Bool(i1 >= i2),
+ (Str(i1), Gt, Str(i2)) => Bool(i1 > i2),
_ => return Err(EvalError),
})
}