syn
syn copied to clipboard
Is there any plan to fully support let-else?
Currently, let_else will be treated as ExprVerbatim:
[tests/test_stmt.rs:108] &stmt = Ok(
Semi(
Verbatim(
TokenStream [
Ident {
sym: let,
},
Ident {
sym: Some,
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
sym: x,
},
],
},
Punct {
char: '=',
spacing: Alone,
},
Ident {
sym: None,
},
Ident {
sym: else,
},
Group {
delimiter: Brace,
stream: TokenStream [
Ident {
sym: yield,
},
Literal {
lit: 1,
},
Punct {
char: ';',
spacing: Alone,
},
],
},
],
),
Semi,
),
)
I'd like to contribute to it! But I'm not sure whether it will be accepted for an unstable feature
It seems that we can add a new field else_branch: Box<Expr> in struct Local
It looks reasonable. I think it is the right moment to do so, as let-else get into stable in next month (i.e. it is in beta now).