ast: add continue expression

This commit is contained in:
2025-10-28 22:47:58 -04:00
parent fb8677c937
commit d5e25a15dc
4 changed files with 5 additions and 0 deletions

View File

@@ -354,6 +354,7 @@ impl<A: Annotation> Display for Expr<A> {
Self::Bind(v) => v.fmt(f),
Self::Make(v) => v.fmt(f),
Self::Op(op @ Op::Continue, exprs) => f.delimit(op, "").list(exprs, "!?,"),
Self::Op(op @ (Op::If | Op::While), exprs) => match exprs.as_slice() {
[cond, pass, Anno(Expr::Op(Op::Tuple, e), _)] if e.is_empty() => {
write!(f, "{op}{cond} {pass}")