interpret loop & recur
This commit is contained in:
parent
423f43b7fd
commit
ad076622aa
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ impl<'src> Value<'src> {
|
|||
Value::Placeholder => unreachable!(),
|
||||
Value::Args(_) => unreachable!(),
|
||||
Value::Base(_) => Value::Keyword("fn"),
|
||||
Value::Recur(..) => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user