Add loop expressions.

This commit is contained in:
Stephen Chung
2022-10-29 12:09:18 +08:00
parent 6af66d3ed3
commit c14fbdb14d
10 changed files with 146 additions and 73 deletions

View File

@@ -581,14 +581,14 @@ pub enum Stmt {
TryCatch(Box<TryCatchBlock>, Position),
/// [expression][Expr]
Expr(Box<Expr>),
/// `continue`/`break`
/// `continue`/`break` expr
///
/// ### Flags
///
/// * [`NONE`][ASTFlags::NONE] = `continue`
/// * [`BREAK`][ASTFlags::BREAK] = `break`
BreakLoop(ASTFlags, Position),
/// `return`/`throw`
BreakLoop(Option<Box<Expr>>, ASTFlags, Position),
/// `return`/`throw` expr
///
/// ### Flags
///