Refine data structures

This commit is contained in:
Stephen Chung
2022-03-05 17:57:23 +08:00
parent e06c2b2abb
commit 8bda8c64df
15 changed files with 235 additions and 219 deletions

View File

@@ -127,7 +127,7 @@ pub struct TryCatchBlock {
/// `try` block.
pub try_block: StmtBlock,
/// `catch` variable, if any.
pub catch_var: Option<Ident>,
pub catch_var: Ident,
/// `catch` block.
pub catch_block: StmtBlock,
}
@@ -346,7 +346,7 @@ pub enum Stmt {
/// * [`NEGATED`][ASTFlags::NEGATED] = `until`
Do(Box<(Expr, StmtBlock)>, ASTFlags, Position),
/// `for` `(` id `,` counter `)` `in` expr `{` stmt `}`
For(Box<(Ident, Option<Ident>, Expr, StmtBlock)>, Position),
For(Box<(Ident, Ident, Expr, StmtBlock)>, Position),
/// \[`export`\] `let`|`const` id `=` expr
///
/// ### Flags
@@ -385,7 +385,7 @@ pub enum Stmt {
///
/// Not available under `no_module`.
#[cfg(not(feature = "no_module"))]
Import(Box<(Expr, Option<Ident>)>, Position),
Import(Box<(Expr, Ident)>, Position),
/// `export` var `as` alias
///
/// Not available under `no_module`.