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 | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index c585fdb096..9dbba89c56 100644 --- a/crates/parser/src/grammar/expressions.rs +++ b/crates/parser/src/grammar/expressions.rs @@ -30,6 +30,10 @@ fn expr_no_struct(p: &mut Parser) { } pub(super) fn stmt(p: &mut Parser, semicolon: Semicolon) { + if p.eat(T![;]) { + return; + } + let m = p.start(); // test attr_on_expr_stmt // fn foo() { @@ -143,12 +147,6 @@ pub(super) fn expr_block_contents(p: &mut Parser) { // fn f() {}; // struct S {}; // } - - if p.at(T![;]) { - p.bump(T![;]); - continue; - } - stmt(p, Semicolon::Required); } } |