diff options
author | Akshay <[email protected]> | 2021-04-11 11:01:32 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-04-12 11:02:49 +0100 |
commit | abcf2b32777ffb934788e3219cacc2bbc048b6a3 (patch) | |
tree | d310c7d2c69531a4583dac7ab34705f6ae5c12c7 /src/lisp/eval.rs | |
parent | b0685c1638044b85dc7e8b07555a7b639b54d69a (diff) |
add `selection-start` and `selection-end` primitives
Diffstat (limited to 'src/lisp/eval.rs')
-rw-r--r-- | src/lisp/eval.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lisp/eval.rs b/src/lisp/eval.rs index 0cf267c..b404662 100644 --- a/src/lisp/eval.rs +++ b/src/lisp/eval.rs | |||
@@ -217,12 +217,13 @@ where | |||
217 | 217 | ||
218 | pub fn eval_for(&mut self, args: &[LispExpr]) -> Result<LispExpr, LispError> { | 218 | pub fn eval_for(&mut self, args: &[LispExpr]) -> Result<LispExpr, LispError> { |
219 | let arity = Arity::Exact(2); | 219 | let arity = Arity::Exact(2); |
220 | let valid_binding_stmt = |expr: &LispExpr| | 220 | let valid_binding_stmt = |expr: &LispExpr| { |
221 | matches!( | 221 | matches!( |
222 | expr, | 222 | expr, |
223 | LispExpr::List(v) | 223 | LispExpr::List(v) |
224 | if v.len() == 2 | 224 | if v.len() == 2 |
225 | && matches!(v[0], LispExpr::Ident(_))); | 225 | && matches!(v[0], LispExpr::Ident(_))) |
226 | }; | ||
226 | 227 | ||
227 | if !arity.check(args) { | 228 | if !arity.check(args) { |
228 | Err(arity.to_error()) | 229 | Err(arity.to_error()) |
@@ -258,8 +259,8 @@ where | |||
258 | } | 259 | } |
259 | _ => { | 260 | _ => { |
260 | error!("invalid for loop args"); | 261 | error!("invalid for loop args"); |
261 | Err(EvalError::BadForm.into()) | 262 | Err(EvalError::BadForm.into()) |
262 | }, | 263 | } |
263 | } | 264 | } |
264 | } | 265 | } |
265 | } | 266 | } |