diff --git a/src/main.rs b/src/main.rs index 1be9130..23f48c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,7 +27,7 @@ // * [x] `as` patterns // * [x] splat patterns in tuples, lists, dicts // * [x] splats in list and dict literals -// * [ ] `loop` and `recur` +// * [x] `loop` and `recur` // * [ ] string patterns // * [ ] string interpolation // * [~] write `base` in Rust @@ -57,10 +57,10 @@ use crate::base::*; pub fn main() { let src = " -let foo = :foo +let foo = false loop (foo) with { (:foo) -> :done - (x as :bool) -> recur (:bar) + (x as :boolean) -> recur (:bar) (x as :number) -> recur (:foo) (x as :keyword) -> recur (:foo) } diff --git a/src/value.rs b/src/value.rs index 1181719..6f5c2bf 100644 --- a/src/value.rs +++ b/src/value.rs @@ -142,6 +142,7 @@ impl<'src> Value<'src> { Value::Placeholder => unreachable!(), Value::Args(_) => unreachable!(), Value::Base(_) => Value::Keyword("fn"), + Value::Recur(..) => unreachable!(), } } }