Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/expressions.rs')
| -rw-r--r-- | crates/parser/src/grammar/expressions.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index fe1316c9bf..34dcf2a182 100644 --- a/crates/parser/src/grammar/expressions.rs +++ b/crates/parser/src/grammar/expressions.rs @@ -4,8 +4,8 @@ use crate::grammar::attributes::ATTRIBUTE_FIRST; use super::*; +pub(super) use atom::{LITERAL_FIRST, literal}; pub(crate) use atom::{block_expr, match_arm_list}; -pub(super) use atom::{literal, LITERAL_FIRST}; #[derive(PartialEq, Eq)] pub(super) enum Semicolon { @@ -58,7 +58,7 @@ pub(super) fn stmt(p: &mut Parser<'_>, semicolon: Semicolon) { // } attributes::outer_attrs(p); - if p.at(T![let]) { + if p.at(T![let]) || (p.at(T![super]) && p.nth_at(1, T![let])) { let_stmt(p, semicolon); m.complete(p, LET_STMT); return; @@ -113,8 +113,9 @@ pub(super) fn stmt(p: &mut Parser<'_>, semicolon: Semicolon) { } // test let_stmt -// fn f() { let x: i32 = 92; } +// fn f() { let x: i32 = 92; super let y; super::foo; } pub(super) fn let_stmt(p: &mut Parser<'_>, with_semi: Semicolon) { + p.eat(T![super]); p.bump(T![let]); patterns::pattern(p); if p.at(T![:]) { |