Commit bafe31bb authored by Jeff Smits's avatar Jeff Smits

Handle nested Seq on the lhs to be in the same list

parent 813fb58d
......@@ -312,13 +312,16 @@ impl<'a> TryFrom<ctree::Strategy<'a>> for Strategy<'a> {
I::Scope(fresh_vars, body) => try_into_box(body).map(|body| O::Scope(fresh_vars, body)),
I::Seq(first, second) => {
let mut children = Vec::new();
children.push((*first).try_into()?);
let mut value = *second;
while let I::Seq(first, second) = value {
children.push((*first).try_into()?);
value = *second;
let mut cont_stack = vec![second, first];
while let Some(value) = cont_stack.pop() {
let value = *value;
if let I::Seq(first, second) = value {
cont_stack.push(second);
cont_stack.push(first);
} else {
children.push(value.try_into()?);
}
}
children.push(value.try_into()?);
Ok(O::Seq(children.into_boxed_slice()))
}
I::GuardedLChoice(s_if, s_then, s_else) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment